Archived
1
0
Fork 0

gnu: qucs: Build from git to fix bug.

* gnu/packages/engineering.scm (qucs): Add TODO comment.
[source]: Use git commit b4f27d9.
[native-inputs]: Add autoconf, automake, flex and bison.

Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org>
This commit is contained in:
Theodoros Foradis 2018-06-07 21:24:54 +02:00 committed by Danny Milosavljevic
parent bcc2e0ed2e
commit 4f12a62d18
No known key found for this signature in database
GPG key ID: E71A35542C30BAA5

View file

@ -4,7 +4,7 @@
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il> ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 David Thompson <davet@gnu.org> ;;; Copyright © 2016 David Thompson <davet@gnu.org>
;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org> ;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <theodoros@foradis.org>
;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org> ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
@ -1503,104 +1503,113 @@ parallel computing platforms. It also supports serial execution.")
license:lgpl2.0+)))) ; freehdl's libraries license:lgpl2.0+)))) ; freehdl's libraries
(define-public qucs (define-public qucs
(package ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
(name "qucs") ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
(version "0.0.19") ;; comment and update the package.
(source (origin (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
(method url-fetch) (revision "0"))
(uri (package
(string-append (name "qucs")
"https://sourceforge.net/projects/qucs/files/qucs/" version (version (git-version "0.0.19" revision commit))
"/qucs-" version ".tar.gz")) (source (origin
(sha256 (method git-fetch)
(base32 (uri (git-reference
"0giv9gfyfdizvjhq56x2pdncrlyv3k15lrsh6pk37i94vr7l7ij5")))) (url "https://github.com/Qucs/qucs")
(build-system gnu-build-system) (commit commit)))
(arguments (sha256
`(#:phases (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
(modify-phases %standard-phases (file-name (string-append name "-" version "-checkout"))))
(add-before 'configure 'patch-configure (build-system gnu-build-system)
(lambda* (#:key inputs #:allow-other-keys) (arguments
(substitute* "qucs/configure" `(#:phases
(("\\$QTDIR") (assoc-ref inputs "qt4"))) (modify-phases %standard-phases
#t)) (add-before 'configure 'patch-configure
(add-after 'patch-configure 'patch-scripts (lambda* (#:key inputs #:allow-other-keys)
(lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "qucs/configure"
(substitute* '("qucs/qucs/qucsdigi" (("\\$QTDIR") (assoc-ref inputs "qt4")))
"qucs/qucs/qucsdigilib" #t))
"qucs/qucs/qucsveri") (add-after 'patch-configure 'patch-scripts
(("\\$BINDIR") (lambda* (#:key inputs outputs #:allow-other-keys)
(string-append (assoc-ref outputs "out") "/bin")) (substitute* '("qucs/qucs/qucsdigi"
(("freehdl-config") "qucs/qucs/qucsdigilib"
(string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config")) "qucs/qucs/qucsveri")
(("freehdl-v2cc") (("\\$BINDIR")
(string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc")) (string-append (assoc-ref outputs "out") "/bin"))
(("cp ") (("freehdl-config")
(string-append (assoc-ref inputs "coreutils") "/bin/cp ")) (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
(("glibtool") (("freehdl-v2cc")
(string-append (assoc-ref inputs "libtool") "/bin/libtool")) (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
(("sed") (("cp ")
(string-append (assoc-ref inputs "sed") "/bin/sed")) (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
(("iverilog") (("glibtool")
(string-append (assoc-ref inputs "iverilog") "/bin/iverilog")) (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
(("vvp") (("sed")
(string-append (assoc-ref inputs "iverilog") "/bin/vvp"))) (string-append (assoc-ref inputs "sed") "/bin/sed"))
#t)) (("iverilog")
(add-before 'check 'pre-check (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
(lambda _ (("vvp")
;; The test suite requires a running X server. (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
(system "Xvfb :1 &") #t))
(setenv "DISPLAY" ":1") (add-before 'check 'pre-check
#t)) (lambda _
(add-after 'install 'make-wrapper ;; The test suite requires a running X server.
(lambda* (#:key inputs outputs #:allow-other-keys) (system "Xvfb :1 &")
(let ((out (assoc-ref outputs "out"))) (setenv "DISPLAY" ":1")
;; 'qucs' directly invokes gcc, hence this wrapping. #t))
(wrap-program (string-append out "/bin/qucs") (add-after 'install 'make-wrapper
`("CPLUS_INCLUDE_PATH" ":" prefix (lambda* (#:key inputs outputs #:allow-other-keys)
(,(string-append (assoc-ref inputs "gcc-toolchain") (let ((out (assoc-ref outputs "out")))
"/include"))) ;; 'qucs' directly invokes gcc, hence this wrapping.
`("PATH" ":" prefix (wrap-program (string-append out "/bin/qucs")
(,(string-append (assoc-ref inputs "gcc-toolchain") `("CPLUS_INCLUDE_PATH" ":" prefix
"/bin"))) (,(string-append (assoc-ref inputs "gcc-toolchain")
`("LIBRARY_PATH" ":" prefix "/include")))
(,(string-append (assoc-ref inputs "gcc-toolchain") `("PATH" ":" prefix
"/lib"))) (,(string-append (assoc-ref inputs "gcc-toolchain")
`("ADMSXMLBINDIR" ":" prefix "/bin")))
(,(string-append (assoc-ref inputs "adms") "/bin"))) `("LIBRARY_PATH" ":" prefix
`("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "gcc-toolchain")
(,(string-append (assoc-ref inputs "asco") "/bin"))) "/lib")))
`("QUCS_OCTAVE" ":" prefix `("ADMSXMLBINDIR" ":" prefix
(,(string-append (assoc-ref inputs "octave") "/bin/octave"))))) (,(string-append (assoc-ref inputs "adms") "/bin")))
#t))) `("ASCOBINDIR" ":" prefix
#:parallel-build? #f ; race condition (,(string-append (assoc-ref inputs "asco") "/bin")))
#:configure-flags '("--disable-doc"))) ; we need octave-epstk `("QUCS_OCTAVE" ":" prefix
(native-inputs (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
`(("gperf" ,gperf) #t)))
("libtool-native" ,libtool) #:parallel-build? #f ; race condition
("python" ,python-2) ; for tests #:configure-flags '("--disable-doc"))) ; we need octave-epstk
("matplotlib" ,python2-matplotlib) ; for tests (native-inputs
("numpy" ,python2-numpy) ; for tests `(("autoconf" ,autoconf)
("xorg-server" ,xorg-server))) ; for tests ("automake" ,automake)
(inputs ("bison" ,bison)
`(("adms" ,adms) ("flex" ,flex)
("asco" ,asco) ("gperf" ,gperf)
("coreutils" ,coreutils) ("libtool-native" ,libtool)
("freehdl" ,freehdl) ("pkg-config" ,pkg-config)
("gcc-toolchain" ,gcc-toolchain) ("python" ,python-2) ; for tests
("iverilog" ,iverilog) ("matplotlib" ,python2-matplotlib) ; for tests
("libtool" ,libtool) ("numpy" ,python2-numpy) ; for tests
("octave" ,octave) ("xorg-server" ,xorg-server))) ; for tests
("qt4" ,qt-4) (inputs
("sed" ,sed))) `(("adms" ,adms)
(home-page "http://qucs.sourceforge.net/") ("asco" ,asco)
(synopsis "Circuit simulator with graphical user interface") ("coreutils" ,coreutils)
(description ("freehdl" ,freehdl)
"Qucs is a circuit simulator with graphical user interface. The software ("gcc-toolchain" ,gcc-toolchain)
("iverilog" ,iverilog)
("libtool" ,libtool)
("octave" ,octave)
("qt4" ,qt-4)
("sed" ,sed)))
(home-page "http://qucs.sourceforge.net/")
(synopsis "Circuit simulator with graphical user interface")
(description
"Qucs is a circuit simulator with graphical user interface. The software
aims to support all kinds of circuit simulation types---e.g. DC, AC, aims to support all kinds of circuit simulation types---e.g. DC, AC,
S-parameter, transient, noise and harmonic balance analysis. Pure digital S-parameter, transient, noise and harmonic balance analysis. Pure digital
simulations are also supported.") simulations are also supported.")
(license license:gpl2+))) (license license:gpl2+))))
(define-public qucs-s (define-public qucs-s
(package (package