1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <theodoros@foradis.org>
8 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
9 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages engineering)
28 #:use-module (guix packages)
29 #:use-module (guix download)
30 #:use-module (guix gexp)
31 #:use-module (guix git-download)
32 #:use-module (guix monads)
33 #:use-module (guix store)
34 #:use-module (guix utils)
35 #:use-module ((srfi srfi-1) #:hide (zip))
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system python)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages algebra)
42 #:use-module (gnu packages autotools)
43 #:use-module (gnu packages base)
44 #:use-module (gnu packages bison)
45 #:use-module (gnu packages boost)
46 #:use-module (gnu packages check)
47 #:use-module (gnu packages commencement)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages curl)
50 #:use-module (gnu packages flex)
51 #:use-module (gnu packages fontutils)
52 #:use-module (gnu packages fpga)
53 #:use-module (gnu packages freedesktop)
54 #:use-module (gnu packages gcc)
55 #:use-module (gnu packages gd)
56 #:use-module (gnu packages gettext)
57 #:use-module (gnu packages ghostscript)
58 #:use-module (gnu packages gl)
59 #:use-module (gnu packages glib)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages gperf)
62 #:use-module (gnu packages gtk)
63 #:use-module (gnu packages guile)
64 #:use-module (gnu packages image)
65 #:use-module (gnu packages imagemagick)
66 #:use-module (gnu packages linux) ;FIXME: for pcb
67 #:use-module (gnu packages m4)
68 #:use-module (gnu packages maths)
69 #:use-module (gnu packages multiprecision)
70 #:use-module (gnu packages mpi)
71 #:use-module (gnu packages ncurses)
72 #:use-module (gnu packages perl)
73 #:use-module (gnu packages pkg-config)
74 #:use-module (gnu packages python)
75 #:use-module (gnu packages qt)
76 #:use-module (gnu packages readline)
77 #:use-module (gnu packages swig)
78 #:use-module (gnu packages tcl)
79 #:use-module (gnu packages tls)
80 #:use-module (gnu packages tex)
81 #:use-module (gnu packages wxwidgets)
82 #:use-module (gnu packages xorg))
84 (define-public librecad
91 "https://github.com/LibreCAD/LibreCAD/archive/"
93 (file-name (string-append name "-" version ".tar.gz"))
96 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
97 (build-system gnu-build-system)
100 (modify-phases %standard-phases
101 ;; Without this patch boost complains that "make_array" is not a
102 ;; member of "boost::serialization".
103 (add-after 'unpack 'patch-boost-error
105 (substitute* "librecad/src/lib/math/lc_quadratic.h"
106 (("#include \"rs_vector.h\"" line)
108 "\n#include <boost/serialization/array_wrapper.hpp>")))
109 (substitute* "librecad/src/lib/math/rs_math.cpp"
110 (("#include <boost/numeric/ublas/matrix.hpp>" line)
111 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
114 ;; Fix build against Qt 5.11.
115 (add-after 'unpack 'add-missing-headers
117 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
118 (("#include <QPushButton>") "#include <QPushButton>
119 #include <QActionGroup>"))
121 (add-after 'unpack 'patch-paths
122 (lambda* (#:key outputs #:allow-other-keys)
123 (let ((out (assoc-ref outputs "out")))
124 (substitute* "librecad/src/lib/engine/rs_system.cpp"
125 (("/usr/share") (string-append out "/share"))))))
127 (lambda* (#:key inputs #:allow-other-keys)
128 (system* "qmake" (string-append "BOOST_DIR="
129 (assoc-ref inputs "boost")))))
131 (lambda* (#:key outputs #:allow-other-keys)
132 (let* ((out (assoc-ref outputs "out"))
133 (bin (string-append out "/bin"))
134 (share (string-append out "/share/librecad")))
136 (install-file "unix/librecad" bin)
138 (copy-recursively "unix/resources" share))
140 ;; Ensure that icons are found at runtime
141 (add-after 'install 'wrap-executable
142 (lambda* (#:key inputs outputs #:allow-other-keys)
143 (let* ((out (assoc-ref outputs "out"))
144 (qt '("qtbase" "qtsvg")))
145 (wrap-program (string-append out "/bin/librecad")
146 `("QT_PLUGIN_PATH" ":" prefix
147 ,(map (lambda (label)
148 (string-append (assoc-ref inputs label)
149 "/lib/qt5/plugins/"))
154 ("muparser" ,muparser)
155 ("freetype" ,freetype)
159 `(("pkg-config" ,pkg-config)
161 (home-page "http://librecad.org/")
162 (synopsis "Computer-aided design (CAD) application")
164 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
166 (license license:gpl2)))
168 (define-public geda-gaf
175 "http://ftp.geda-project.org/geda-gaf/unstable/v"
176 (version-major+minor version) "/"
177 version "/geda-gaf-" version ".tar.gz"))
180 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
181 (build-system gnu-build-system)
184 (modify-phases %standard-phases
185 ;; tests require a writable HOME
186 (add-before 'check 'set-home
188 (setenv "HOME" (getenv "TMPDIR"))
190 ;; FIXME: These two tests fail for unknown reasons. They return "2"
191 ;; when they should return "1".
192 (add-after 'unpack 'disable-failing-tests
194 (substitute* "utils/tests/gxyrs/tests.list"
195 (("^do_nothing.*") ""))
198 (let ((pcb (assoc-ref %build-inputs "pcb")))
199 (list (string-append "--with-pcb-datadir=" pcb "/share")
200 (string-append "--with-pcb-lib-path="
201 pcb "/share/pcb/pcblib-newlib:"
202 pcb "/share/pcb/newlib")))))
207 ("desktop-file-utils" ,desktop-file-utils)
208 ("shared-mime-info" ,shared-mime-info)
212 `(("pkg-config" ,pkg-config)
213 ("perl" ,perl))) ; for tests
214 (home-page "http://geda-project.org/")
215 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
217 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
218 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
219 which currently includes: gschem, a schematic capture program; gnetlist, a
220 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
221 gattrib, a spreadsheet programm that manipulates the properties of symbols of
222 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
223 tool to forward annotation from your schematic to layout using PCB; some minor
225 (license license:gpl2+)))
233 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
234 "/pcb-" version ".tar.gz"))
237 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
238 (build-system gnu-build-system)
241 (modify-phases %standard-phases
242 (add-after 'unpack 'use-wish8.6
244 (substitute* "configure"
245 (("wish85") "wish8.6"))
247 ;; It checks for "xhost", which we don't have. This shouldn't
248 ;; matter, because the test is supposed to be skipped, but it causes
249 ;; "run_tests.sh" (and thus the "check" phase) to fail.
250 (add-after 'unpack 'fix-check-for-display
252 (substitute* "tests/run_tests.sh"
253 (("have_display=no") "have_display=yes"))
255 (add-after 'install 'wrap
256 (lambda* (#:key inputs outputs #:allow-other-keys)
257 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
258 ;; fix of the mesa package we wrap the pcb executable such that
259 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
260 (let* ((out (assoc-ref outputs "out"))
261 (path (string-append (assoc-ref inputs "udev") "/lib")))
262 (wrap-program (string-append out "/bin/pcb")
263 `("LD_LIBRARY_PATH" ":" prefix (,path))))
265 (add-before 'check 'pre-check
268 (setenv "DISPLAY" ":1")
273 ("udev" ,eudev) ;FIXME: required by mesa
277 ("gtkglext" ,gtkglext)
278 ("desktop-file-utils" ,desktop-file-utils)
279 ("shared-mime-info" ,shared-mime-info)
282 `(("pkg-config" ,pkg-config)
283 ("intltool" ,intltool)
287 ("imagemagick" ,imagemagick)
289 ("ghostscript" ,ghostscript)
290 ("xvfb" ,xorg-server)))
291 (home-page "http://pcb.geda-project.org/")
292 (synopsis "Design printed circuit board layouts")
294 "GNU PCB is an interactive tool for editing printed circuit board
295 layouts. It features a rats-nest implementation, schematic/netlist import,
296 and design rule checking. It also includes an autorouter and a trace
297 optimizer; and it can produce photorealistic and design review images.")
298 (license license:gpl2+)))
300 (define-public pcb-rnd
301 (package (inherit pcb)
306 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
307 "pcb-rnd-" version ".tar.gz"))
310 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
312 `(#:tests? #f ; no check target
314 (modify-phases %standard-phases
315 (add-after 'unpack 'cc-is-gcc
316 (lambda _ (setenv "CC" "gcc") #t))
318 ;; The configure script doesn't tolerate most of our configure flags.
319 (lambda* (#:key outputs #:allow-other-keys)
320 (zero? (system* "sh" "configure"
321 (string-append "--prefix="
322 (assoc-ref outputs "out")))))))))
323 (home-page "http://repo.hu/projects/pcb-rnd/")
324 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
325 featuring various improvements and bug fixes.")))
327 (define-public fastcap
330 (version "2.0-18Sep92")
332 (method url-fetch/tarbomb)
333 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
334 name "-" version ".tgz"))
337 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
339 ;; Remove a non-free file.
341 (delete-file "doc/psfig.sty")
343 (patches (search-patches "fastcap-mulSetup.patch"
344 "fastcap-mulGlobal.patch"))))
345 (build-system gnu-build-system)
347 ;; FIXME: with texlive-tiny citation references are rendered as question
348 ;; marks. During the build warnings like these are printed:
349 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
350 `(("texlive" ,texlive-tiny)
351 ("ghostscript" ,ghostscript)))
353 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
355 #:tests? #f ;; no tests-suite
356 #:modules ((srfi srfi-1)
357 ,@%gnu-build-system-modules)
359 (modify-phases %standard-phases
360 (add-after 'build 'make-doc
362 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
364 (add-before 'make-doc 'fix-doc
366 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
367 (substitute* (find-files "doc" "\\.tex")
368 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
370 (string-append "\\includegraphics[scale=" scale "]{"
372 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
374 (string-append "\\includegraphics[width=" width "]{"
376 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
378 (string-append "\\includegraphics[height=" height "]{"
380 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
381 (string-append "\\includegraphics{" file "}")))
382 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
383 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
385 (string-append "\\documentclass[" options "]{"
387 "\\usepackage{graphicx}\n"
388 "\\usepackage{robinspace}"))
389 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
390 (string-append "%" all))
391 (("\\\\setstretch\\{.*\\}" all)
392 (string-append "%" all)))
395 (add-before 'install 'clean-bin
397 (delete-file (string-append (getcwd) "/bin/README"))
399 (add-before 'install 'make-pdf
401 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
402 (with-directory-excursion "doc"
404 (every (lambda (file)
405 (zero? (system* "dvips" file "-o")))
406 (find-files "." "\\.dvi"))
407 (every (lambda (file)
408 (zero? (system* "ps2pdf" file)))
409 '("mtt.ps" "ug.ps" "tcad.ps"))
410 (zero? (system* "make" "clean"))))))
412 (lambda* (#:key outputs #:allow-other-keys)
413 (let* ((out (assoc-ref outputs "out"))
414 (data (string-append out "/share"))
415 (bin (string-append out "/bin"))
416 (doc (string-append data "/doc/" ,name "-" ,version))
417 (examples (string-append doc "/examples")))
418 (with-directory-excursion "bin"
419 (for-each (lambda (f)
420 (install-file f bin))
421 (find-files "." ".*")))
422 (copy-recursively "doc" doc)
423 (copy-recursively "examples" examples)
425 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
426 (synopsis "Multipole-accelerated capacitance extraction program")
428 "Fastcap is a capacitance extraction program based on a
429 multipole-accelerated algorithm.")
430 (license (license:non-copyleft #f "See fastcap.c."))))
432 (define-public fasthenry
435 (version "3.0-12Nov96")
438 (file-name (string-append name "-" version ".tar.gz"))
440 "http://www.rle.mit.edu/cpg/codes/" name
441 "-" version ".tar.z"))
443 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
444 (patches (search-patches "fasthenry-spAllocate.patch"
445 "fasthenry-spBuild.patch"
446 "fasthenry-spUtils.patch"
447 "fasthenry-spSolve.patch"
448 "fasthenry-spFactor.patch"))))
449 (build-system gnu-build-system)
451 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
453 #:tests? #f ;; no tests-suite
454 #:modules ((srfi srfi-1)
455 ,@%gnu-build-system-modules)
457 (modify-phases %standard-phases
460 (lambda* (#:key outputs #:allow-other-keys)
461 (let* ((out (assoc-ref outputs "out"))
462 (data (string-append out "/share"))
463 (bin (string-append out "/bin"))
464 (doc (string-append data "/doc/" ,name "-" ,version))
465 (examples (string-append doc "/examples")))
466 (with-directory-excursion "bin"
467 (for-each (lambda (f)
468 (install-file f bin))
469 (find-files "." ".*")))
470 (copy-recursively "doc" doc)
471 (copy-recursively "examples" examples)
473 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
474 (synopsis "Multipole-accelerated inductance analysis program")
476 "Fasthenry is an inductance extraction program based on a
477 multipole-accelerated algorithm.")
478 (license (license:non-copyleft #f "See induct.c."))))
480 (define-public fritzing
486 (uri (string-append "https://github.com/fritzing/"
487 "fritzing-app/archive/" version ".tar.gz"))
488 (file-name (string-append name "-" version ".tar.gz"))
491 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
492 (build-system gnu-build-system)
495 (modify-phases %standard-phases
497 (lambda* (#:key inputs outputs #:allow-other-keys)
498 (and (zero? (system* "tar"
499 "-xvf" (assoc-ref inputs "fritzing-parts-db")
501 (zero? (system* "qmake"
502 (string-append "PREFIX="
503 (assoc-ref outputs "out"))
504 "phoenix.pro"))))))))
507 ("qtserialport" ,qtserialport)
514 (uri (string-append "https://github.com/fritzing/"
515 "fritzing-parts/archive/" version ".tar.gz"))
516 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
519 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
520 (home-page "http://fritzing.org")
521 (synopsis "Electronic circuit design")
523 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
524 software with a low entry barrier, suited for the needs of makers and
525 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
526 library with many commonly used high-level components. Fritzing makes it very
527 easy to communicate about circuits, as well as to turn them into PCB layouts
528 ready for production.")
529 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
530 ;; released under GPLv3+.
531 (license (list license:gpl3+ license:cc-by-sa3.0))))
539 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
540 version "/gerbv-" version ".tar.gz"))
543 "1cw8k6ni0q8kswad03kha86fk7n06vq8p0wzsfhcnalsdshrn17i"))))
544 (build-system gnu-build-system)
546 `(("pkg-config" ,pkg-config)))
550 ("desktop-file-utils" ,desktop-file-utils)))
551 (home-page "http://gerbv.geda-project.org/")
552 (synopsis "Gerber file viewer")
554 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
555 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
556 you load several files on top of each other, do measurements on the displayed
557 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
558 as well as pick-place files.")
559 (license license:gpl2+)))
561 (define-public libfive
562 (let ((commit "9d857d1923abecb0e5935b9287d22661f6efaac5")
566 (version (git-version "0" revision commit))
570 (url "https://github.com/libfive/libfive")
574 "1r40kyx30wz31cwwlfvfh7fgqkxq3n8dxhswpi9qpf4r5h3l8wsn"))
575 (file-name (git-file-name name version))
577 ;; Remove bundled catch since we provide our own.
579 (delete-file "libfive/test/catch.hpp")
581 (build-system cmake-build-system)
583 `(#:test-target "libfive-test"
585 (modify-phases %standard-phases
586 (add-after 'unpack 'remove-native-compilation
588 (substitute* "CMakeLists.txt" (("-march=native") ""))
591 `(("pkg-config" ,pkg-config)))
594 ("catch" ,catch-framework)
598 ("guile" ,guile-2.2)))
599 (home-page "https://libfive.com")
600 (synopsis "Tool for programmatic computer-aided design")
602 "Libfive is a tool for programmatic computer-aided design (CAD). In
603 libfive, solid models are defined as Scheme scripts, and there are no opaque
604 function calls into the geometry kernel: everything is visible to the user.
605 Even fundamental, primitive shapes are represented as code in the user-level
607 (license (list license:lgpl2.1+ ;library
608 license:gpl2+))))) ;Guile bindings and GUI
611 (deprecated-package "ao-cad" libfive))
613 ;; We use kicad from a git commit, because support for boost 1.61.0 has been
616 (let ((commit "5f4599fb56da4dd748845ab10abec02961d477f3")
620 (version (string-append "4.0-" revision "."
621 (string-take commit 7)))
626 (url "https://git.launchpad.net/kicad")
629 (base32 "1833pln2975gmc5s18xf7s8m9vg834lmxxdjk0wlk3lq7bvjjnff"))
630 (file-name (string-append name "-" version "-checkout"))))
631 (build-system cmake-build-system)
633 `(#:out-of-source? #t
634 #:tests? #f ; no tests
635 #:build-type "Release"
637 (list "-DKICAD_STABLE_VERSION=ON"
638 "-DKICAD_REPO_NAME=stable"
639 ,(string-append "-DKICAD_BUILD_VERSION=4.0-"
640 (string-take commit 7))
641 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
642 "-DKICAD_SCRIPTING=ON"
643 "-DKICAD_SCRIPTING_MODULES=ON"
644 "-DKICAD_SCRIPTING_WXPYTHON=ON"
645 ;; Has to be set explicitely, as we don't have the wxPython
646 ;; headers in the wxwidgets store item, but in wxPython.
647 (string-append "-DCMAKE_CXX_FLAGS=-I"
648 (assoc-ref %build-inputs "wxpython")
650 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
652 ;; TODO: Enable this when CA certs are working with curl.
653 "-DBUILD_GITHUB_PLUGIN=OFF")
655 (modify-phases %standard-phases
656 (add-after 'install 'wrap-program
657 ;; Ensure correct Python at runtime.
658 (lambda* (#:key inputs outputs #:allow-other-keys)
659 (let* ((out (assoc-ref outputs "out"))
660 (python (assoc-ref inputs "python"))
661 (file (string-append out "/bin/kicad"))
664 "/lib/python2.7/site-packages:"
665 (getenv "PYTHONPATH"))))
667 `("PYTHONPATH" ":" prefix (,path))
669 (,(string-append python "/bin:")))))
673 ("gettext" ,gnu-gettext)
674 ("pkg-config" ,pkg-config)
680 ("desktop-file-utils" ,desktop-file-utils)
683 ("hicolor-icon-theme" ,hicolor-icon-theme)
684 ("libngspice" ,libngspice)
689 ("wxwidgets" ,wxwidgets-gtk2)
690 ("wxpython" ,python2-wxpython)))
691 (home-page "http://kicad-pcb.org/")
692 (synopsis "Electronics Design Automation Suite")
693 (description "Kicad is a program for the formation of printed circuit
694 boards and electrical circuits. The software has a number of programs that
695 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
696 electrical diagrams), gerbview (viewing Gerber files) and others.")
697 (license license:gpl3+))))
699 (define-public kicad-library
700 (let ((version "4.0.7"))
702 (name "kicad-library")
707 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
711 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
712 (build-system cmake-build-system)
714 `(#:out-of-source? #t
715 #:tests? #f ; no tests
717 (modify-phases %standard-phases
718 (add-after 'install 'install-footprints ; from footprints tarball
719 (lambda* (#:key inputs outputs #:allow-other-keys)
721 (assoc-ref inputs "kicad-footprints")
722 "-C" (string-append (assoc-ref outputs "out")
723 "/share/kicad/modules")
724 "--strip-components=1")))
725 ;; We change the default global footprint file, which is generated if
726 ;; it doesn't exist in user's home directory, from the one using the
727 ;; github plugin, to the one using the KISYSMOD environment path.
728 (add-after 'install-footprints 'use-pretty-footprint-table
729 (lambda* (#:key outputs #:allow-other-keys)
730 (let* ((out (assoc-ref outputs "out"))
731 (template-dir (string-append out "/share/kicad/template"))
732 (fp-lib-table (string-append template-dir "/fp-lib-table")))
733 (delete-file fp-lib-table)
734 (copy-file (string-append fp-lib-table ".for-pretty")
738 (list (search-path-specification
739 (variable "KISYSMOD") ; footprint path
740 (files '("share/kicad/modules")))
741 (search-path-specification
742 (variable "KISYS3DMOD") ; 3D model path
743 (files '("share/kicad/modules/packages3d")))))
744 ;; Kicad distributes footprints in a separate tarball.
746 `(("kicad-footprints"
750 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
754 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
755 (home-page "http://kicad-pcb.org/")
756 (synopsis "Libraries for kicad")
757 (description "This package provides Kicad component, footprint and 3D
758 render model libraries.")
759 (license license:lgpl2.0+))))
761 (define-public linsmith
768 "mirror://sourceforge/linsmith/linsmith/linsmith-"
769 version "/linsmith-" version ".tar.gz"))
772 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
773 (build-system gnu-build-system)
775 `(("pkg-config" ,pkg-config)
777 ("libgnome" ,libgnomeui)))
778 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
779 (synopsis "Smith Charting program")
780 (description "LinSmith is a Smith Charting program, mainly designed for
781 educational use. As such, there is an emphasis on capabilities that improve
782 the 'showing the effect of'-style of operation.")
783 (license license:gpl2+)))
792 (uri (string-append "http://libvolk.org/releases/volk-"
796 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
797 (build-system cmake-build-system)
801 `(("python-2" ,python-2)
802 ("python2-cheetah" ,python2-cheetah)))
803 (home-page "http://libvolk.org/")
804 (synopsis "Vector-Optimized Library of Kernels")
806 "@code{volk} contains procedures with machine-specific optimizations
807 for mathematical functions. It also provides an machine-independent
808 interface to select the best such procedures to use on a given system.")
809 (license license:gpl3+)))
811 (define-public minicom
818 (uri (string-append "https://alioth.debian.org/frs/download.php/"
819 "file/4215/" name "-" version ".tar.gz"))
822 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
823 (build-system gnu-build-system)
825 `(#:configure-flags '("--enable-lock-dir=/var/lock")
827 (modify-phases %standard-phases
828 (add-after 'unpack 'patch-lock-check
830 (substitute* "configure"
831 (("test -d [$]UUCPLOCK") "true"))
834 `(("ncurses" ,ncurses)))
835 (home-page "https://alioth.debian.org/projects/minicom/")
836 (synopsis "Serial terminal emulator")
837 (description "@code{minicom} is a serial terminal emulator.")
838 (license license:gpl2+)))
840 (define-public harminv
847 (string-append "https://github.com/stevengj/harminv/"
848 "releases/download/v" version "/"
849 name "-" version ".tar.gz"))
852 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
853 (build-system gnu-build-system)
856 (modify-phases %standard-phases
857 (add-before 'configure 'fix-tests
859 (substitute* "./sines-test.sh"
860 ; change test frequency range - default fails
864 `(("fortran" ,gfortran)))
866 `(("lapack" ,lapack)))
867 (home-page "https://github.com/stevengj/harminv")
868 (synopsis "Harmonic inversion solver")
870 "Harminv is a free program (and accompanying library) to solve the problem of
871 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
872 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
873 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
874 (license license:gpl2+)))
876 (define-public guile-libctl
878 (name "guile-libctl")
884 "http://ab-initio.mit.edu/libctl/libctl-"
888 "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
889 (build-system gnu-build-system)
891 `(("fortran" ,gfortran)))
893 `(("guile" ,guile-2.2)))
894 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
895 (synopsis "Flexible control files implementation for scientific simulations")
897 "Libctl is a Guile-based library implementing flexible control files
898 for scientific simulations.")
899 (license license:gpl2+)))
909 "http://ab-initio.mit.edu/mpb/mpb-"
913 "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
914 (build-system gnu-build-system)
917 (list (string-append "--with-libctl="
918 (assoc-ref %build-inputs "libctl")
921 `(("fortran" ,gfortran)
922 ("pkg-config" ,pkg-config)
930 ("libctl" ,guile-libctl)
931 ("readline" ,readline)
933 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
934 (synopsis "Computes band structures and electromagnetic modes of dielectric
937 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
938 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
939 fully-vectorial and three-dimensional methods.")
940 (license license:gpl2+)))
950 "http://ab-initio.mit.edu/meep/meep-"
954 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
955 (build-system gnu-build-system)
958 (list (string-append "--with-libctl="
959 (assoc-ref %build-inputs "libctl")
962 `(("fortran" ,gfortran)
963 ("pkg-config" ,pkg-config)
968 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
972 ("libctl" ,guile-libctl)
975 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
976 (synopsis "Finite-difference time-domain (FDTD) simulation software")
978 "Meep is a finite-difference time-domain (FDTD) simulation software package
979 developed at MIT to model electromagnetic systems.")
980 (license license:gpl2+)))
990 "mirror://sourceforge/mot-adms/adms-source/"
991 (version-major+minor version) "/adms-" version ".tar.gz"))
994 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
995 (build-system gnu-build-system)
999 (home-page "https://sourceforge.net/projects/mot-adms")
1000 (synopsis "Automatic device model synthesizer")
1002 "ADMS is a code generator that converts electrical compact device models
1003 specified in high-level description language into ready-to-compile C code for
1004 the API of spice simulators. Based on transformations specified in XML
1005 language, ADMS transforms Verilog-AMS code into other target languages.")
1006 (license license:gpl3)))
1008 (define-public capstone
1014 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1016 (file-name (string-append name "-" version ".tar.gz"))
1019 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
1020 (build-system gnu-build-system)
1023 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1026 (modify-phases %standard-phases
1027 (delete 'configure) ; no configure script
1028 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1029 (add-before 'build 'fix-cstool-ldflags
1030 (lambda* (#:key outputs #:allow-other-keys)
1031 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1032 (assoc-ref outputs "out") "/lib"))
1034 (home-page "http://www.capstone-engine.org")
1035 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1037 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1038 framework. Capstone can disassemble machine code for many supported architectures
1039 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1040 bindings for Python, Java, OCaml and more.")
1041 (license license:bsd-3)))
1043 ;; FIXME: This package has a timestamp embedded in
1044 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1045 (define-public python-capstone
1048 (name "python-capstone")
1050 `(("capstone" ,capstone)))
1051 (build-system python-build-system)
1054 (modify-phases %standard-phases
1055 (add-after 'unpack 'chdir-and-fix-setup-py
1057 (chdir "bindings/python")
1058 ;; Do not build the library again, because we already have it.
1059 (substitute* "setup.py" ((".* build_libraries.*") ""))
1060 ;; This substitution tells python-capstone where to find the
1062 (substitute* "capstone/__init__.py"
1063 (("pkg_resources.resource_filename.*")
1064 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1067 (define-public python2-capstone
1068 (package-with-python2 python-capstone))
1070 (define-public radare2
1076 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1077 name "-" version ".tar.gz"))
1080 "17h4ba5qqahfi8mi4x2dcvq87cqpir5v2dlaqbvmay6vby4zh4v7"))
1081 (modules '((guix build utils)))
1084 (substitute* "libr/asm/p/Makefile"
1085 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1086 (substitute* "libr/parse/p/Makefile"
1087 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1088 (substitute* "libr/bin/p/Makefile"
1089 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1091 (build-system gnu-build-system)
1093 '(#:tests? #f; tests require git and network access
1095 (modify-phases %standard-phases
1096 (add-before 'configure 'mklibdir
1097 (lambda* (#:key inputs #:allow-other-keys)
1098 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1101 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1102 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1106 `(("openssl" ,openssl)
1109 ("capstone" ,capstone)))
1111 `(("pkg-config" ,pkg-config)))
1112 (home-page "https://radare.org/")
1113 (synopsis "Portable reversing framework")
1115 "Radare project started as a forensics tool, a scriptable commandline
1116 hexadecimal editor able to open disk files, but later support for analyzing
1117 binaries, disassembling code, debugging programs, attaching to remote gdb
1119 (license license:lgpl3)))
1127 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1131 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1132 (build-system gnu-build-system)
1134 `(#:tests? #f ; no tests
1135 #:make-flags '("all" "asco-mpi")
1137 (modify-phases %standard-phases
1139 (add-before 'build 'fix-paths
1140 (lambda* (#:key inputs #:allow-other-keys)
1141 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1142 (substitute* '("errfunc.c" "asco.c")
1144 (string-append coreutils "/bin/cp "))
1146 (string-append coreutils "/bin/nice")))
1147 (substitute* "Makefile"
1148 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1150 (replace 'install ; no install target
1151 (lambda* (#:key outputs #:allow-other-keys)
1152 (for-each (lambda (file)
1153 (install-file file (string-append
1154 (assoc-ref outputs "out")
1156 '("asco" "asco-mpi" "asco-test"
1157 "tools/alter/alter" "tools/log/log"))
1160 `(("mpi" ,openmpi)))
1162 `(("coreutils-minimal" ,coreutils-minimal)))
1163 (home-page "http://asco.sourceforge.net/")
1164 (synopsis "SPICE circuit optimizer")
1166 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1167 high-performance parallel differential evolution (DE) optimization algorithm.")
1168 (license license:gpl2+)))
1170 (define-public libngspice
1171 ;; Note: The ngspice's build system does not allow us to build both the
1172 ;; library and the executables in one go. Thus, we have two packages.
1173 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1179 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1180 version "/ngspice-" version ".tar.gz"))
1183 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1184 (modules '((guix build utils)))
1185 ;; We remove the non-free cider and build without it.
1188 (delete-file-recursively "src/ciderlib")
1189 (delete-file "src/ciderinit")
1190 (substitute* "configure"
1191 (("src/ciderlib/Makefile") "")
1192 (("src/ciderlib/input/Makefile") "")
1193 (("src/ciderlib/support/Makefile") "")
1194 (("src/ciderlib/oned/Makefile") "")
1195 (("src/ciderlib/twod/Makefile") ""))
1197 (build-system gnu-build-system)
1199 `(;; No tests for libngspice exist.
1200 ;; The transient tests for ngspice fail.
1203 (modify-phases %standard-phases
1204 (add-after 'unpack 'patch-timestamps
1206 (substitute* "configure"
1207 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1209 (add-after 'unpack 'delete-program-manuals
1211 (substitute* "man/man1/Makefile.in"
1212 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1215 (add-after 'install 'delete-script-files
1216 (lambda* (#:key outputs #:allow-other-keys)
1217 (delete-file-recursively
1218 (string-append (assoc-ref outputs "out")
1219 "/share/ngspice/scripts")))))
1221 (list "--enable-openmp"
1224 "--with-readline=yes")))
1229 `(("libxaw" ,libxaw)
1231 ("readline" ,readline)))
1232 (home-page "http://ngspice.sourceforge.net/")
1233 (synopsis "Mixed-level/mixed-signal circuit simulator")
1235 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1236 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1237 provides code modeling support and simulation of digital components through
1238 an embedded event driven algorithm.")
1239 (license (list license:lgpl2.0+ ; code in frontend/numparam
1240 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1241 license:public-domain)))) ; xspice
1243 (define-public ngspice
1244 ;; The ngspice executables (see libngpsice above.)
1245 (package (inherit libngspice)
1248 (substitute-keyword-arguments (package-arguments libngspice)
1249 ((#:configure-flags flags)
1250 `(delete "--with-ngshared" ,flags))
1252 `(modify-phases ,phases
1253 (add-after 'unpack 'delete-include-files
1255 (substitute* "src/Makefile.in"
1256 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1257 "SUBDIRS = misc maths frontend spicelib"))
1259 (add-after 'install 'delete-cmpp-dlmain
1260 (lambda* (#:key outputs #:allow-other-keys)
1261 (for-each (lambda (file)
1263 (string-append (assoc-ref outputs "out")
1265 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1267 (delete 'delete-program-manuals)
1268 (delete 'delete-script-files)))))
1270 `(("libngspice" ,libngspice)
1271 ("readline" ,readline)))))
1273 (define trilinos-serial-xyce
1274 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1275 ;; keep it private. See
1276 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1277 ;; TODO: Remove when we have modular Trilinos packages?
1279 (name "trilinos-serial-xyce")
1282 (origin (method url-fetch)
1283 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1284 version "-Source.tar.gz"))
1287 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1288 (build-system cmake-build-system)
1290 `(#:out-of-source? #t
1292 (modify-phases %standard-phases
1293 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1295 (add-before 'validate-runpath 'delete-tribits
1296 (lambda* (#:key outputs #:allow-other-keys)
1297 (delete-file-recursively
1298 (string-append (assoc-ref outputs "out")
1299 "/lib/cmake/tribits"))
1302 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1303 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1304 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1305 "-DTrilinos_ENABLE_NOX=ON"
1306 "-DNOX_ENABLE_LOCA=ON"
1307 "-DTrilinos_ENABLE_EpetraExt=ON"
1308 "-DEpetraExt_BUILD_BTF=ON"
1309 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1310 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1311 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1312 "-DTrilinos_ENABLE_Ifpack=ON"
1313 "-DTrilinos_ENABLE_Isorropia=ON"
1314 "-DTrilinos_ENABLE_AztecOO=ON"
1315 "-DTrilinos_ENABLE_Belos=ON"
1316 "-DTrilinos_ENABLE_Teuchos=ON"
1317 "-DTeuchos_ENABLE_COMPLEX=ON"
1318 "-DTrilinos_ENABLE_Amesos=ON"
1319 "-DAmesos_ENABLE_KLU=ON"
1320 "-DAmesos_ENABLE_UMFPACK=ON"
1321 "-DTrilinos_ENABLE_Sacado=ON"
1322 "-DTrilinos_ENABLE_Kokkos=OFF"
1323 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1324 "-DTPL_ENABLE_AMD=ON"
1325 "-DTPL_ENABLE_UMFPACK=ON"
1326 "-DTPL_ENABLE_BLAS=ON"
1327 "-DTPL_ENABLE_LAPACK=ON")))
1329 `(("fortran" ,gfortran)
1334 ("suitesparse" ,suitesparse)))
1335 (home-page "https://trilinos.org")
1336 (synopsis "Engineering and scientific problems algorithms")
1338 "The Trilinos Project is an effort to develop algorithms and enabling
1339 technologies within an object-oriented software framework for the solution of
1340 large-scale, complex multi-physics engineering and scientific problems. A
1341 unique design feature of Trilinos is its focus on packages.")
1342 (license (list license:lgpl2.1+
1345 (define-public xyce-serial
1347 (name "xyce-serial")
1350 (origin (method url-fetch)
1351 (uri (string-append "https://archive.org/download/Xyce-"
1352 version "/Xyce-" version ".tar.gz"))
1355 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1356 (build-system gnu-build-system)
1361 "CXXFLAGS=-O3 -std=c++11"
1362 (string-append "ARCHDIR="
1363 (assoc-ref %build-inputs "trilinos")))))
1367 ("fortran" ,gfortran)))
1370 ("suitesparse" ,suitesparse)
1372 ("trilinos" ,trilinos-serial-xyce)))
1373 (home-page "https://xyce.sandia.gov/")
1374 (synopsis "High-performance analog circuit simulator")
1376 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1377 capable of solving extremely large circuit problems by supporting large-scale
1378 parallel computing platforms. It also supports serial execution.")
1379 (license license:gpl3+)))
1381 (define trilinos-parallel-xyce
1382 (package (inherit trilinos-serial-xyce)
1383 (name "trilinos-parallel-xyce")
1385 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1386 ((#:configure-flags flags)
1387 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1388 "-DTrilinos_ENABLE_Zoltan=ON"
1389 "-DTPL_ENABLE_MPI=ON")
1393 ,@(package-inputs trilinos-serial-xyce)))))
1395 (define-public xyce-parallel
1396 (package (inherit xyce-serial)
1397 (name "xyce-parallel")
1399 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1400 ((#:configure-flags flags)
1401 `(list "CXXFLAGS=-O3 -std=c++11"
1408 (assoc-ref %build-inputs "trilinos")))))))
1410 `(("mpi" ,openmpi)))
1412 `(("trilinos" ,trilinos-parallel-xyce)
1413 ,@(alist-delete "trilinos"
1414 (package-inputs xyce-serial))))))
1416 (define-public freehdl
1422 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1426 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1427 (build-system gnu-build-system)
1430 (modify-phases %standard-phases
1431 (add-before 'configure 'patch-pkg-config
1432 (lambda* (#:key inputs #:allow-other-keys)
1433 (substitute* "freehdl/freehdl-config"
1435 (string-append (assoc-ref inputs "pkg-config")
1438 (string-append (assoc-ref inputs "coreutils")
1441 (add-after 'patch-pkg-config 'setenv
1442 (lambda* (#:key inputs #:allow-other-keys)
1443 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1445 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1448 (add-after 'setenv 'patch-gvhdl
1450 (substitute* "v2cc/gvhdl.in"
1451 (("--mode=link") "--mode=link --tag=CXX")
1452 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1454 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1455 (lambda* (#:key inputs #:allow-other-keys)
1456 (substitute* "freehdl/freehdl-gennodes.in"
1458 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1459 (("\\(debug") ";(debug")
1460 (("\\(@ ") "(apply-emit")
1461 (("\\(@@ ") "(apply-mini-format"))
1463 (add-after 'configure 'patch-freehdl-pc
1464 (lambda* (#:key inputs #:allow-other-keys)
1465 (substitute* "freehdl.pc"
1467 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1470 (string-append "=" (assoc-ref inputs "libtool")
1473 (add-after 'install-scripts 'make-wrapper
1474 (lambda* (#:key inputs outputs #:allow-other-keys)
1475 (let ((out (assoc-ref outputs "out")))
1476 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1478 (wrap-program (string-append out "/bin/gvhdl")
1479 `("CPLUS_INCLUDE_PATH" ":" prefix
1480 (,(string-append (assoc-ref inputs "gcc-toolchain")
1482 `("LIBRARY_PATH" ":" prefix
1483 (,(string-append (assoc-ref inputs "gcc-toolchain")
1486 (,(string-append (assoc-ref inputs "gcc-toolchain")
1488 ,(string-append (assoc-ref inputs "coreutils")
1490 (wrap-program (string-append out "/bin/freehdl-config")
1491 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1494 `(("coreutils" ,coreutils)
1495 ("gcc-toolchain" ,gcc-toolchain)
1496 ("guile" ,guile-2.2)
1498 ("pkg-config" ,pkg-config)
1499 ("libtool" ,libtool)))
1501 `(("pkg-config-native" ,pkg-config)
1502 ("libtool-native" ,libtool)))
1503 (home-page "http://www.freehdl.seul.org/")
1504 (synopsis "VHDL simulator")
1506 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1507 VHDL'93 as well as VHDL'87 standards are supported.")
1508 (license (list license:gpl2+
1509 license:lgpl2.0+)))) ; freehdl's libraries
1512 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1513 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1514 ;; comment and update the package.
1515 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1519 (version (git-version "0.0.19" revision commit))
1523 (url "https://github.com/Qucs/qucs")
1526 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1527 (file-name (string-append name "-" version "-checkout"))))
1528 (build-system gnu-build-system)
1531 (modify-phases %standard-phases
1532 (add-before 'bootstrap 'patch-bootstrap
1534 (for-each patch-shebang
1537 "qucs-doc/bootstrap"
1538 "qucs-core/bootstrap"))
1540 (add-before 'configure 'patch-configure
1541 (lambda* (#:key inputs #:allow-other-keys)
1542 (substitute* "qucs/configure"
1543 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1545 (add-after 'patch-configure 'patch-scripts
1546 (lambda* (#:key inputs outputs #:allow-other-keys)
1547 (substitute* '("qucs/qucs/qucsdigi"
1548 "qucs/qucs/qucsdigilib"
1549 "qucs/qucs/qucsveri")
1551 (string-append (assoc-ref outputs "out") "/bin"))
1553 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1555 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1557 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1559 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1561 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1563 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1565 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1567 (add-before 'check 'pre-check
1569 ;; The test suite requires a running X server.
1570 (system "Xvfb :1 &")
1571 (setenv "DISPLAY" ":1")
1573 (add-after 'install 'make-wrapper
1574 (lambda* (#:key inputs outputs #:allow-other-keys)
1575 (let ((out (assoc-ref outputs "out")))
1576 ;; 'qucs' directly invokes gcc, hence this wrapping.
1577 (wrap-program (string-append out "/bin/qucs")
1578 `("CPLUS_INCLUDE_PATH" ":" prefix
1579 (,(string-append (assoc-ref inputs "gcc-toolchain")
1582 (,(string-append (assoc-ref inputs "gcc-toolchain")
1584 `("LIBRARY_PATH" ":" prefix
1585 (,(string-append (assoc-ref inputs "gcc-toolchain")
1587 `("ADMSXMLBINDIR" ":" prefix
1588 (,(string-append (assoc-ref inputs "adms") "/bin")))
1589 `("ASCOBINDIR" ":" prefix
1590 (,(string-append (assoc-ref inputs "asco") "/bin")))
1591 `("QUCS_OCTAVE" ":" prefix
1592 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1594 #:parallel-build? #f ; race condition
1595 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1597 `(("autoconf" ,autoconf)
1598 ("automake" ,automake)
1602 ("libtool-native" ,libtool)
1603 ("pkg-config" ,pkg-config)
1604 ("python" ,python-2) ; for tests
1605 ("matplotlib" ,python2-matplotlib) ; for tests
1606 ("numpy" ,python2-numpy) ; for tests
1607 ("xorg-server" ,xorg-server))) ; for tests
1611 ("coreutils" ,coreutils)
1612 ("freehdl" ,freehdl)
1613 ("gcc-toolchain" ,gcc-toolchain)
1614 ("iverilog" ,iverilog)
1615 ("libtool" ,libtool)
1619 (home-page "http://qucs.sourceforge.net/")
1620 (synopsis "Circuit simulator with graphical user interface")
1622 "Qucs is a circuit simulator with graphical user interface. The software
1623 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1624 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1625 simulations are also supported.")
1626 (license license:gpl2+))))
1628 (define-public qucs-s
1634 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1636 (file-name (string-append name "-" version ".tar.gz"))
1639 "01dizf4rjciqc8x7bmv3kbhdlz90bm6n9m9fz7dbzqcwvszcs1hx"))))
1640 (build-system cmake-build-system)
1642 `(#:tests? #f ; no tests
1644 (modify-phases %standard-phases
1645 (add-before 'configure 'patch-scripts
1646 (lambda* (#:key inputs #:allow-other-keys)
1647 (substitute* '("qucs/qucsdigi"
1651 (string-append (assoc-ref inputs "qucs") "/bin"))
1653 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1655 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1657 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1659 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1661 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1663 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1665 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1667 (add-after 'patch-scripts 'patch-paths
1668 (lambda* (#:key inputs #:allow-other-keys)
1669 (substitute* "qucs/main.cpp"
1670 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1671 "\\+ \"qucsator\" \\+ executableSuffix"))
1672 (string-append "}{ QucsSettings.Qucsator = \""
1673 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1674 (((string-append "QucsSettings\\.XyceExecutable = "
1675 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1676 (string-append "}{ QucsSettings.XyceExecutable = \""
1677 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1678 (((string-append "else QucsSettings\\.XyceParExecutable = "
1679 "\"mpirun -np %p /usr/local"
1680 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1681 (string-append "QucsSettings.XyceParExecutable = \""
1682 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1683 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1684 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1685 (string-append "QucsSettings.NgspiceExecutable = " "\""
1686 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1687 (substitute* "qucs/extsimkernels/ngspice.cpp"
1688 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1689 (substitute* "qucs/qucs_actions.cpp"
1691 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1693 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1695 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1697 (add-after 'install 'install-scripts
1698 (lambda* (#:key inputs outputs #:allow-other-keys)
1701 (let ((file (string-append "../qucs_s-" ,version
1703 (out (assoc-ref outputs "out")))
1704 (install-file file (string-append out "/bin"))
1705 (chmod (string-append out "/bin/" script) #o555)))
1706 '("qucsdigi" "qucsdigilib" "qucsveri"))
1708 (add-after 'install-scripts 'make-wrapper
1709 (lambda* (#:key inputs outputs #:allow-other-keys)
1710 (let* ((out (assoc-ref outputs "out"))
1711 (file (string-append out "/bin/qucs-s"))
1712 (qucs (assoc-ref inputs "qucs"))
1713 (qucsator (string-append qucs "/bin/qucsator")))
1715 `("CPLUS_INCLUDE_PATH" ":" prefix
1716 (,(string-append (assoc-ref inputs "gcc-toolchain")
1719 (,(string-append (assoc-ref inputs "gcc-toolchain")
1721 `("LIBRARY_PATH" ":" prefix
1722 (,(string-append (assoc-ref inputs "gcc-toolchain")
1724 `("QUCSATOR" ":" prefix (,qucsator))
1725 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1726 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1728 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1730 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1732 (symlink qucsator (string-append out "/bin/qucsator"))
1735 `(("libtool-native" ,libtool)))
1739 ("coreutils" ,coreutils)
1740 ("freehdl" ,freehdl)
1741 ("gcc-toolchain" ,gcc-toolchain)
1742 ("iverilog" ,iverilog)
1743 ("libtool" ,libtool)
1745 ("ngspice" ,ngspice)
1750 ("xyce-serial" ,xyce-serial)
1751 ("xyce-parallel" ,xyce-parallel)))
1752 (home-page "https://ra3xdh.github.io/")
1753 (synopsis "Circuit simulator with graphical user interface")
1755 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1756 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1757 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1758 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1759 (license license:gpl2+)))