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 Theodoros Foradis <theodoros@foradis.org>
8 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
9 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages engineering)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix gexp)
30 #:use-module (guix git-download)
31 #:use-module (guix monads)
32 #:use-module (guix store)
33 #:use-module (guix utils)
34 #:use-module ((srfi srfi-1) #:hide (zip))
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system python)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages algebra)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages bison)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages commencement)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages flex)
50 #:use-module (gnu packages fontutils)
51 #:use-module (gnu packages fpga)
52 #:use-module (gnu packages freedesktop)
53 #:use-module (gnu packages gcc)
54 #:use-module (gnu packages gd)
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages ghostscript)
57 #:use-module (gnu packages gl)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gnome)
60 #:use-module (gnu packages gperf)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages guile)
63 #:use-module (gnu packages image)
64 #:use-module (gnu packages imagemagick)
65 #:use-module (gnu packages linux) ;FIXME: for pcb
66 #:use-module (gnu packages m4)
67 #:use-module (gnu packages maths)
68 #:use-module (gnu packages multiprecision)
69 #:use-module (gnu packages mpi)
70 #:use-module (gnu packages ncurses)
71 #:use-module (gnu packages perl)
72 #:use-module (gnu packages pkg-config)
73 #:use-module (gnu packages python)
74 #:use-module (gnu packages qt)
75 #:use-module (gnu packages readline)
76 #:use-module (gnu packages swig)
77 #:use-module (gnu packages tcl)
78 #:use-module (gnu packages tls)
79 #:use-module (gnu packages tex)
80 #:use-module (gnu packages wxwidgets)
81 #:use-module (gnu packages xorg))
83 (define-public librecad
90 "https://github.com/LibreCAD/LibreCAD/archive/"
92 (file-name (string-append name "-" version ".tar.gz"))
95 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
96 (build-system gnu-build-system)
99 (modify-phases %standard-phases
100 ;; Without this patch boost complains that "make_array" is not a
101 ;; member of "boost::serialization".
102 (add-after 'unpack 'patch-boost-error
104 (substitute* "librecad/src/lib/math/lc_quadratic.h"
105 (("#include \"rs_vector.h\"" line)
107 "\n#include <boost/serialization/array_wrapper.hpp>")))
108 (substitute* "librecad/src/lib/math/rs_math.cpp"
109 (("#include <boost/numeric/ublas/matrix.hpp>" line)
110 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
113 (add-after 'unpack 'patch-paths
114 (lambda* (#:key outputs #:allow-other-keys)
115 (let ((out (assoc-ref outputs "out")))
116 (substitute* "librecad/src/lib/engine/rs_system.cpp"
117 (("/usr/share") (string-append out "/share"))))))
119 (lambda* (#:key inputs #:allow-other-keys)
120 (system* "qmake" (string-append "BOOST_DIR="
121 (assoc-ref inputs "boost")))))
123 (lambda* (#:key outputs #:allow-other-keys)
124 (let* ((out (assoc-ref outputs "out"))
125 (bin (string-append out "/bin"))
126 (share (string-append out "/share/librecad")))
128 (install-file "unix/librecad" bin)
130 (copy-recursively "unix/resources" share))
132 ;; Ensure that icons are found at runtime
133 (add-after 'install 'wrap-executable
134 (lambda* (#:key inputs outputs #:allow-other-keys)
135 (let* ((out (assoc-ref outputs "out"))
136 (qt '("qtbase" "qtsvg")))
137 (wrap-program (string-append out "/bin/librecad")
138 `("QT_PLUGIN_PATH" ":" prefix
139 ,(map (lambda (label)
140 (string-append (assoc-ref inputs label)
141 "/lib/qt5/plugins/"))
146 ("muparser" ,muparser)
147 ("freetype" ,freetype)
151 `(("pkg-config" ,pkg-config)
153 (home-page "http://librecad.org/")
154 (synopsis "Computer-aided design (CAD) application")
156 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
158 (license license:gpl2)))
160 (define-public geda-gaf
167 "http://ftp.geda-project.org/geda-gaf/unstable/v"
168 (version-major+minor version) "/"
169 version "/geda-gaf-" version ".tar.gz"))
172 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
173 (build-system gnu-build-system)
176 (modify-phases %standard-phases
177 ;; tests require a writable HOME
178 (add-before 'check 'set-home
180 (setenv "HOME" (getenv "TMPDIR"))
182 ;; FIXME: These two tests fail for unknown reasons. They return "2"
183 ;; when they should return "1".
184 (add-after 'unpack 'disable-failing-tests
186 (substitute* "utils/tests/gxyrs/tests.list"
187 (("^do_nothing.*") ""))
190 (let ((pcb (assoc-ref %build-inputs "pcb")))
191 (list (string-append "--with-pcb-datadir=" pcb "/share")
192 (string-append "--with-pcb-lib-path="
193 pcb "/share/pcb/pcblib-newlib:"
194 pcb "/share/pcb/newlib")))))
199 ("desktop-file-utils" ,desktop-file-utils)
200 ("shared-mime-info" ,shared-mime-info)
204 `(("pkg-config" ,pkg-config)
205 ("perl" ,perl))) ; for tests
206 (home-page "http://geda-project.org/")
207 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
209 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
210 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
211 which currently includes: gschem, a schematic capture program; gnetlist, a
212 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
213 gattrib, a spreadsheet programm that manipulates the properties of symbols of
214 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
215 tool to forward annotation from your schematic to layout using PCB; some minor
217 (license license:gpl2+)))
225 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
226 "/pcb-" version ".tar.gz"))
229 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
230 (build-system gnu-build-system)
233 (modify-phases %standard-phases
234 (add-after 'unpack 'use-wish8.6
236 (substitute* "configure"
237 (("wish85") "wish8.6"))
239 ;; It checks for "xhost", which we don't have. This shouldn't
240 ;; matter, because the test is supposed to be skipped, but it causes
241 ;; "run_tests.sh" (and thus the "check" phase) to fail.
242 (add-after 'unpack 'fix-check-for-display
244 (substitute* "tests/run_tests.sh"
245 (("have_display=no") "have_display=yes"))
247 (add-after 'install 'wrap
248 (lambda* (#:key inputs outputs #:allow-other-keys)
249 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
250 ;; fix of the mesa package we wrap the pcb executable such that
251 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
252 (let* ((out (assoc-ref outputs "out"))
253 (path (string-append (assoc-ref inputs "udev") "/lib")))
254 (wrap-program (string-append out "/bin/pcb")
255 `("LD_LIBRARY_PATH" ":" prefix (,path))))
257 (add-before 'check 'pre-check
260 (setenv "DISPLAY" ":1")
265 ("udev" ,eudev) ;FIXME: required by mesa
269 ("gtkglext" ,gtkglext)
270 ("desktop-file-utils" ,desktop-file-utils)
271 ("shared-mime-info" ,shared-mime-info)
274 `(("pkg-config" ,pkg-config)
275 ("intltool" ,intltool)
279 ("imagemagick" ,imagemagick)
281 ("ghostscript" ,ghostscript)
282 ("xvfb" ,xorg-server)))
283 (home-page "http://pcb.geda-project.org/")
284 (synopsis "Design printed circuit board layouts")
286 "GNU PCB is an interactive tool for editing printed circuit board
287 layouts. It features a rats-nest implementation, schematic/netlist import,
288 and design rule checking. It also includes an autorouter and a trace
289 optimizer; and it can produce photorealistic and design review images.")
290 (license license:gpl2+)))
292 (define-public pcb-rnd
293 (package (inherit pcb)
298 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
299 "pcb-rnd-" version ".tar.gz"))
302 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
304 `(#:tests? #f ; no check target
306 (modify-phases %standard-phases
307 (add-after 'unpack 'cc-is-gcc
308 (lambda _ (setenv "CC" "gcc") #t))
310 ;; The configure script doesn't tolerate most of our configure flags.
311 (lambda* (#:key outputs #:allow-other-keys)
312 (zero? (system* "sh" "configure"
313 (string-append "--prefix="
314 (assoc-ref outputs "out")))))))))
315 (home-page "http://repo.hu/projects/pcb-rnd/")
316 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
317 featuring various improvements and bug fixes.")))
319 (define-public fastcap
322 (version "2.0-18Sep92")
324 (method url-fetch/tarbomb)
325 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
326 name "-" version ".tgz"))
329 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
331 ;; Remove a non-free file.
333 (delete-file "doc/psfig.sty")
335 (patches (search-patches "fastcap-mulSetup.patch"
336 "fastcap-mulGlobal.patch"))))
337 (build-system gnu-build-system)
339 ;; FIXME: with texlive-tiny citation references are rendered as question
340 ;; marks. During the build warnings like these are printed:
341 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
342 `(("texlive" ,texlive-tiny)
343 ("ghostscript" ,ghostscript)))
345 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
347 #:tests? #f ;; no tests-suite
348 #:modules ((srfi srfi-1)
349 ,@%gnu-build-system-modules)
351 (modify-phases %standard-phases
352 (add-after 'build 'make-doc
354 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
356 (add-before 'make-doc 'fix-doc
358 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
359 (substitute* (find-files "doc" "\\.tex")
360 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
362 (string-append "\\includegraphics[scale=" scale "]{"
364 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
366 (string-append "\\includegraphics[width=" width "]{"
368 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
370 (string-append "\\includegraphics[height=" height "]{"
372 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
373 (string-append "\\includegraphics{" file "}")))
374 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
375 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
377 (string-append "\\documentclass[" options "]{"
379 "\\usepackage{graphicx}\n"
380 "\\usepackage{robinspace}"))
381 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
382 (string-append "%" all))
383 (("\\\\setstretch\\{.*\\}" all)
384 (string-append "%" all)))
387 (add-before 'install 'clean-bin
389 (delete-file (string-append (getcwd) "/bin/README"))
391 (add-before 'install 'make-pdf
393 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
394 (with-directory-excursion "doc"
396 (every (lambda (file)
397 (zero? (system* "dvips" file "-o")))
398 (find-files "." "\\.dvi"))
399 (every (lambda (file)
400 (zero? (system* "ps2pdf" file)))
401 '("mtt.ps" "ug.ps" "tcad.ps"))
402 (zero? (system* "make" "clean"))))))
404 (lambda* (#:key outputs #:allow-other-keys)
405 (let* ((out (assoc-ref outputs "out"))
406 (data (string-append out "/share"))
407 (bin (string-append out "/bin"))
408 (doc (string-append data "/doc/" ,name "-" ,version))
409 (examples (string-append doc "/examples")))
410 (with-directory-excursion "bin"
411 (for-each (lambda (f)
412 (install-file f bin))
413 (find-files "." ".*")))
414 (copy-recursively "doc" doc)
415 (copy-recursively "examples" examples)
417 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
418 (synopsis "Multipole-accelerated capacitance extraction program")
420 "Fastcap is a capacitance extraction program based on a
421 multipole-accelerated algorithm.")
422 (license (license:non-copyleft #f "See fastcap.c."))))
424 (define-public fasthenry
427 (version "3.0-12Nov96")
430 (file-name (string-append name "-" version ".tar.gz"))
432 "http://www.rle.mit.edu/cpg/codes/" name
433 "-" version ".tar.z"))
435 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
436 (patches (search-patches "fasthenry-spAllocate.patch"
437 "fasthenry-spBuild.patch"
438 "fasthenry-spUtils.patch"
439 "fasthenry-spSolve.patch"
440 "fasthenry-spFactor.patch"))))
441 (build-system gnu-build-system)
443 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
445 #:tests? #f ;; no tests-suite
446 #:modules ((srfi srfi-1)
447 ,@%gnu-build-system-modules)
449 (modify-phases %standard-phases
452 (lambda* (#:key outputs #:allow-other-keys)
453 (let* ((out (assoc-ref outputs "out"))
454 (data (string-append out "/share"))
455 (bin (string-append out "/bin"))
456 (doc (string-append data "/doc/" ,name "-" ,version))
457 (examples (string-append doc "/examples")))
458 (with-directory-excursion "bin"
459 (for-each (lambda (f)
460 (install-file f bin))
461 (find-files "." ".*")))
462 (copy-recursively "doc" doc)
463 (copy-recursively "examples" examples)
465 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
466 (synopsis "Multipole-accelerated inductance analysis program")
468 "Fasthenry is an inductance extraction program based on a
469 multipole-accelerated algorithm.")
470 (license (license:non-copyleft #f "See induct.c."))))
472 (define-public fritzing
478 (uri (string-append "https://github.com/fritzing/"
479 "fritzing-app/archive/" version ".tar.gz"))
480 (file-name (string-append name "-" version ".tar.gz"))
483 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
484 (build-system gnu-build-system)
487 (modify-phases %standard-phases
489 (lambda* (#:key inputs outputs #:allow-other-keys)
490 (and (zero? (system* "tar"
491 "-xvf" (assoc-ref inputs "fritzing-parts-db")
493 (zero? (system* "qmake"
494 (string-append "PREFIX="
495 (assoc-ref outputs "out"))
496 "phoenix.pro"))))))))
499 ("qtserialport" ,qtserialport)
506 (uri (string-append "https://github.com/fritzing/"
507 "fritzing-parts/archive/" version ".tar.gz"))
508 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
511 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
512 (home-page "http://fritzing.org")
513 (synopsis "Electronic circuit design")
515 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
516 software with a low entry barrier, suited for the needs of makers and
517 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
518 library with many commonly used high-level components. Fritzing makes it very
519 easy to communicate about circuits, as well as to turn them into PCB layouts
520 ready for production.")
521 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
522 ;; released under GPLv3+.
523 (license (list license:gpl3+ license:cc-by-sa3.0))))
531 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
532 version "/gerbv-" version ".tar.gz"))
535 "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
536 (build-system gnu-build-system)
539 (modify-phases %standard-phases
540 (add-after 'unpack 'autoconf
542 ;; Build rules contain references to Russian translation, but the
543 ;; needed files are missing; see
544 ;; http://sourceforge.net/p/gerbv/bugs/174/
545 (delete-file "po/LINGUAS")
546 (substitute* "man/Makefile.am"
547 (("PO_FILES= gerbv.ru.1.in.po") "")
548 (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
549 (zero? (system* "autoreconf" "-vfi")))))))
551 `(("autoconf" ,autoconf)
552 ("automake" ,automake)
554 ("gettext" ,gettext-minimal)
556 ("pkg-config" ,pkg-config)))
560 ("desktop-file-utils" ,desktop-file-utils)))
561 (home-page "http://gerbv.geda-project.org/")
562 (synopsis "Gerber file viewer")
564 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
565 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
566 you load several files on top of each other, do measurements on the displayed
567 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
568 as well as pick-place files.")
569 (license license:gpl2+)))
571 (define-public libfive
572 (let ((commit "9d857d1923abecb0e5935b9287d22661f6efaac5")
576 (version (git-version "0" revision commit))
580 (url "https://github.com/libfive/libfive")
584 "1r40kyx30wz31cwwlfvfh7fgqkxq3n8dxhswpi9qpf4r5h3l8wsn"))
585 (file-name (git-file-name name version))
587 ;; Remove bundled catch since we provide our own.
589 (delete-file "libfive/test/catch.hpp")
591 (build-system cmake-build-system)
593 `(#:test-target "libfive-test"
595 (modify-phases %standard-phases
596 (add-after 'unpack 'remove-native-compilation
598 (substitute* "CMakeLists.txt" (("-march=native") ""))
601 `(("pkg-config" ,pkg-config)))
604 ("catch" ,catch-framework)
608 ("guile" ,guile-2.2)))
609 (home-page "https://libfive.com")
610 (synopsis "Tool for programmatic computer-aided design")
612 "Libfive is a tool for programmatic computer-aided design (CAD). In
613 libfive, solid models are defined as Scheme scripts, and there are no opaque
614 function calls into the geometry kernel: everything is visible to the user.
615 Even fundamental, primitive shapes are represented as code in the user-level
617 (license (list license:lgpl2.1+ ;library
618 license:gpl2+))))) ;Guile bindings and GUI
621 (deprecated-package "ao-cad" libfive))
623 ;; We use kicad from a git commit, because support for boost 1.61.0 has been
626 (let ((commit "5f4599fb56da4dd748845ab10abec02961d477f3")
630 (version (string-append "4.0-" revision "."
631 (string-take commit 7)))
636 (url "https://git.launchpad.net/kicad")
639 (base32 "1833pln2975gmc5s18xf7s8m9vg834lmxxdjk0wlk3lq7bvjjnff"))
640 (file-name (string-append name "-" version "-checkout"))))
641 (build-system cmake-build-system)
643 `(#:out-of-source? #t
644 #:tests? #f ; no tests
645 #:build-type "Release"
647 (list "-DKICAD_STABLE_VERSION=ON"
648 "-DKICAD_REPO_NAME=stable"
649 ,(string-append "-DKICAD_BUILD_VERSION=4.0-"
650 (string-take commit 7))
651 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
652 "-DKICAD_SCRIPTING=ON"
653 "-DKICAD_SCRIPTING_MODULES=ON"
654 "-DKICAD_SCRIPTING_WXPYTHON=ON"
655 ;; Has to be set explicitely, as we don't have the wxPython
656 ;; headers in the wxwidgets store item, but in wxPython.
657 (string-append "-DCMAKE_CXX_FLAGS=-I"
658 (assoc-ref %build-inputs "wxpython")
660 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
662 ;; TODO: Enable this when CA certs are working with curl.
663 "-DBUILD_GITHUB_PLUGIN=OFF")
665 (modify-phases %standard-phases
666 (add-after 'install 'wrap-program
667 ;; Ensure correct Python at runtime.
668 (lambda* (#:key inputs outputs #:allow-other-keys)
669 (let* ((out (assoc-ref outputs "out"))
670 (python (assoc-ref inputs "python"))
671 (file (string-append out "/bin/kicad"))
674 "/lib/python2.7/site-packages:"
675 (getenv "PYTHONPATH"))))
677 `("PYTHONPATH" ":" prefix (,path))
679 (,(string-append python "/bin:")))))
683 ("gettext" ,gnu-gettext)
684 ("pkg-config" ,pkg-config)
690 ("desktop-file-utils" ,desktop-file-utils)
693 ("hicolor-icon-theme" ,hicolor-icon-theme)
694 ("libngspice" ,libngspice)
699 ("wxwidgets" ,wxwidgets-gtk2)
700 ("wxpython" ,python2-wxpython)))
701 (home-page "http://kicad-pcb.org/")
702 (synopsis "Electronics Design Automation Suite")
703 (description "Kicad is a program for the formation of printed circuit
704 boards and electrical circuits. The software has a number of programs that
705 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
706 electrical diagrams), gerbview (viewing Gerber files) and others.")
707 (license license:gpl3+))))
709 (define-public kicad-library
710 (let ((version "4.0.6"))
712 (name "kicad-library")
717 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
721 "16f47pd6f0ddsdxdrp327nr9v05gl8c24d0qypq2aqx5hdjmkp7f"))))
722 (build-system cmake-build-system)
724 `(#:out-of-source? #t
725 #:tests? #f ; no tests
727 (modify-phases %standard-phases
728 (add-after 'install 'install-footprints ; from footprints tarball
729 (lambda* (#:key inputs outputs #:allow-other-keys)
730 (zero? (system* "tar" "xvf"
731 (assoc-ref inputs "kicad-footprints")
732 "-C" (string-append (assoc-ref outputs "out")
733 "/share/kicad/modules")
734 "--strip-components=1"))))
735 ;; We change the default global footprint file, which is generated if
736 ;; it doesn't exist in user's home directory, from the one using the
737 ;; github plugin, to the one using the KISYSMOD environment path.
738 (add-after 'install-footprints 'use-pretty-footprint-table
739 (lambda* (#:key outputs #:allow-other-keys)
740 (let* ((out (assoc-ref outputs "out"))
741 (template-dir (string-append out "/share/kicad/template"))
742 (fp-lib-table (string-append template-dir "/fp-lib-table")))
743 (delete-file fp-lib-table)
744 (copy-file (string-append fp-lib-table ".for-pretty")
748 (list (search-path-specification
749 (variable "KISYSMOD") ; footprint path
750 (files '("share/kicad/modules")))
751 (search-path-specification
752 (variable "KISYS3DMOD") ; 3D model path
753 (files '("share/kicad/modules/packages3d")))))
754 ;; Kicad distributes footprints in a separate tarball
756 `(("kicad-footprints"
760 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
764 "0vmgqhdw05k5fdnqv42grnvlz7v75g9md82jp2d3dvw2zw050lfb"))))))
765 (home-page "http://kicad-pcb.org/")
766 (synopsis "Libraries for kicad")
767 (description "This package provides Kicad component, footprint and 3D
768 render model libraries.")
769 (license license:lgpl2.0+))))
771 (define-public linsmith
778 "mirror://sourceforge/linsmith/linsmith/linsmith-"
779 version "/linsmith-" version ".tar.gz"))
782 "18qslhr2r45rhpj4v6bjcqx189vs0bflvsj271wr7w8kvh69qwvn"))))
783 (build-system gnu-build-system)
785 `(("pkg-config" ,pkg-config)
787 ("libgnome" ,libgnomeui)))
788 (home-page "http://jcoppens.com/soft/linsmith/index.en.php")
789 (synopsis "Smith Charting program")
790 (description "LinSmith is a Smith Charting program, mainly designed for
791 educational use. As such, there is an emphasis on capabilities that improve
792 the 'showing the effect of'-style of operation.")
793 (license license:gpl2+)))
802 (uri (string-append "http://libvolk.org/releases/volk-"
806 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
807 (build-system cmake-build-system)
811 `(("python-2" ,python-2)
812 ("python2-cheetah" ,python2-cheetah)))
813 (home-page "http://libvolk.org/")
814 (synopsis "Vector-Optimized Library of Kernels")
816 "@code{volk} contains procedures with machine-specific optimizations
817 for mathematical functions. It also provides an machine-independent
818 interface to select the best such procedures to use on a given system.")
819 (license license:gpl3+)))
821 (define-public minicom
828 (uri (string-append "https://alioth.debian.org/frs/download.php/"
829 "file/4215/" name "-" version ".tar.gz"))
832 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
833 (build-system gnu-build-system)
835 `(#:configure-flags '("--enable-lock-dir=/var/lock")
837 (modify-phases %standard-phases
838 (add-after 'unpack 'patch-lock-check
840 (substitute* "configure"
841 (("test -d [$]UUCPLOCK") "true"))
844 `(("ncurses" ,ncurses)))
845 (home-page "https://alioth.debian.org/projects/minicom/")
846 (synopsis "Serial terminal emulator")
847 (description "@code{minicom} is a serial terminal emulator.")
848 (license license:gpl2+)))
850 (define-public harminv
857 (string-append "https://github.com/stevengj/harminv/"
858 "releases/download/v" version "/"
859 name "-" version ".tar.gz"))
862 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
863 (build-system gnu-build-system)
866 (modify-phases %standard-phases
867 (add-before 'configure 'fix-tests
869 (substitute* "./sines-test.sh"
870 ; change test frequency range - default fails
874 `(("fortran" ,gfortran)))
876 `(("lapack" ,lapack)))
877 (home-page "https://github.com/stevengj/harminv")
878 (synopsis "Harmonic inversion solver")
880 "Harminv is a free program (and accompanying library) to solve the problem of
881 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
882 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
883 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
884 (license license:gpl2+)))
886 (define-public guile-libctl
888 (name "guile-libctl")
894 "http://ab-initio.mit.edu/libctl/libctl-"
898 "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
899 (build-system gnu-build-system)
901 `(("fortran" ,gfortran)))
903 `(("guile" ,guile-2.2)))
904 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
905 (synopsis "Flexible control files implementation for scientific simulations")
907 "Libctl is a Guile-based library implementing flexible control files
908 for scientific simulations.")
909 (license license:gpl2+)))
919 "http://ab-initio.mit.edu/mpb/mpb-"
923 "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
924 (build-system gnu-build-system)
927 (list (string-append "--with-libctl="
928 (assoc-ref %build-inputs "libctl")
931 `(("fortran" ,gfortran)
932 ("pkg-config" ,pkg-config)
940 ("libctl" ,guile-libctl)
941 ("readline" ,readline)
943 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
944 (synopsis "Computes band structures and electromagnetic modes of dielectric
947 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
948 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
949 fully-vectorial and three-dimensional methods.")
950 (license license:gpl2+)))
960 "http://ab-initio.mit.edu/meep/meep-"
964 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
965 (build-system gnu-build-system)
968 (list (string-append "--with-libctl="
969 (assoc-ref %build-inputs "libctl")
972 `(("fortran" ,gfortran)
973 ("pkg-config" ,pkg-config)
978 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
982 ("libctl" ,guile-libctl)
985 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
986 (synopsis "Finite-difference time-domain (FDTD) simulation software")
988 "Meep is a finite-difference time-domain (FDTD) simulation software package
989 developed at MIT to model electromagnetic systems.")
990 (license license:gpl2+)))
1000 "mirror://sourceforge/mot-adms/adms-source/"
1001 (version-major+minor version) "/adms-" version ".tar.gz"))
1004 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1005 (build-system gnu-build-system)
1009 (home-page "https://sourceforge.net/projects/mot-adms")
1010 (synopsis "Automatic device model synthesizer")
1012 "ADMS is a code generator that converts electrical compact device models
1013 specified in high-level description language into ready-to-compile C code for
1014 the API of spice simulators. Based on transformations specified in XML
1015 language, ADMS transforms Verilog-AMS code into other target languages.")
1016 (license license:gpl3)))
1018 (define-public capstone
1021 (version "3.0.5-rc2")
1024 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1026 (file-name (string-append name "-" version ".tar.gz"))
1029 "1cqms9r2p43aiwp5spd84zaccp16ih03r7sjhrv16nddahj0jz2q"))))
1030 (build-system gnu-build-system)
1033 #:make-flags (list (string-append "PREFIX=" %output)
1036 (modify-phases %standard-phases
1038 ;; cstool's Makefile overrides LDFLAGS, so we cannot pass it as a make flag.
1039 (add-before 'build 'fix-cstool-ldflags
1040 (lambda* (#:key outputs #:allow-other-keys)
1041 (substitute* "cstool/Makefile"
1043 (string-append "LDFLAGS = -Wl,-rpath=" (assoc-ref outputs "out")
1046 (home-page "http://www.capstone-engine.org")
1047 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1049 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1050 framework. Capstone can disassemble machine code for many supported architectures
1051 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1052 bindings for Python, Java, OCaml and more.")
1053 (license license:bsd-3)))
1055 ;; FIXME: This package has a timestamp embedded in
1056 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1057 (define-public python-capstone
1060 (name "python-capstone")
1062 `(("capstone" ,capstone)))
1063 (build-system python-build-system)
1066 (modify-phases %standard-phases
1067 (add-after 'unpack 'chdir-and-fix-setup-py
1069 (chdir "bindings/python")
1070 ;; Do not build the library again, because we already have it.
1071 (substitute* "setup.py" ((".* build_libraries.*") ""))
1072 ;; This substitution tells python-capstone where to find the
1074 (substitute* "capstone/__init__.py"
1075 (("pkg_resources.resource_filename.*")
1076 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1079 (define-public python2-capstone
1080 (package-with-python2 python-capstone))
1082 (define-public radare2
1088 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1089 name "-" version ".tar.gz"))
1092 "16ggsk40zz6hyvclvqj1r4bh4hb78jf0d6ppry1jk4r0j30wm7cm"))
1093 (modules '((guix build utils)))
1096 (substitute* "libr/asm/p/Makefile"
1097 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1098 (substitute* "libr/parse/p/Makefile"
1099 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1100 (substitute* "libr/bin/p/Makefile"
1101 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1103 (build-system gnu-build-system)
1105 '(#:tests? #f; tests require git and network access
1107 (modify-phases %standard-phases
1108 (add-before 'configure 'mklibdir
1109 (lambda* (#:key inputs #:allow-other-keys)
1110 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1113 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1114 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1118 `(("openssl" ,openssl)
1121 ("capstone" ,capstone)))
1123 `(("pkg-config" ,pkg-config)))
1124 (home-page "https://radare.org/")
1125 (synopsis "Portable reversing framework")
1127 "Radare project started as a forensics tool, a scriptable commandline
1128 hexadecimal editor able to open disk files, but later support for analyzing
1129 binaries, disassembling code, debugging programs, attaching to remote gdb
1131 (license license:lgpl3)))
1139 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1143 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1144 (build-system gnu-build-system)
1146 `(#:tests? #f ; no tests
1147 #:make-flags '("all" "asco-mpi")
1149 (modify-phases %standard-phases
1151 (add-before 'build 'fix-paths
1152 (lambda* (#:key inputs #:allow-other-keys)
1153 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1154 (substitute* '("errfunc.c" "asco.c")
1156 (string-append coreutils "/bin/cp "))
1158 (string-append coreutils "/bin/nice")))
1159 (substitute* "Makefile"
1160 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1162 (replace 'install ; no install target
1163 (lambda* (#:key outputs #:allow-other-keys)
1164 (for-each (lambda (file)
1165 (install-file file (string-append
1166 (assoc-ref outputs "out")
1168 '("asco" "asco-mpi" "asco-test"
1169 "tools/alter/alter" "tools/log/log"))
1172 `(("mpi" ,openmpi)))
1174 `(("coreutils-minimal" ,coreutils-minimal)))
1175 (home-page "http://asco.sourceforge.net/")
1176 (synopsis "SPICE circuit optimizer")
1178 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1179 high-performance parallel differential evolution (DE) optimization algorithm.")
1180 (license license:gpl2+)))
1182 (define-public libngspice
1183 ;; Note: The ngspice's build system does not allow us to build both the
1184 ;; library and the executables in one go. Thus, we have two packages.
1185 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1191 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1192 version "/ngspice-" version ".tar.gz"))
1195 "02019ndcl057nq9z41nxycqba7wxlb081ibvfj9jv010nz431qji"))
1196 (modules '((guix build utils)))
1197 ;; We remove the non-free cider and build without it.
1200 (delete-file-recursively "src/ciderlib")
1201 (delete-file "src/ciderinit")
1202 (substitute* "configure"
1203 (("src/ciderlib/Makefile") "")
1204 (("src/ciderlib/input/Makefile") "")
1205 (("src/ciderlib/support/Makefile") "")
1206 (("src/ciderlib/oned/Makefile") "")
1207 (("src/ciderlib/twod/Makefile") ""))
1209 (build-system gnu-build-system)
1211 `(;; No tests for libngspice exist.
1212 ;; The transient tests for ngspice fail.
1215 (modify-phases %standard-phases
1216 (add-after 'unpack 'patch-timestamps
1218 (substitute* "configure"
1219 (("`date`") "Do 1. Jan 00:00:00 UTC 1970"))
1221 (add-after 'unpack 'delete-program-manuals
1223 (substitute* "man/man1/Makefile.in"
1224 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1227 (add-after 'install 'delete-script-files
1228 (lambda* (#:key outputs #:allow-other-keys)
1229 (delete-file-recursively
1230 (string-append (assoc-ref outputs "out")
1231 "/share/ngspice/scripts")))))
1233 (list "--enable-openmp"
1236 "--with-readline=yes")))
1241 `(("libxaw" ,libxaw)
1243 ("readline" ,readline)))
1244 (home-page "http://ngspice.sourceforge.net/")
1245 (synopsis "Mixed-level/mixed-signal circuit simulator")
1247 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1248 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1249 provides code modeling support and simulation of digital components through
1250 an embedded event driven algorithm.")
1251 (license (list license:lgpl2.0+ ; code in frontend/numparam
1252 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1253 license:public-domain)))) ; xspice
1255 (define-public ngspice
1256 ;; The ngspice executables (see libngpsice above.)
1257 (package (inherit libngspice)
1260 (substitute-keyword-arguments (package-arguments libngspice)
1261 ((#:configure-flags flags)
1262 `(delete "--with-ngshared" ,flags))
1264 `(modify-phases ,phases
1265 (add-after 'unpack 'delete-include-files
1267 (substitute* "src/Makefile.in"
1268 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1269 "SUBDIRS = misc maths frontend spicelib"))
1271 (add-after 'install 'delete-cmpp-dlmain
1272 (lambda* (#:key outputs #:allow-other-keys)
1273 (for-each (lambda (file)
1275 (string-append (assoc-ref outputs "out")
1277 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1279 (delete 'delete-program-manuals)
1280 (delete 'delete-script-files)))))
1282 `(("libngspice" ,libngspice)
1283 ("readline" ,readline)))))
1285 (define trilinos-serial-xyce
1286 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1287 ;; keep it private. See
1288 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1289 ;; TODO: Remove when we have modular Trilinos packages?
1291 (name "trilinos-serial-xyce")
1294 (origin (method url-fetch)
1295 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1296 version "-Source.tar.gz"))
1299 "07jd1qpsbf31cmbyyngr4l67xzwyan24dyx5wlcahgbw7x6my3wn"))))
1300 (build-system cmake-build-system)
1302 `(#:out-of-source? #t
1304 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1305 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1306 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1307 "-DTrilinos_ENABLE_NOX=ON"
1308 "-DNOX_ENABLE_LOCA=ON"
1309 "-DTrilinos_ENABLE_EpetraExt=ON"
1310 "-DEpetraExt_BUILD_BTF=ON"
1311 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1312 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1313 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1314 "-DTrilinos_ENABLE_Ifpack=ON"
1315 "-DTrilinos_ENABLE_Isorropia=ON"
1316 "-DTrilinos_ENABLE_AztecOO=ON"
1317 "-DTrilinos_ENABLE_Belos=ON"
1318 "-DTrilinos_ENABLE_Teuchos=ON"
1319 "-DTeuchos_ENABLE_COMPLEX=ON"
1320 "-DTrilinos_ENABLE_Amesos=ON"
1321 "-DAmesos_ENABLE_KLU=ON"
1322 "-DAmesos_ENABLE_UMFPACK=ON"
1323 "-DTrilinos_ENABLE_Sacado=ON"
1324 "-DTrilinos_ENABLE_Kokkos=OFF"
1325 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1326 "-DTPL_ENABLE_AMD=ON"
1327 "-DTPL_ENABLE_UMFPACK=ON"
1328 "-DTPL_ENABLE_BLAS=ON"
1329 "-DTPL_ENABLE_LAPACK=ON")))
1331 `(("fortran" ,gfortran)
1335 ("lapack" ,lapack-3.5)
1336 ("suitesparse" ,suitesparse)))
1337 (home-page "https://trilinos.org")
1338 (synopsis "Engineering and scientific problems algorithms")
1340 "The Trilinos Project is an effort to develop algorithms and enabling
1341 technologies within an object-oriented software framework for the solution of
1342 large-scale, complex multi-physics engineering and scientific problems. A
1343 unique design feature of Trilinos is its focus on packages.")
1344 (license (list license:lgpl2.1+
1347 (define-public xyce-serial
1349 (name "xyce-serial")
1352 (origin (method url-fetch)
1353 (uri (string-append "https://archive.org/download/Xyce-"
1354 version "/Xyce-" version ".tar.gz"))
1357 "02k952mnvrnc5kv7r65fdrn7khwq1lbyhwyvd7jznafzdpsvgm4x"))))
1358 (build-system gnu-build-system)
1363 "CXXFLAGS=-O3 -std=c++11"
1364 (string-append "ARCHDIR="
1365 (assoc-ref %build-inputs "trilinos")))))
1369 ("fortran" ,gfortran)))
1372 ("suitesparse" ,suitesparse)
1373 ("lapack" ,lapack-3.5)
1374 ("trilinos" ,trilinos-serial-xyce)))
1375 (home-page "https://xyce.sandia.gov/")
1376 (synopsis "High-performance analog circuit simulator")
1378 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1379 capable of solving extremely large circuit problems by supporting large-scale
1380 parallel computing platforms. It also supports serial execution.")
1381 (license license:gpl3+)))
1383 (define trilinos-parallel-xyce
1384 (package (inherit trilinos-serial-xyce)
1385 (name "trilinos-parallel-xyce")
1387 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1388 ((#:configure-flags flags)
1389 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1390 "-DTrilinos_ENABLE_Zoltan=ON"
1391 "-DTPL_ENABLE_MPI=ON")
1395 ,@(package-inputs trilinos-serial-xyce)))))
1397 (define-public xyce-parallel
1398 (package (inherit xyce-serial)
1399 (name "xyce-parallel")
1401 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1402 ((#:configure-flags flags)
1403 `(list "CXXFLAGS=-O3 -std=c++11"
1408 "--enable-isorropia=no"
1409 "--enable-zoltan=no"
1412 (assoc-ref %build-inputs "trilinos")))))))
1414 `(("mpi" ,openmpi)))
1416 `(("trilinos" ,trilinos-parallel-xyce)
1417 ,@(alist-delete "trilinos"
1418 (package-inputs xyce-serial))))))
1420 (define-public freehdl
1426 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1430 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1431 (build-system gnu-build-system)
1434 (modify-phases %standard-phases
1435 (add-before 'configure 'patch-pkg-config
1436 (lambda* (#:key inputs #:allow-other-keys)
1437 (substitute* "freehdl/freehdl-config"
1439 (string-append (assoc-ref inputs "pkg-config")
1442 (string-append (assoc-ref inputs "coreutils")
1445 (add-after 'patch-pkg-config 'setenv
1446 (lambda* (#:key inputs #:allow-other-keys)
1447 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1449 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1452 (add-after 'setenv 'patch-gvhdl
1454 (substitute* "v2cc/gvhdl.in"
1455 (("--mode=link") "--mode=link --tag=CXX")
1456 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1458 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1459 (lambda* (#:key inputs #:allow-other-keys)
1460 (substitute* "freehdl/freehdl-gennodes.in"
1462 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1463 (("\\(debug") ";(debug")
1464 (("\\(@ ") "(apply-emit")
1465 (("\\(@@ ") "(apply-mini-format"))
1467 (add-after 'configure 'patch-freehdl-pc
1468 (lambda* (#:key inputs #:allow-other-keys)
1469 (substitute* "freehdl.pc"
1471 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1474 (string-append "=" (assoc-ref inputs "libtool")
1477 (add-after 'install-scripts 'make-wrapper
1478 (lambda* (#:key inputs outputs #:allow-other-keys)
1479 (let ((out (assoc-ref outputs "out")))
1480 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1482 (wrap-program (string-append out "/bin/gvhdl")
1483 `("CPLUS_INCLUDE_PATH" ":" prefix
1484 (,(string-append (assoc-ref inputs "gcc-toolchain")
1486 `("LIBRARY_PATH" ":" prefix
1487 (,(string-append (assoc-ref inputs "gcc-toolchain")
1490 (,(string-append (assoc-ref inputs "gcc-toolchain")
1492 ,(string-append (assoc-ref inputs "coreutils")
1494 (wrap-program (string-append out "/bin/freehdl-config")
1495 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1498 `(("coreutils" ,coreutils)
1499 ("gcc-toolchain" ,gcc-toolchain)
1500 ("guile" ,guile-2.2)
1502 ("pkg-config" ,pkg-config)
1503 ("libtool" ,libtool)))
1505 `(("pkg-config-native" ,pkg-config)
1506 ("libtool-native" ,libtool)))
1507 (home-page "http://www.freehdl.seul.org/")
1508 (synopsis "VHDL simulator")
1510 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1511 VHDL'93 as well as VHDL'87 standards are supported.")
1512 (license (list license:gpl2+
1513 license:lgpl2.0+)))) ; freehdl's libraries
1523 "https://sourceforge.net/projects/qucs/files/qucs/" version
1524 "/qucs-" version ".tar.gz"))
1527 "0giv9gfyfdizvjhq56x2pdncrlyv3k15lrsh6pk37i94vr7l7ij5"))))
1528 (build-system gnu-build-system)
1531 (modify-phases %standard-phases
1532 (add-before 'configure 'patch-configure
1533 (lambda* (#:key inputs #:allow-other-keys)
1534 (substitute* "qucs/configure"
1535 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1537 (add-after 'patch-configure 'patch-scripts
1538 (lambda* (#:key inputs outputs #:allow-other-keys)
1539 (substitute* '("qucs/qucs/qucsdigi"
1540 "qucs/qucs/qucsdigilib"
1541 "qucs/qucs/qucsveri")
1543 (string-append (assoc-ref outputs "out") "/bin"))
1545 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1547 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1549 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1551 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1553 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1555 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1557 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1559 (add-before 'check 'pre-check
1561 ;; The test suite requires a running X server.
1562 (system "Xvfb :1 &")
1563 (setenv "DISPLAY" ":1")
1565 (add-after 'install 'make-wrapper
1566 (lambda* (#:key inputs outputs #:allow-other-keys)
1567 (let ((out (assoc-ref outputs "out")))
1568 ;; 'qucs' directly invokes gcc, hence this wrapping.
1569 (wrap-program (string-append out "/bin/qucs")
1570 `("CPLUS_INCLUDE_PATH" ":" prefix
1571 (,(string-append (assoc-ref inputs "gcc-toolchain")
1574 (,(string-append (assoc-ref inputs "gcc-toolchain")
1576 `("LIBRARY_PATH" ":" prefix
1577 (,(string-append (assoc-ref inputs "gcc-toolchain")
1579 `("ADMSXMLBINDIR" ":" prefix
1580 (,(string-append (assoc-ref inputs "adms") "/bin")))
1581 `("ASCOBINDIR" ":" prefix
1582 (,(string-append (assoc-ref inputs "asco") "/bin")))
1583 `("QUCS_OCTAVE" ":" prefix
1584 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1586 #:parallel-build? #f ; race condition
1587 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1590 ("libtool-native" ,libtool)
1591 ("python" ,python-2) ; for tests
1592 ("matplotlib" ,python2-matplotlib) ; for tests
1593 ("numpy" ,python2-numpy) ; for tests
1594 ("xorg-server" ,xorg-server))) ; for tests
1598 ("coreutils" ,coreutils)
1599 ("freehdl" ,freehdl)
1600 ("gcc-toolchain" ,gcc-toolchain)
1601 ("iverilog" ,iverilog)
1602 ("libtool" ,libtool)
1606 (home-page "http://qucs.sourceforge.net/")
1607 (synopsis "Circuit simulator with graphical user interface")
1609 "Qucs is a circuit simulator with graphical user interface. The software
1610 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1611 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1612 simulations are also supported.")
1613 (license license:gpl2+)))
1615 (define-public qucs-s
1621 (uri (string-append "https://github.com/ra3xdh/qucs/releases/download/"
1622 version "/qucs-" version ".tar.gz"))
1625 "1bhahvdqmayaw0306fxz1ghmjhd4fq05yk3rk7zi0z703w5imgjv"))))
1626 (build-system cmake-build-system)
1628 `(#:tests? #f ; no tests
1630 (modify-phases %standard-phases
1631 (add-before 'configure 'patch-scripts
1632 (lambda* (#:key inputs #:allow-other-keys)
1633 (substitute* '("qucs/qucsdigi"
1637 (string-append (assoc-ref inputs "qucs") "/bin"))
1639 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1641 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1643 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1645 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1647 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1649 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1651 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1653 (add-after 'patch-scripts 'patch-paths
1654 (lambda* (#:key inputs #:allow-other-keys)
1655 (substitute* "qucs/main.cpp"
1656 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1657 "\\+ \"qucsator\" \\+ executableSuffix"))
1658 (string-append "}{ QucsSettings.Qucsator = \""
1659 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1660 (((string-append "else QucsSettings\\.XyceExecutable = "
1661 "\"/usr/local/Xyce-Release-6.2.0-OPENSOURCE/bin/runxyce"))
1662 (string-append "QucsSettings.XyceExecutable = \""
1663 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1664 (((string-append "else QucsSettings\\.XyceParExecutable = \"/usr/local"
1665 "/Xyce-Release-6.2.0-OPENMPI-OPENSOURCE/bin/xmpirun"))
1666 (string-append "QucsSettings.XyceParExecutable = \""
1667 (assoc-ref inputs "mpi") "/bin/mpirun"))
1669 (string-append "%p "(assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1670 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1671 (string-append "QucsSettings.NgspiceExecutable = " "\""
1672 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1673 (substitute* "qucs/qucs_actions.cpp"
1675 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1677 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1679 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1681 (add-after 'install 'install-scripts
1682 (lambda* (#:key inputs outputs #:allow-other-keys)
1685 (let ((file (string-append "../qucs-" ,version
1687 (out (assoc-ref outputs "out")))
1688 (install-file file (string-append out "/bin"))
1689 (chmod (string-append out "/bin/" script) #o555)))
1690 '("qucsdigi" "qucsdigilib" "qucsveri"))
1692 (add-after 'install-scripts 'make-wrapper
1693 (lambda* (#:key inputs outputs #:allow-other-keys)
1694 (let* ((out (assoc-ref outputs "out"))
1695 (file (string-append out "/bin/qucs-s"))
1696 (qucs (assoc-ref inputs "qucs"))
1697 (qucsator (string-append qucs "/bin/qucsator")))
1699 `("CPLUS_INCLUDE_PATH" ":" prefix
1700 (,(string-append (assoc-ref inputs "gcc-toolchain")
1703 (,(string-append (assoc-ref inputs "gcc-toolchain")
1705 `("LIBRARY_PATH" ":" prefix
1706 (,(string-append (assoc-ref inputs "gcc-toolchain")
1708 `("QUCSATOR" ":" prefix (,qucsator))
1709 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1710 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1712 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1714 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1716 (symlink qucsator (string-append out "/bin/qucsator"))
1719 `(("libtool-native" ,libtool)))
1723 ("coreutils" ,coreutils)
1724 ("freehdl" ,freehdl)
1725 ("gcc-toolchain" ,gcc-toolchain)
1726 ("iverilog" ,iverilog)
1727 ("libtool" ,libtool)
1729 ("ngspice" ,ngspice)
1734 ("xyce-serial" ,xyce-serial)
1735 ("xyce-parallel" ,xyce-parallel)))
1736 (home-page "https://ra3xdh.github.io/")
1737 (synopsis "Circuit simulator with graphical user interface")
1739 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1740 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1741 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1742 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1743 (license license:gpl2+)))