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>
11 ;;; Copyright © 2018 Jonathan Brielmaier <jonathan.brielmaier@web.de>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages engineering)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix gexp)
32 #:use-module (guix git-download)
33 #:use-module (guix monads)
34 #:use-module (guix store)
35 #:use-module (guix utils)
36 #:use-module ((srfi srfi-1) #:hide (zip))
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix build-system cmake)
39 #:use-module (guix build-system gnu)
40 #:use-module (guix build-system python)
41 #:use-module (gnu packages)
42 #:use-module (gnu packages algebra)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages base)
45 #:use-module (gnu packages bison)
46 #:use-module (gnu packages boost)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages commencement)
49 #:use-module (gnu packages compression)
50 #:use-module (gnu packages curl)
51 #:use-module (gnu packages flex)
52 #:use-module (gnu packages fontutils)
53 #:use-module (gnu packages fpga)
54 #:use-module (gnu packages freedesktop)
55 #:use-module (gnu packages gcc)
56 #:use-module (gnu packages gd)
57 #:use-module (gnu packages gettext)
58 #:use-module (gnu packages ghostscript)
59 #:use-module (gnu packages gl)
60 #:use-module (gnu packages glib)
61 #:use-module (gnu packages gnome)
62 #:use-module (gnu packages gperf)
63 #:use-module (gnu packages groff)
64 #:use-module (gnu packages gtk)
65 #:use-module (gnu packages guile)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages imagemagick)
68 #:use-module (gnu packages linux) ;FIXME: for pcb
69 #:use-module (gnu packages m4)
70 #:use-module (gnu packages maths)
71 #:use-module (gnu packages multiprecision)
72 #:use-module (gnu packages mpi)
73 #:use-module (gnu packages ncurses)
74 #:use-module (gnu packages perl)
75 #:use-module (gnu packages pkg-config)
76 #:use-module (gnu packages python)
77 #:use-module (gnu packages qt)
78 #:use-module (gnu packages readline)
79 #:use-module (gnu packages swig)
80 #:use-module (gnu packages tcl)
81 #:use-module (gnu packages texinfo)
82 #:use-module (gnu packages tls)
83 #:use-module (gnu packages tex)
84 #:use-module (gnu packages wxwidgets)
85 #:use-module (gnu packages xorg))
87 (define-public librecad
94 "https://github.com/LibreCAD/LibreCAD/archive/"
96 (file-name (string-append name "-" version ".tar.gz"))
99 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
100 (build-system gnu-build-system)
103 (modify-phases %standard-phases
104 ;; Without this patch boost complains that "make_array" is not a
105 ;; member of "boost::serialization".
106 (add-after 'unpack 'patch-boost-error
108 (substitute* "librecad/src/lib/math/lc_quadratic.h"
109 (("#include \"rs_vector.h\"" line)
111 "\n#include <boost/serialization/array_wrapper.hpp>")))
112 (substitute* "librecad/src/lib/math/rs_math.cpp"
113 (("#include <boost/numeric/ublas/matrix.hpp>" line)
114 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
117 ;; Fix build against Qt 5.11.
118 (add-after 'unpack 'add-missing-headers
120 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
121 (("#include <QPushButton>") "#include <QPushButton>
122 #include <QActionGroup>"))
124 (add-after 'unpack 'patch-paths
125 (lambda* (#:key outputs #:allow-other-keys)
126 (let ((out (assoc-ref outputs "out")))
127 (substitute* "librecad/src/lib/engine/rs_system.cpp"
128 (("/usr/share") (string-append out "/share"))))))
130 (lambda* (#:key inputs #:allow-other-keys)
131 (system* "qmake" (string-append "BOOST_DIR="
132 (assoc-ref inputs "boost")))))
134 (lambda* (#:key outputs #:allow-other-keys)
135 (let* ((out (assoc-ref outputs "out"))
136 (bin (string-append out "/bin"))
137 (share (string-append out "/share/librecad")))
139 (install-file "unix/librecad" bin)
141 (copy-recursively "unix/resources" share))
143 ;; Ensure that icons are found at runtime
144 (add-after 'install 'wrap-executable
145 (lambda* (#:key inputs outputs #:allow-other-keys)
146 (let* ((out (assoc-ref outputs "out"))
147 (qt '("qtbase" "qtsvg")))
148 (wrap-program (string-append out "/bin/librecad")
149 `("QT_PLUGIN_PATH" ":" prefix
150 ,(map (lambda (label)
151 (string-append (assoc-ref inputs label)
152 "/lib/qt5/plugins/"))
157 ("muparser" ,muparser)
158 ("freetype" ,freetype)
162 `(("pkg-config" ,pkg-config)
164 (home-page "http://librecad.org/")
165 (synopsis "Computer-aided design (CAD) application")
167 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
169 (license license:gpl2)))
171 (define-public geda-gaf
178 "http://ftp.geda-project.org/geda-gaf/unstable/v"
179 (version-major+minor version) "/"
180 version "/geda-gaf-" version ".tar.gz"))
183 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
184 (build-system gnu-build-system)
187 (modify-phases %standard-phases
188 ;; tests require a writable HOME
189 (add-before 'check 'set-home
191 (setenv "HOME" (getenv "TMPDIR"))
193 ;; FIXME: These two tests fail for unknown reasons. They return "2"
194 ;; when they should return "1".
195 (add-after 'unpack 'disable-failing-tests
197 (substitute* "utils/tests/gxyrs/tests.list"
198 (("^do_nothing.*") ""))
201 (let ((pcb (assoc-ref %build-inputs "pcb")))
202 (list (string-append "--with-pcb-datadir=" pcb "/share")
203 (string-append "--with-pcb-lib-path="
204 pcb "/share/pcb/pcblib-newlib:"
205 pcb "/share/pcb/newlib")))))
210 ("desktop-file-utils" ,desktop-file-utils)
211 ("shared-mime-info" ,shared-mime-info)
215 `(("pkg-config" ,pkg-config)
216 ("perl" ,perl))) ; for tests
217 (home-page "http://geda-project.org/")
218 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
220 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
221 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
222 which currently includes: gschem, a schematic capture program; gnetlist, a
223 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
224 gattrib, a spreadsheet programm that manipulates the properties of symbols of
225 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
226 tool to forward annotation from your schematic to layout using PCB; some minor
228 (license license:gpl2+)))
230 (define-public lepton-eda
231 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
232 ;; keep and to extend Guile support.
236 (version "1.9.5-20180820")
237 (home-page "https://github.com/lepton-eda/lepton-eda")
240 (uri (git-reference (url home-page) (commit version)))
243 "1ayaccvw18zh4g7a4x5jf6yxkphi5xafb0hpc732g59qkgwfcmlr"))
244 (file-name (git-file-name name version))))
246 `(("autoconf" ,autoconf)
247 ("automake" ,automake)
249 ("gettext" ,gnu-gettext)
253 ,@(package-native-inputs geda-gaf)))
254 ;; For now it's Guile 2.0, not 2.2.
256 (substitute-keyword-arguments (package-arguments geda-gaf)
257 ((#:configure-flags flags ''())
258 ;; When running "make", the POT files are built with the build time as
259 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
260 ;; files were updated and goes on to run "msgmerge"; as a result, the
261 ;; non-deterministic POT-Creation-Date finds its way into .po files,
262 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
263 ;; never runs. See <https://bugs.debian.org/792687>.
264 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
265 ((#:phases phases '%standard-phases)
266 `(modify-phases ,phases
267 (add-before 'bootstrap 'prepare
269 ;; Some of the scripts there are invoked by autogen.sh.
270 (for-each patch-shebang (find-files "build-tools"))
272 ;; Make sure 'msgmerge' can modify the PO files.
273 (for-each (lambda (po)
275 (find-files "." "\\.po$"))
277 ;; This would normally be created by invoking 'git', but it
278 ;; doesn't work here.
279 (call-with-output-file "version.h"
281 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
282 ,(string-drop version
283 (+ 1 (string-index version #\-))))
284 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
285 ,(string-take version
286 (string-index version #\-)))
287 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
290 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
291 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
292 design, schematic capture, simulation, prototyping, and production. Lepton
293 EDA includes tools for schematic capture, attribute management, bill of
294 materials (BOM) generation, netlisting into over 20 netlist formats, analog
295 and digital simulation, and printed circuit board (PCB) layout, and many other
304 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
305 "/pcb-" version ".tar.gz"))
308 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
309 (build-system gnu-build-system)
312 (modify-phases %standard-phases
313 (add-after 'unpack 'use-wish8.6
315 (substitute* "configure"
316 (("wish85") "wish8.6"))
318 ;; It checks for "xhost", which we don't have. This shouldn't
319 ;; matter, because the test is supposed to be skipped, but it causes
320 ;; "run_tests.sh" (and thus the "check" phase) to fail.
321 (add-after 'unpack 'fix-check-for-display
323 (substitute* "tests/run_tests.sh"
324 (("have_display=no") "have_display=yes"))
326 (add-after 'install 'wrap
327 (lambda* (#:key inputs outputs #:allow-other-keys)
328 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
329 ;; fix of the mesa package we wrap the pcb executable such that
330 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
331 (let* ((out (assoc-ref outputs "out"))
332 (path (string-append (assoc-ref inputs "udev") "/lib")))
333 (wrap-program (string-append out "/bin/pcb")
334 `("LD_LIBRARY_PATH" ":" prefix (,path))))
336 (add-before 'check 'pre-check
339 (setenv "DISPLAY" ":1")
344 ("udev" ,eudev) ;FIXME: required by mesa
348 ("gtkglext" ,gtkglext)
349 ("desktop-file-utils" ,desktop-file-utils)
350 ("shared-mime-info" ,shared-mime-info)
353 `(("pkg-config" ,pkg-config)
354 ("intltool" ,intltool)
358 ("imagemagick" ,imagemagick)
360 ("ghostscript" ,ghostscript)
361 ("xvfb" ,xorg-server)))
362 (home-page "http://pcb.geda-project.org/")
363 (synopsis "Design printed circuit board layouts")
365 "GNU PCB is an interactive tool for editing printed circuit board
366 layouts. It features a rats-nest implementation, schematic/netlist import,
367 and design rule checking. It also includes an autorouter and a trace
368 optimizer; and it can produce photorealistic and design review images.")
369 (license license:gpl2+)))
371 (define-public pcb-rnd
372 (package (inherit pcb)
377 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
378 "pcb-rnd-" version ".tar.gz"))
381 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
383 `(#:tests? #f ; no check target
385 (modify-phases %standard-phases
386 (add-after 'unpack 'cc-is-gcc
387 (lambda _ (setenv "CC" "gcc") #t))
389 ;; The configure script doesn't tolerate most of our configure flags.
390 (lambda* (#:key outputs #:allow-other-keys)
391 (zero? (system* "sh" "configure"
392 (string-append "--prefix="
393 (assoc-ref outputs "out")))))))))
394 (home-page "http://repo.hu/projects/pcb-rnd/")
395 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
396 featuring various improvements and bug fixes.")))
398 (define-public fastcap
401 (version "2.0-18Sep92")
403 (method url-fetch/tarbomb)
404 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
405 name "-" version ".tgz"))
408 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
410 ;; Remove a non-free file.
412 (delete-file "doc/psfig.sty")
414 (patches (search-patches "fastcap-mulSetup.patch"
415 "fastcap-mulGlobal.patch"))))
416 (build-system gnu-build-system)
418 ;; FIXME: with texlive-tiny citation references are rendered as question
419 ;; marks. During the build warnings like these are printed:
420 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
421 `(("texlive" ,texlive-tiny)
422 ("ghostscript" ,ghostscript)))
424 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
426 #:tests? #f ;; no tests-suite
427 #:modules ((srfi srfi-1)
428 ,@%gnu-build-system-modules)
430 (modify-phases %standard-phases
431 (add-after 'build 'make-doc
433 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
435 (add-before 'make-doc 'fix-doc
437 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
438 (substitute* (find-files "doc" "\\.tex")
439 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
441 (string-append "\\includegraphics[scale=" scale "]{"
443 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
445 (string-append "\\includegraphics[width=" width "]{"
447 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
449 (string-append "\\includegraphics[height=" height "]{"
451 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
452 (string-append "\\includegraphics{" file "}")))
453 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
454 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
456 (string-append "\\documentclass[" options "]{"
458 "\\usepackage{graphicx}\n"
459 "\\usepackage{robinspace}"))
460 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
461 (string-append "%" all))
462 (("\\\\setstretch\\{.*\\}" all)
463 (string-append "%" all)))
466 (add-before 'install 'clean-bin
468 (delete-file (string-append (getcwd) "/bin/README"))
470 (add-before 'install 'make-pdf
472 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
473 (with-directory-excursion "doc"
475 (every (lambda (file)
476 (zero? (system* "dvips" file "-o")))
477 (find-files "." "\\.dvi"))
478 (every (lambda (file)
479 (zero? (system* "ps2pdf" file)))
480 '("mtt.ps" "ug.ps" "tcad.ps"))
481 (zero? (system* "make" "clean"))))))
483 (lambda* (#:key outputs #:allow-other-keys)
484 (let* ((out (assoc-ref outputs "out"))
485 (data (string-append out "/share"))
486 (bin (string-append out "/bin"))
487 (doc (string-append data "/doc/" ,name "-" ,version))
488 (examples (string-append doc "/examples")))
489 (with-directory-excursion "bin"
490 (for-each (lambda (f)
491 (install-file f bin))
492 (find-files "." ".*")))
493 (copy-recursively "doc" doc)
494 (copy-recursively "examples" examples)
496 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
497 (synopsis "Multipole-accelerated capacitance extraction program")
499 "Fastcap is a capacitance extraction program based on a
500 multipole-accelerated algorithm.")
501 (license (license:non-copyleft #f "See fastcap.c."))))
503 (define-public fasthenry
506 (version "3.0-12Nov96")
509 (file-name (string-append name "-" version ".tar.gz"))
511 "http://www.rle.mit.edu/cpg/codes/" name
512 "-" version ".tar.z"))
514 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
515 (patches (search-patches "fasthenry-spAllocate.patch"
516 "fasthenry-spBuild.patch"
517 "fasthenry-spUtils.patch"
518 "fasthenry-spSolve.patch"
519 "fasthenry-spFactor.patch"))))
520 (build-system gnu-build-system)
522 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
524 #:tests? #f ;; no tests-suite
525 #:modules ((srfi srfi-1)
526 ,@%gnu-build-system-modules)
528 (modify-phases %standard-phases
531 (lambda* (#:key outputs #:allow-other-keys)
532 (let* ((out (assoc-ref outputs "out"))
533 (data (string-append out "/share"))
534 (bin (string-append out "/bin"))
535 (doc (string-append data "/doc/" ,name "-" ,version))
536 (examples (string-append doc "/examples")))
537 (with-directory-excursion "bin"
538 (for-each (lambda (f)
539 (install-file f bin))
540 (find-files "." ".*")))
541 (copy-recursively "doc" doc)
542 (copy-recursively "examples" examples)
544 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
545 (synopsis "Multipole-accelerated inductance analysis program")
547 "Fasthenry is an inductance extraction program based on a
548 multipole-accelerated algorithm.")
549 (license (license:non-copyleft #f "See induct.c."))))
551 (define-public fritzing
557 (uri (string-append "https://github.com/fritzing/"
558 "fritzing-app/archive/" version ".tar.gz"))
559 (file-name (string-append name "-" version ".tar.gz"))
562 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
563 (build-system gnu-build-system)
566 (modify-phases %standard-phases
568 (lambda* (#:key inputs outputs #:allow-other-keys)
569 (and (zero? (system* "tar"
570 "-xvf" (assoc-ref inputs "fritzing-parts-db")
572 (zero? (system* "qmake"
573 (string-append "PREFIX="
574 (assoc-ref outputs "out"))
575 "phoenix.pro"))))))))
578 ("qtserialport" ,qtserialport)
585 (uri (string-append "https://github.com/fritzing/"
586 "fritzing-parts/archive/" version ".tar.gz"))
587 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
590 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
591 (home-page "http://fritzing.org")
592 (synopsis "Electronic circuit design")
594 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
595 software with a low entry barrier, suited for the needs of makers and
596 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
597 library with many commonly used high-level components. Fritzing makes it very
598 easy to communicate about circuits, as well as to turn them into PCB layouts
599 ready for production.")
600 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
601 ;; released under GPLv3+.
602 (license (list license:gpl3+ license:cc-by-sa3.0))))
610 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
611 version "/gerbv-" version ".tar.gz"))
614 "1cw8k6ni0q8kswad03kha86fk7n06vq8p0wzsfhcnalsdshrn17i"))))
615 (build-system gnu-build-system)
617 `(("pkg-config" ,pkg-config)))
621 ("desktop-file-utils" ,desktop-file-utils)))
622 (home-page "http://gerbv.geda-project.org/")
623 (synopsis "Gerber file viewer")
625 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
626 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
627 you load several files on top of each other, do measurements on the displayed
628 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
629 as well as pick-place files.")
630 (license license:gpl2+)))
632 (define-public libfive
633 (let ((commit "9d857d1923abecb0e5935b9287d22661f6efaac5")
637 (version (git-version "0" revision commit))
641 (url "https://github.com/libfive/libfive")
645 "1r40kyx30wz31cwwlfvfh7fgqkxq3n8dxhswpi9qpf4r5h3l8wsn"))
646 (file-name (git-file-name name version))
648 ;; Remove bundled catch since we provide our own.
650 (delete-file "libfive/test/catch.hpp")
652 (build-system cmake-build-system)
654 `(#:test-target "libfive-test"
656 (modify-phases %standard-phases
657 (add-after 'unpack 'remove-native-compilation
659 (substitute* "CMakeLists.txt" (("-march=native") ""))
662 `(("pkg-config" ,pkg-config)))
665 ("catch" ,catch-framework)
669 ("guile" ,guile-2.2)))
670 (home-page "https://libfive.com")
671 (synopsis "Tool for programmatic computer-aided design")
673 "Libfive is a tool for programmatic computer-aided design (CAD). In
674 libfive, solid models are defined as Scheme scripts, and there are no opaque
675 function calls into the geometry kernel: everything is visible to the user.
676 Even fundamental, primitive shapes are represented as code in the user-level
678 (license (list license:lgpl2.1+ ;library
679 license:gpl2+))))) ;Guile bindings and GUI
682 (deprecated-package "ao-cad" libfive))
691 (file-name (string-append name "-" version ".tar.xz"))
693 "https://launchpad.net/kicad/5.0/" version "/+download/" name
694 "-" version ".tar.xz"))
696 (base32 "17nqjszyvd25wi6550j981whlnb1wxzmlanljdjihiki53j84x9p"))))
697 (build-system cmake-build-system)
699 `(#:out-of-source? #t
700 #:tests? #f ; no tests
701 #:build-type "Release"
703 (list "-DKICAD_STABLE_VERSION=ON"
704 "-DKICAD_REPO_NAME=stable"
705 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
706 "-DKICAD_SCRIPTING=ON"
707 "-DKICAD_SCRIPTING_MODULES=ON"
708 "-DKICAD_SCRIPTING_WXPYTHON=ON"
709 ;; Has to be set explicitely, as we don't have the wxPython
710 ;; headers in the wxwidgets store item, but in wxPython.
711 (string-append "-DCMAKE_CXX_FLAGS=-I"
712 (assoc-ref %build-inputs "wxpython")
714 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
716 ;; TODO: Enable this when CA certs are working with curl.
717 "-DBUILD_GITHUB_PLUGIN=OFF")
719 (modify-phases %standard-phases
720 (add-after 'install 'wrap-program
721 ;; Ensure correct Python at runtime.
722 (lambda* (#:key inputs outputs #:allow-other-keys)
723 (let* ((out (assoc-ref outputs "out"))
724 (python (assoc-ref inputs "python"))
725 (file (string-append out "/bin/kicad"))
728 "/lib/python2.7/site-packages:"
729 (getenv "PYTHONPATH"))))
731 `("PYTHONPATH" ":" prefix (,path))
733 (,(string-append python "/bin:")))))
737 ("gettext" ,gnu-gettext)
738 ("pkg-config" ,pkg-config)
744 ("desktop-file-utils" ,desktop-file-utils)
747 ("hicolor-icon-theme" ,hicolor-icon-theme)
748 ("libngspice" ,libngspice)
751 ("opencascade-oce" ,opencascade-oce)
754 ("wxwidgets" ,wxwidgets-gtk2)
755 ("wxpython" ,python2-wxpython)))
756 (home-page "http://kicad-pcb.org/")
757 (synopsis "Electronics Design Automation Suite")
758 (description "Kicad is a program for the formation of printed circuit
759 boards and electrical circuits. The software has a number of programs that
760 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
761 electrical diagrams), gerbview (viewing Gerber files) and others.")
762 (license license:gpl3+)))
764 (define-public kicad-library
765 (let ((version "4.0.7"))
767 (name "kicad-library")
772 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
776 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
777 (build-system cmake-build-system)
779 `(#:out-of-source? #t
780 #:tests? #f ; no tests
782 (modify-phases %standard-phases
783 (add-after 'install 'install-footprints ; from footprints tarball
784 (lambda* (#:key inputs outputs #:allow-other-keys)
786 (assoc-ref inputs "kicad-footprints")
787 "-C" (string-append (assoc-ref outputs "out")
788 "/share/kicad/modules")
789 "--strip-components=1")))
790 ;; We change the default global footprint file, which is generated if
791 ;; it doesn't exist in user's home directory, from the one using the
792 ;; github plugin, to the one using the KISYSMOD environment path.
793 (add-after 'install-footprints 'use-pretty-footprint-table
794 (lambda* (#:key outputs #:allow-other-keys)
795 (let* ((out (assoc-ref outputs "out"))
796 (template-dir (string-append out "/share/kicad/template"))
797 (fp-lib-table (string-append template-dir "/fp-lib-table")))
798 (delete-file fp-lib-table)
799 (copy-file (string-append fp-lib-table ".for-pretty")
803 (list (search-path-specification
804 (variable "KISYSMOD") ; footprint path
805 (files '("share/kicad/modules")))
806 (search-path-specification
807 (variable "KISYS3DMOD") ; 3D model path
808 (files '("share/kicad/modules/packages3d")))))
809 ;; Kicad distributes footprints in a separate tarball.
811 `(("kicad-footprints"
815 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
819 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
820 (home-page "http://kicad-pcb.org/")
821 (synopsis "Libraries for kicad")
822 (description "This package provides Kicad component, footprint and 3D
823 render model libraries.")
824 (license license:lgpl2.0+))))
826 (define-public linsmith
833 "mirror://sourceforge/linsmith/linsmith/linsmith-"
834 version "/linsmith-" version ".tar.gz"))
837 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
838 (build-system gnu-build-system)
840 `(("pkg-config" ,pkg-config)
842 ("libgnome" ,libgnomeui)))
843 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
844 (synopsis "Smith Charting program")
845 (description "LinSmith is a Smith Charting program, mainly designed for
846 educational use. As such, there is an emphasis on capabilities that improve
847 the 'showing the effect of'-style of operation.")
848 (license license:gpl2+)))
857 (uri (string-append "http://libvolk.org/releases/volk-"
861 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
862 (build-system cmake-build-system)
866 `(("python-2" ,python-2)
867 ("python2-cheetah" ,python2-cheetah)))
868 (home-page "http://libvolk.org/")
869 (synopsis "Vector-Optimized Library of Kernels")
871 "@code{volk} contains procedures with machine-specific optimizations
872 for mathematical functions. It also provides an machine-independent
873 interface to select the best such procedures to use on a given system.")
874 (license license:gpl3+)))
876 (define-public minicom
883 (uri (string-append "https://alioth.debian.org/frs/download.php/"
884 "file/4215/" name "-" version ".tar.gz"))
887 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
888 (build-system gnu-build-system)
890 `(#:configure-flags '("--enable-lock-dir=/var/lock")
892 (modify-phases %standard-phases
893 (add-after 'unpack 'patch-lock-check
895 (substitute* "configure"
896 (("test -d [$]UUCPLOCK") "true"))
899 `(("ncurses" ,ncurses)))
900 (home-page "https://alioth.debian.org/projects/minicom/")
901 (synopsis "Serial terminal emulator")
902 (description "@code{minicom} is a serial terminal emulator.")
903 (license license:gpl2+)))
905 (define-public harminv
912 (string-append "https://github.com/stevengj/harminv/"
913 "releases/download/v" version "/"
914 name "-" version ".tar.gz"))
917 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
918 (build-system gnu-build-system)
921 (modify-phases %standard-phases
922 (add-before 'configure 'fix-tests
924 (substitute* "./sines-test.sh"
925 ; change test frequency range - default fails
929 `(("fortran" ,gfortran)))
931 `(("lapack" ,lapack)))
932 (home-page "https://github.com/stevengj/harminv")
933 (synopsis "Harmonic inversion solver")
935 "Harminv is a free program (and accompanying library) to solve the problem of
936 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
937 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
938 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
939 (license license:gpl2+)))
941 (define-public guile-libctl
943 (name "guile-libctl")
949 "http://ab-initio.mit.edu/libctl/libctl-"
953 "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
954 (build-system gnu-build-system)
956 `(("fortran" ,gfortran)))
958 `(("guile" ,guile-2.2)))
959 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
960 (synopsis "Flexible control files implementation for scientific simulations")
962 "Libctl is a Guile-based library implementing flexible control files
963 for scientific simulations.")
964 (license license:gpl2+)))
974 "http://ab-initio.mit.edu/mpb/mpb-"
978 "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
979 (build-system gnu-build-system)
982 (list (string-append "--with-libctl="
983 (assoc-ref %build-inputs "libctl")
986 `(("fortran" ,gfortran)
987 ("pkg-config" ,pkg-config)
995 ("libctl" ,guile-libctl)
996 ("readline" ,readline)
998 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
999 (synopsis "Computes band structures and electromagnetic modes of dielectric
1002 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1003 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1004 fully-vectorial and three-dimensional methods.")
1005 (license license:gpl2+)))
1015 "http://ab-initio.mit.edu/meep/meep-"
1019 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
1020 (build-system gnu-build-system)
1023 (list (string-append "--with-libctl="
1024 (assoc-ref %build-inputs "libctl")
1027 `(("fortran" ,gfortran)
1028 ("pkg-config" ,pkg-config)
1033 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
1034 ("harminv" ,harminv)
1037 ("libctl" ,guile-libctl)
1040 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1041 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1043 "Meep is a finite-difference time-domain (FDTD) simulation software package
1044 developed at MIT to model electromagnetic systems.")
1045 (license license:gpl2+)))
1055 "mirror://sourceforge/mot-adms/adms-source/"
1056 (version-major+minor version) "/adms-" version ".tar.gz"))
1059 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1060 (build-system gnu-build-system)
1064 (home-page "https://sourceforge.net/projects/mot-adms")
1065 (synopsis "Automatic device model synthesizer")
1067 "ADMS is a code generator that converts electrical compact device models
1068 specified in high-level description language into ready-to-compile C code for
1069 the API of spice simulators. Based on transformations specified in XML
1070 language, ADMS transforms Verilog-AMS code into other target languages.")
1071 (license license:gpl3)))
1073 (define-public capstone
1079 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1081 (file-name (string-append name "-" version ".tar.gz"))
1084 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
1085 (build-system gnu-build-system)
1088 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1091 (modify-phases %standard-phases
1092 (delete 'configure) ; no configure script
1093 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1094 (add-before 'build 'fix-cstool-ldflags
1095 (lambda* (#:key outputs #:allow-other-keys)
1096 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1097 (assoc-ref outputs "out") "/lib"))
1099 (home-page "https://www.capstone-engine.org")
1100 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1102 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1103 framework. Capstone can disassemble machine code for many supported architectures
1104 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1105 bindings for Python, Java, OCaml and more.")
1106 (license license:bsd-3)))
1108 ;; FIXME: This package has a timestamp embedded in
1109 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1110 (define-public python-capstone
1113 (name "python-capstone")
1115 `(("capstone" ,capstone)))
1116 (build-system python-build-system)
1119 (modify-phases %standard-phases
1120 (add-after 'unpack 'chdir-and-fix-setup-py
1122 (chdir "bindings/python")
1123 ;; Do not build the library again, because we already have it.
1124 (substitute* "setup.py" ((".* build_libraries.*") ""))
1125 ;; This substitution tells python-capstone where to find the
1127 (substitute* "capstone/__init__.py"
1128 (("pkg_resources.resource_filename.*")
1129 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1132 (define-public python2-capstone
1133 (package-with-python2 python-capstone))
1135 (define-public radare2
1141 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1142 name "-" version ".tar.gz"))
1145 "17h4ba5qqahfi8mi4x2dcvq87cqpir5v2dlaqbvmay6vby4zh4v7"))
1146 (modules '((guix build utils)))
1149 (substitute* "libr/asm/p/Makefile"
1150 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1151 (substitute* "libr/parse/p/Makefile"
1152 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1153 (substitute* "libr/bin/p/Makefile"
1154 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1156 (build-system gnu-build-system)
1158 '(#:tests? #f; tests require git and network access
1160 (modify-phases %standard-phases
1161 (add-before 'configure 'mklibdir
1162 (lambda* (#:key inputs #:allow-other-keys)
1163 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1166 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1167 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1171 `(("openssl" ,openssl)
1174 ("capstone" ,capstone)))
1176 `(("pkg-config" ,pkg-config)))
1177 (home-page "https://radare.org/")
1178 (synopsis "Portable reversing framework")
1180 "Radare project started as a forensics tool, a scriptable commandline
1181 hexadecimal editor able to open disk files, but later support for analyzing
1182 binaries, disassembling code, debugging programs, attaching to remote gdb
1184 (license license:lgpl3)))
1192 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1196 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1197 (build-system gnu-build-system)
1199 `(#:tests? #f ; no tests
1200 #:make-flags '("all" "asco-mpi")
1202 (modify-phases %standard-phases
1204 (add-before 'build 'fix-paths
1205 (lambda* (#:key inputs #:allow-other-keys)
1206 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1207 (substitute* '("errfunc.c" "asco.c")
1209 (string-append coreutils "/bin/cp "))
1211 (string-append coreutils "/bin/nice")))
1212 (substitute* "Makefile"
1213 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1215 (replace 'install ; no install target
1216 (lambda* (#:key outputs #:allow-other-keys)
1217 (for-each (lambda (file)
1218 (install-file file (string-append
1219 (assoc-ref outputs "out")
1221 '("asco" "asco-mpi" "asco-test"
1222 "tools/alter/alter" "tools/log/log"))
1225 `(("mpi" ,openmpi)))
1227 `(("coreutils-minimal" ,coreutils-minimal)))
1228 (home-page "http://asco.sourceforge.net/")
1229 (synopsis "SPICE circuit optimizer")
1231 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1232 high-performance parallel differential evolution (DE) optimization algorithm.")
1233 (license license:gpl2+)))
1235 (define-public libngspice
1236 ;; Note: The ngspice's build system does not allow us to build both the
1237 ;; library and the executables in one go. Thus, we have two packages.
1238 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1244 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1245 version "/ngspice-" version ".tar.gz"))
1248 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1249 (modules '((guix build utils)))
1250 ;; We remove the non-free cider and build without it.
1253 (delete-file-recursively "src/ciderlib")
1254 (delete-file "src/ciderinit")
1255 (substitute* "configure"
1256 (("src/ciderlib/Makefile") "")
1257 (("src/ciderlib/input/Makefile") "")
1258 (("src/ciderlib/support/Makefile") "")
1259 (("src/ciderlib/oned/Makefile") "")
1260 (("src/ciderlib/twod/Makefile") ""))
1262 (build-system gnu-build-system)
1264 `(;; No tests for libngspice exist.
1265 ;; The transient tests for ngspice fail.
1268 (modify-phases %standard-phases
1269 (add-after 'unpack 'patch-timestamps
1271 (substitute* "configure"
1272 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1274 (add-after 'unpack 'delete-program-manuals
1276 (substitute* "man/man1/Makefile.in"
1277 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1280 (add-after 'install 'delete-script-files
1281 (lambda* (#:key outputs #:allow-other-keys)
1282 (delete-file-recursively
1283 (string-append (assoc-ref outputs "out")
1284 "/share/ngspice/scripts")))))
1286 (list "--enable-openmp"
1289 "--with-readline=yes")))
1294 `(("libxaw" ,libxaw)
1296 ("readline" ,readline)))
1297 (home-page "http://ngspice.sourceforge.net/")
1298 (synopsis "Mixed-level/mixed-signal circuit simulator")
1300 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1301 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1302 provides code modeling support and simulation of digital components through
1303 an embedded event driven algorithm.")
1304 (license (list license:lgpl2.0+ ; code in frontend/numparam
1305 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1306 license:public-domain)))) ; xspice
1308 (define-public ngspice
1309 ;; The ngspice executables (see libngpsice above.)
1310 (package (inherit libngspice)
1313 (substitute-keyword-arguments (package-arguments libngspice)
1314 ((#:configure-flags flags)
1315 `(delete "--with-ngshared" ,flags))
1317 `(modify-phases ,phases
1318 (add-after 'unpack 'delete-include-files
1320 (substitute* "src/Makefile.in"
1321 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1322 "SUBDIRS = misc maths frontend spicelib"))
1324 (add-after 'install 'delete-cmpp-dlmain
1325 (lambda* (#:key outputs #:allow-other-keys)
1326 (for-each (lambda (file)
1328 (string-append (assoc-ref outputs "out")
1330 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1332 (delete 'delete-program-manuals)
1333 (delete 'delete-script-files)))))
1335 `(("libngspice" ,libngspice)
1336 ("readline" ,readline)))))
1338 (define trilinos-serial-xyce
1339 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1340 ;; keep it private. See
1341 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1342 ;; TODO: Remove when we have modular Trilinos packages?
1344 (name "trilinos-serial-xyce")
1347 (origin (method url-fetch)
1348 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1349 version "-Source.tar.gz"))
1352 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1353 (build-system cmake-build-system)
1355 `(#:out-of-source? #t
1357 (modify-phases %standard-phases
1358 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1360 (add-before 'validate-runpath 'delete-tribits
1361 (lambda* (#:key outputs #:allow-other-keys)
1362 (delete-file-recursively
1363 (string-append (assoc-ref outputs "out")
1364 "/lib/cmake/tribits"))
1367 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1368 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1369 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1370 "-DTrilinos_ENABLE_NOX=ON"
1371 "-DNOX_ENABLE_LOCA=ON"
1372 "-DTrilinos_ENABLE_EpetraExt=ON"
1373 "-DEpetraExt_BUILD_BTF=ON"
1374 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1375 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1376 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1377 "-DTrilinos_ENABLE_Ifpack=ON"
1378 "-DTrilinos_ENABLE_Isorropia=ON"
1379 "-DTrilinos_ENABLE_AztecOO=ON"
1380 "-DTrilinos_ENABLE_Belos=ON"
1381 "-DTrilinos_ENABLE_Teuchos=ON"
1382 "-DTeuchos_ENABLE_COMPLEX=ON"
1383 "-DTrilinos_ENABLE_Amesos=ON"
1384 "-DAmesos_ENABLE_KLU=ON"
1385 "-DAmesos_ENABLE_UMFPACK=ON"
1386 "-DTrilinos_ENABLE_Sacado=ON"
1387 "-DTrilinos_ENABLE_Kokkos=OFF"
1388 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1389 "-DTPL_ENABLE_AMD=ON"
1390 "-DTPL_ENABLE_UMFPACK=ON"
1391 "-DTPL_ENABLE_BLAS=ON"
1392 "-DTPL_ENABLE_LAPACK=ON")))
1394 `(("fortran" ,gfortran)
1399 ("suitesparse" ,suitesparse)))
1400 (home-page "https://trilinos.org")
1401 (synopsis "Engineering and scientific problems algorithms")
1403 "The Trilinos Project is an effort to develop algorithms and enabling
1404 technologies within an object-oriented software framework for the solution of
1405 large-scale, complex multi-physics engineering and scientific problems. A
1406 unique design feature of Trilinos is its focus on packages.")
1407 (license (list license:lgpl2.1+
1410 (define-public xyce-serial
1412 (name "xyce-serial")
1415 (origin (method url-fetch)
1416 (uri (string-append "https://archive.org/download/Xyce-"
1417 version "/Xyce-" version ".tar.gz"))
1420 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1421 (build-system gnu-build-system)
1426 "CXXFLAGS=-O3 -std=c++11"
1427 (string-append "ARCHDIR="
1428 (assoc-ref %build-inputs "trilinos")))))
1432 ("fortran" ,gfortran)))
1435 ("suitesparse" ,suitesparse)
1437 ("trilinos" ,trilinos-serial-xyce)))
1438 (home-page "https://xyce.sandia.gov/")
1439 (synopsis "High-performance analog circuit simulator")
1441 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1442 capable of solving extremely large circuit problems by supporting large-scale
1443 parallel computing platforms. It also supports serial execution.")
1444 (license license:gpl3+)))
1446 (define trilinos-parallel-xyce
1447 (package (inherit trilinos-serial-xyce)
1448 (name "trilinos-parallel-xyce")
1450 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1451 ((#:configure-flags flags)
1452 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1453 "-DTrilinos_ENABLE_Zoltan=ON"
1454 "-DTPL_ENABLE_MPI=ON")
1458 ,@(package-inputs trilinos-serial-xyce)))))
1460 (define-public xyce-parallel
1461 (package (inherit xyce-serial)
1462 (name "xyce-parallel")
1464 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1465 ((#:configure-flags flags)
1466 `(list "CXXFLAGS=-O3 -std=c++11"
1473 (assoc-ref %build-inputs "trilinos")))))))
1475 `(("mpi" ,openmpi)))
1477 `(("trilinos" ,trilinos-parallel-xyce)
1478 ,@(alist-delete "trilinos"
1479 (package-inputs xyce-serial))))))
1481 (define-public freehdl
1487 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1491 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1492 (build-system gnu-build-system)
1495 (modify-phases %standard-phases
1496 (add-before 'configure 'patch-pkg-config
1497 (lambda* (#:key inputs #:allow-other-keys)
1498 (substitute* "freehdl/freehdl-config"
1500 (string-append (assoc-ref inputs "pkg-config")
1503 (string-append (assoc-ref inputs "coreutils")
1506 (add-after 'patch-pkg-config 'setenv
1507 (lambda* (#:key inputs #:allow-other-keys)
1508 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1510 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1513 (add-after 'setenv 'patch-gvhdl
1515 (substitute* "v2cc/gvhdl.in"
1516 (("--mode=link") "--mode=link --tag=CXX")
1517 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1519 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1520 (lambda* (#:key inputs #:allow-other-keys)
1521 (substitute* "freehdl/freehdl-gennodes.in"
1523 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1524 (("\\(debug") ";(debug")
1525 (("\\(@ ") "(apply-emit")
1526 (("\\(@@ ") "(apply-mini-format"))
1528 (add-after 'configure 'patch-freehdl-pc
1529 (lambda* (#:key inputs #:allow-other-keys)
1530 (substitute* "freehdl.pc"
1532 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1535 (string-append "=" (assoc-ref inputs "libtool")
1538 (add-after 'install-scripts 'make-wrapper
1539 (lambda* (#:key inputs outputs #:allow-other-keys)
1540 (let ((out (assoc-ref outputs "out")))
1541 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1543 (wrap-program (string-append out "/bin/gvhdl")
1544 `("CPLUS_INCLUDE_PATH" ":" prefix
1545 (,(string-append (assoc-ref inputs "gcc-toolchain")
1547 `("LIBRARY_PATH" ":" prefix
1548 (,(string-append (assoc-ref inputs "gcc-toolchain")
1551 (,(string-append (assoc-ref inputs "gcc-toolchain")
1553 ,(string-append (assoc-ref inputs "coreutils")
1555 (wrap-program (string-append out "/bin/freehdl-config")
1556 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1559 `(("coreutils" ,coreutils)
1560 ("gcc-toolchain" ,gcc-toolchain)
1561 ("guile" ,guile-2.2)
1563 ("pkg-config" ,pkg-config)
1564 ("libtool" ,libtool)))
1566 `(("pkg-config-native" ,pkg-config)
1567 ("libtool-native" ,libtool)))
1568 (home-page "http://www.freehdl.seul.org/")
1569 (synopsis "VHDL simulator")
1571 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1572 VHDL'93 as well as VHDL'87 standards are supported.")
1573 (license (list license:gpl2+
1574 license:lgpl2.0+)))) ; freehdl's libraries
1577 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1578 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1579 ;; comment and update the package.
1580 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1584 (version (git-version "0.0.19" revision commit))
1588 (url "https://github.com/Qucs/qucs")
1591 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1592 (file-name (string-append name "-" version "-checkout"))))
1593 (build-system gnu-build-system)
1596 (modify-phases %standard-phases
1597 (add-before 'bootstrap 'patch-bootstrap
1599 (for-each patch-shebang
1602 "qucs-doc/bootstrap"
1603 "qucs-core/bootstrap"))
1605 (add-before 'configure 'patch-configure
1606 (lambda* (#:key inputs #:allow-other-keys)
1607 (substitute* "qucs/configure"
1608 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1610 (add-after 'patch-configure 'patch-scripts
1611 (lambda* (#:key inputs outputs #:allow-other-keys)
1612 (substitute* '("qucs/qucs/qucsdigi"
1613 "qucs/qucs/qucsdigilib"
1614 "qucs/qucs/qucsveri")
1616 (string-append (assoc-ref outputs "out") "/bin"))
1618 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1620 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1622 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1624 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1626 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1628 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1630 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1632 (add-before 'check 'pre-check
1634 ;; The test suite requires a running X server.
1635 (system "Xvfb :1 &")
1636 (setenv "DISPLAY" ":1")
1638 (add-after 'install 'make-wrapper
1639 (lambda* (#:key inputs outputs #:allow-other-keys)
1640 (let ((out (assoc-ref outputs "out")))
1641 ;; 'qucs' directly invokes gcc, hence this wrapping.
1642 (wrap-program (string-append out "/bin/qucs")
1643 `("CPLUS_INCLUDE_PATH" ":" prefix
1644 (,(string-append (assoc-ref inputs "gcc-toolchain")
1647 (,(string-append (assoc-ref inputs "gcc-toolchain")
1649 `("LIBRARY_PATH" ":" prefix
1650 (,(string-append (assoc-ref inputs "gcc-toolchain")
1652 `("ADMSXMLBINDIR" ":" prefix
1653 (,(string-append (assoc-ref inputs "adms") "/bin")))
1654 `("ASCOBINDIR" ":" prefix
1655 (,(string-append (assoc-ref inputs "asco") "/bin")))
1656 `("QUCS_OCTAVE" ":" prefix
1657 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1659 #:parallel-build? #f ; race condition
1660 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1662 `(("autoconf" ,autoconf)
1663 ("automake" ,automake)
1667 ("libtool-native" ,libtool)
1668 ("pkg-config" ,pkg-config)
1669 ("python" ,python-2) ; for tests
1670 ("matplotlib" ,python2-matplotlib) ; for tests
1671 ("numpy" ,python2-numpy) ; for tests
1672 ("xorg-server" ,xorg-server))) ; for tests
1676 ("coreutils" ,coreutils)
1677 ("freehdl" ,freehdl)
1678 ("gcc-toolchain" ,gcc-toolchain)
1679 ("iverilog" ,iverilog)
1680 ("libtool" ,libtool)
1684 (home-page "http://qucs.sourceforge.net/")
1685 (synopsis "Circuit simulator with graphical user interface")
1687 "Qucs is a circuit simulator with graphical user interface. The software
1688 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1689 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1690 simulations are also supported.")
1691 (license license:gpl2+))))
1693 (define-public qucs-s
1699 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1701 (file-name (string-append name "-" version ".tar.gz"))
1704 "01dizf4rjciqc8x7bmv3kbhdlz90bm6n9m9fz7dbzqcwvszcs1hx"))))
1705 (build-system cmake-build-system)
1707 `(#:tests? #f ; no tests
1709 (modify-phases %standard-phases
1710 (add-before 'configure 'patch-scripts
1711 (lambda* (#:key inputs #:allow-other-keys)
1712 (substitute* '("qucs/qucsdigi"
1716 (string-append (assoc-ref inputs "qucs") "/bin"))
1718 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1720 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1722 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1724 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1726 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1728 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1730 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1732 (add-after 'patch-scripts 'patch-paths
1733 (lambda* (#:key inputs #:allow-other-keys)
1734 (substitute* "qucs/main.cpp"
1735 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1736 "\\+ \"qucsator\" \\+ executableSuffix"))
1737 (string-append "}{ QucsSettings.Qucsator = \""
1738 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1739 (((string-append "QucsSettings\\.XyceExecutable = "
1740 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1741 (string-append "}{ QucsSettings.XyceExecutable = \""
1742 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1743 (((string-append "else QucsSettings\\.XyceParExecutable = "
1744 "\"mpirun -np %p /usr/local"
1745 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1746 (string-append "QucsSettings.XyceParExecutable = \""
1747 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1748 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1749 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1750 (string-append "QucsSettings.NgspiceExecutable = " "\""
1751 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1752 (substitute* "qucs/extsimkernels/ngspice.cpp"
1753 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1754 (substitute* "qucs/qucs_actions.cpp"
1756 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1758 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1760 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1762 (add-after 'install 'install-scripts
1763 (lambda* (#:key inputs outputs #:allow-other-keys)
1766 (let ((file (string-append "../qucs_s-" ,version
1768 (out (assoc-ref outputs "out")))
1769 (install-file file (string-append out "/bin"))
1770 (chmod (string-append out "/bin/" script) #o555)))
1771 '("qucsdigi" "qucsdigilib" "qucsveri"))
1773 (add-after 'install-scripts 'make-wrapper
1774 (lambda* (#:key inputs outputs #:allow-other-keys)
1775 (let* ((out (assoc-ref outputs "out"))
1776 (file (string-append out "/bin/qucs-s"))
1777 (qucs (assoc-ref inputs "qucs"))
1778 (qucsator (string-append qucs "/bin/qucsator")))
1780 `("CPLUS_INCLUDE_PATH" ":" prefix
1781 (,(string-append (assoc-ref inputs "gcc-toolchain")
1784 (,(string-append (assoc-ref inputs "gcc-toolchain")
1786 `("LIBRARY_PATH" ":" prefix
1787 (,(string-append (assoc-ref inputs "gcc-toolchain")
1789 `("QUCSATOR" ":" prefix (,qucsator))
1790 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1791 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1793 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1795 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1797 (symlink qucsator (string-append out "/bin/qucsator"))
1800 `(("libtool-native" ,libtool)))
1804 ("coreutils" ,coreutils)
1805 ("freehdl" ,freehdl)
1806 ("gcc-toolchain" ,gcc-toolchain)
1807 ("iverilog" ,iverilog)
1808 ("libtool" ,libtool)
1810 ("ngspice" ,ngspice)
1815 ("xyce-serial" ,xyce-serial)
1816 ("xyce-parallel" ,xyce-parallel)))
1817 (home-page "https://ra3xdh.github.io/")
1818 (synopsis "Circuit simulator with graphical user interface")
1820 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1821 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1822 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1823 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1824 (license license:gpl2+)))