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, 2018 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>
12 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
14 ;;; This file is part of GNU Guix.
16 ;;; GNU Guix is free software; you can redistribute it and/or modify it
17 ;;; under the terms of the GNU General Public License as published by
18 ;;; the Free Software Foundation; either version 3 of the License, or (at
19 ;;; your option) any later version.
21 ;;; GNU Guix is distributed in the hope that it will be useful, but
22 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 ;;; GNU General Public License for more details.
26 ;;; You should have received a copy of the GNU General Public License
27 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29 (define-module (gnu packages engineering)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix gexp)
33 #:use-module (guix git-download)
34 #:use-module (guix monads)
35 #:use-module (guix store)
36 #:use-module (guix utils)
37 #:use-module ((srfi srfi-1) #:hide (zip))
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system python)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages algebra)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages base)
46 #:use-module (gnu packages bison)
47 #:use-module (gnu packages boost)
48 #:use-module (gnu packages check)
49 #:use-module (gnu packages commencement)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages curl)
52 #:use-module (gnu packages flex)
53 #:use-module (gnu packages fontutils)
54 #:use-module (gnu packages fpga)
55 #:use-module (gnu packages freedesktop)
56 #:use-module (gnu packages gcc)
57 #:use-module (gnu packages gd)
58 #:use-module (gnu packages gettext)
59 #:use-module (gnu packages ghostscript)
60 #:use-module (gnu packages gl)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gnome)
63 #:use-module (gnu packages gperf)
64 #:use-module (gnu packages groff)
65 #:use-module (gnu packages gtk)
66 #:use-module (gnu packages guile)
67 #:use-module (gnu packages image)
68 #:use-module (gnu packages imagemagick)
69 #:use-module (gnu packages linux) ;FIXME: for pcb
70 #:use-module (gnu packages m4)
71 #:use-module (gnu packages maths)
72 #:use-module (gnu packages multiprecision)
73 #:use-module (gnu packages mpi)
74 #:use-module (gnu packages ncurses)
75 #:use-module (gnu packages perl)
76 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages python)
78 #:use-module (gnu packages qt)
79 #:use-module (gnu packages readline)
80 #:use-module (gnu packages swig)
81 #:use-module (gnu packages tcl)
82 #:use-module (gnu packages texinfo)
83 #:use-module (gnu packages tls)
84 #:use-module (gnu packages tex)
85 #:use-module (gnu packages wxwidgets)
86 #:use-module (gnu packages xorg))
88 (define-public librecad
95 "https://github.com/LibreCAD/LibreCAD/archive/"
97 (file-name (string-append name "-" version ".tar.gz"))
100 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
101 (build-system gnu-build-system)
104 (modify-phases %standard-phases
105 ;; Without this patch boost complains that "make_array" is not a
106 ;; member of "boost::serialization".
107 (add-after 'unpack 'patch-boost-error
109 (substitute* "librecad/src/lib/math/lc_quadratic.h"
110 (("#include \"rs_vector.h\"" line)
112 "\n#include <boost/serialization/array_wrapper.hpp>")))
113 (substitute* "librecad/src/lib/math/rs_math.cpp"
114 (("#include <boost/numeric/ublas/matrix.hpp>" line)
115 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
118 ;; Fix build against Qt 5.11.
119 (add-after 'unpack 'add-missing-headers
121 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
122 (("#include <QPushButton>") "#include <QPushButton>
123 #include <QActionGroup>"))
125 (add-after 'unpack 'patch-paths
126 (lambda* (#:key outputs #:allow-other-keys)
127 (let ((out (assoc-ref outputs "out")))
128 (substitute* "librecad/src/lib/engine/rs_system.cpp"
129 (("/usr/share") (string-append out "/share"))))))
131 (lambda* (#:key inputs #:allow-other-keys)
132 (system* "qmake" (string-append "BOOST_DIR="
133 (assoc-ref inputs "boost")))))
135 (lambda* (#:key outputs #:allow-other-keys)
136 (let* ((out (assoc-ref outputs "out"))
137 (bin (string-append out "/bin"))
138 (share (string-append out "/share/librecad")))
140 (install-file "unix/librecad" bin)
142 (copy-recursively "unix/resources" share))
144 ;; Ensure that icons are found at runtime
145 (add-after 'install 'wrap-executable
146 (lambda* (#:key inputs outputs #:allow-other-keys)
147 (let* ((out (assoc-ref outputs "out"))
148 (qt '("qtbase" "qtsvg")))
149 (wrap-program (string-append out "/bin/librecad")
150 `("QT_PLUGIN_PATH" ":" prefix
151 ,(map (lambda (label)
152 (string-append (assoc-ref inputs label)
153 "/lib/qt5/plugins/"))
158 ("muparser" ,muparser)
159 ("freetype" ,freetype)
163 `(("pkg-config" ,pkg-config)
165 (home-page "http://librecad.org/")
166 (synopsis "Computer-aided design (CAD) application")
168 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
170 (license license:gpl2)))
172 (define-public geda-gaf
179 "http://ftp.geda-project.org/geda-gaf/unstable/v"
180 (version-major+minor version) "/"
181 version "/geda-gaf-" version ".tar.gz"))
184 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
185 (build-system gnu-build-system)
188 (modify-phases %standard-phases
189 ;; tests require a writable HOME
190 (add-before 'check 'set-home
192 (setenv "HOME" (getenv "TMPDIR"))
194 ;; FIXME: These two tests fail for unknown reasons. They return "2"
195 ;; when they should return "1".
196 (add-after 'unpack 'disable-failing-tests
198 (substitute* "utils/tests/gxyrs/tests.list"
199 (("^do_nothing.*") ""))
202 (let ((pcb (assoc-ref %build-inputs "pcb")))
203 (list (string-append "--with-pcb-datadir=" pcb "/share")
204 (string-append "--with-pcb-lib-path="
205 pcb "/share/pcb/pcblib-newlib:"
206 pcb "/share/pcb/newlib")))))
211 ("desktop-file-utils" ,desktop-file-utils)
212 ("shared-mime-info" ,shared-mime-info)
216 `(("pkg-config" ,pkg-config)
217 ("perl" ,perl))) ; for tests
218 (home-page "http://geda-project.org/")
219 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
221 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
222 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
223 which currently includes: gschem, a schematic capture program; gnetlist, a
224 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
225 gattrib, a spreadsheet programm that manipulates the properties of symbols of
226 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
227 tool to forward annotation from your schematic to layout using PCB; some minor
229 (license license:gpl2+)))
231 (define-public lepton-eda
232 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
233 ;; keep and to extend Guile support.
237 (version "1.9.5-20180820")
238 (home-page "https://github.com/lepton-eda/lepton-eda")
241 (uri (git-reference (url home-page) (commit version)))
244 "1ayaccvw18zh4g7a4x5jf6yxkphi5xafb0hpc732g59qkgwfcmlr"))
245 (file-name (git-file-name name version))))
247 `(("autoconf" ,autoconf)
248 ("automake" ,automake)
250 ("gettext" ,gnu-gettext)
254 ,@(package-native-inputs geda-gaf)))
255 ;; For now it's Guile 2.0, not 2.2.
257 (substitute-keyword-arguments (package-arguments geda-gaf)
258 ((#:configure-flags flags ''())
259 ;; When running "make", the POT files are built with the build time as
260 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
261 ;; files were updated and goes on to run "msgmerge"; as a result, the
262 ;; non-deterministic POT-Creation-Date finds its way into .po files,
263 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
264 ;; never runs. See <https://bugs.debian.org/792687>.
265 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
266 ((#:phases phases '%standard-phases)
267 `(modify-phases ,phases
268 (add-before 'bootstrap 'prepare
270 ;; Some of the scripts there are invoked by autogen.sh.
271 (for-each patch-shebang (find-files "build-tools"))
273 ;; Make sure 'msgmerge' can modify the PO files.
274 (for-each (lambda (po)
276 (find-files "." "\\.po$"))
278 ;; This would normally be created by invoking 'git', but it
279 ;; doesn't work here.
280 (call-with-output-file "version.h"
282 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
283 ,(string-drop version
284 (+ 1 (string-index version #\-))))
285 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
286 ,(string-take version
287 (string-index version #\-)))
288 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
291 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
292 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
293 design, schematic capture, simulation, prototyping, and production. Lepton
294 EDA includes tools for schematic capture, attribute management, bill of
295 materials (BOM) generation, netlisting into over 20 netlist formats, analog
296 and digital simulation, and printed circuit board (PCB) layout, and many other
305 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
306 "/pcb-" version ".tar.gz"))
309 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
310 (build-system gnu-build-system)
313 (modify-phases %standard-phases
314 (add-after 'unpack 'use-wish8.6
316 (substitute* "configure"
317 (("wish85") "wish8.6"))
319 ;; It checks for "xhost", which we don't have. This shouldn't
320 ;; matter, because the test is supposed to be skipped, but it causes
321 ;; "run_tests.sh" (and thus the "check" phase) to fail.
322 (add-after 'unpack 'fix-check-for-display
324 (substitute* "tests/run_tests.sh"
325 (("have_display=no") "have_display=yes"))
327 (add-after 'install 'wrap
328 (lambda* (#:key inputs outputs #:allow-other-keys)
329 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
330 ;; fix of the mesa package we wrap the pcb executable such that
331 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
332 (let* ((out (assoc-ref outputs "out"))
333 (path (string-append (assoc-ref inputs "udev") "/lib")))
334 (wrap-program (string-append out "/bin/pcb")
335 `("LD_LIBRARY_PATH" ":" prefix (,path))))
337 (add-before 'check 'pre-check
340 (setenv "DISPLAY" ":1")
345 ("udev" ,eudev) ;FIXME: required by mesa
349 ("gtkglext" ,gtkglext)
350 ("desktop-file-utils" ,desktop-file-utils)
351 ("shared-mime-info" ,shared-mime-info)
354 `(("pkg-config" ,pkg-config)
355 ("intltool" ,intltool)
359 ("imagemagick" ,imagemagick)
361 ("ghostscript" ,ghostscript)
362 ("xvfb" ,xorg-server)))
363 (home-page "http://pcb.geda-project.org/")
364 (synopsis "Design printed circuit board layouts")
366 "GNU PCB is an interactive tool for editing printed circuit board
367 layouts. It features a rats-nest implementation, schematic/netlist import,
368 and design rule checking. It also includes an autorouter and a trace
369 optimizer; and it can produce photorealistic and design review images.")
370 (license license:gpl2+)))
372 (define-public pcb-rnd
373 (package (inherit pcb)
378 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
379 "pcb-rnd-" version ".tar.gz"))
382 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
384 `(#:tests? #f ; no check target
386 (modify-phases %standard-phases
387 (add-after 'unpack 'cc-is-gcc
388 (lambda _ (setenv "CC" "gcc") #t))
390 ;; The configure script doesn't tolerate most of our configure flags.
391 (lambda* (#:key outputs #:allow-other-keys)
392 (zero? (system* "sh" "configure"
393 (string-append "--prefix="
394 (assoc-ref outputs "out")))))))))
395 (home-page "http://repo.hu/projects/pcb-rnd/")
396 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
397 featuring various improvements and bug fixes.")))
399 (define-public fastcap
402 (version "2.0-18Sep92")
404 (method url-fetch/tarbomb)
405 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
406 name "-" version ".tgz"))
409 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
411 ;; Remove a non-free file.
413 (delete-file "doc/psfig.sty")
415 (patches (search-patches "fastcap-mulSetup.patch"
416 "fastcap-mulGlobal.patch"))))
417 (build-system gnu-build-system)
419 ;; FIXME: with texlive-tiny citation references are rendered as question
420 ;; marks. During the build warnings like these are printed:
421 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
422 `(("texlive" ,texlive-tiny)
423 ("ghostscript" ,ghostscript)))
425 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
427 #:tests? #f ;; no tests-suite
428 #:modules ((srfi srfi-1)
429 ,@%gnu-build-system-modules)
431 (modify-phases %standard-phases
432 (add-after 'build 'make-doc
434 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
436 (add-before 'make-doc 'fix-doc
438 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
439 (substitute* (find-files "doc" "\\.tex")
440 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
442 (string-append "\\includegraphics[scale=" scale "]{"
444 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
446 (string-append "\\includegraphics[width=" width "]{"
448 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
450 (string-append "\\includegraphics[height=" height "]{"
452 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
453 (string-append "\\includegraphics{" file "}")))
454 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
455 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
457 (string-append "\\documentclass[" options "]{"
459 "\\usepackage{graphicx}\n"
460 "\\usepackage{robinspace}"))
461 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
462 (string-append "%" all))
463 (("\\\\setstretch\\{.*\\}" all)
464 (string-append "%" all)))
467 (add-before 'install 'clean-bin
469 (delete-file (string-append (getcwd) "/bin/README"))
471 (add-before 'install 'make-pdf
473 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
474 (with-directory-excursion "doc"
476 (every (lambda (file)
477 (zero? (system* "dvips" file "-o")))
478 (find-files "." "\\.dvi"))
479 (every (lambda (file)
480 (zero? (system* "ps2pdf" file)))
481 '("mtt.ps" "ug.ps" "tcad.ps"))
482 (zero? (system* "make" "clean"))))))
484 (lambda* (#:key outputs #:allow-other-keys)
485 (let* ((out (assoc-ref outputs "out"))
486 (data (string-append out "/share"))
487 (bin (string-append out "/bin"))
488 (doc (string-append data "/doc/" ,name "-" ,version))
489 (examples (string-append doc "/examples")))
490 (with-directory-excursion "bin"
491 (for-each (lambda (f)
492 (install-file f bin))
493 (find-files "." ".*")))
494 (copy-recursively "doc" doc)
495 (copy-recursively "examples" examples)
497 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
498 (synopsis "Multipole-accelerated capacitance extraction program")
500 "Fastcap is a capacitance extraction program based on a
501 multipole-accelerated algorithm.")
502 (license (license:non-copyleft #f "See fastcap.c."))))
504 (define-public fasthenry
507 (version "3.0-12Nov96")
510 (file-name (string-append name "-" version ".tar.gz"))
512 "http://www.rle.mit.edu/cpg/codes/" name
513 "-" version ".tar.z"))
515 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
516 (patches (search-patches "fasthenry-spAllocate.patch"
517 "fasthenry-spBuild.patch"
518 "fasthenry-spUtils.patch"
519 "fasthenry-spSolve.patch"
520 "fasthenry-spFactor.patch"))))
521 (build-system gnu-build-system)
523 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
525 #:tests? #f ;; no tests-suite
526 #:modules ((srfi srfi-1)
527 ,@%gnu-build-system-modules)
529 (modify-phases %standard-phases
532 (lambda* (#:key outputs #:allow-other-keys)
533 (let* ((out (assoc-ref outputs "out"))
534 (data (string-append out "/share"))
535 (bin (string-append out "/bin"))
536 (doc (string-append data "/doc/" ,name "-" ,version))
537 (examples (string-append doc "/examples")))
538 (with-directory-excursion "bin"
539 (for-each (lambda (f)
540 (install-file f bin))
541 (find-files "." ".*")))
542 (copy-recursively "doc" doc)
543 (copy-recursively "examples" examples)
545 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
546 (synopsis "Multipole-accelerated inductance analysis program")
548 "Fasthenry is an inductance extraction program based on a
549 multipole-accelerated algorithm.")
550 (license (license:non-copyleft #f "See induct.c."))))
552 (define-public fritzing
558 (uri (string-append "https://github.com/fritzing/"
559 "fritzing-app/archive/" version ".tar.gz"))
560 (file-name (string-append name "-" version ".tar.gz"))
563 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
564 (build-system gnu-build-system)
567 (modify-phases %standard-phases
569 (lambda* (#:key inputs outputs #:allow-other-keys)
570 (and (zero? (system* "tar"
571 "-xvf" (assoc-ref inputs "fritzing-parts-db")
573 (zero? (system* "qmake"
574 (string-append "PREFIX="
575 (assoc-ref outputs "out"))
576 "phoenix.pro"))))))))
579 ("qtserialport" ,qtserialport)
586 (uri (string-append "https://github.com/fritzing/"
587 "fritzing-parts/archive/" version ".tar.gz"))
588 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
591 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
592 (home-page "http://fritzing.org")
593 (synopsis "Electronic circuit design")
595 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
596 software with a low entry barrier, suited for the needs of makers and
597 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
598 library with many commonly used high-level components. Fritzing makes it very
599 easy to communicate about circuits, as well as to turn them into PCB layouts
600 ready for production.")
601 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
602 ;; released under GPLv3+.
603 (license (list license:gpl3+ license:cc-by-sa3.0))))
611 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
612 version "/gerbv-" version ".tar.gz"))
615 "1cw8k6ni0q8kswad03kha86fk7n06vq8p0wzsfhcnalsdshrn17i"))))
616 (build-system gnu-build-system)
618 `(("pkg-config" ,pkg-config)))
622 ("desktop-file-utils" ,desktop-file-utils)))
623 (home-page "http://gerbv.geda-project.org/")
624 (synopsis "Gerber file viewer")
626 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
627 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
628 you load several files on top of each other, do measurements on the displayed
629 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
630 as well as pick-place files.")
631 (license license:gpl2+)))
633 (define-public libfive
634 (let ((commit "9d857d1923abecb0e5935b9287d22661f6efaac5")
638 (version (git-version "0" revision commit))
642 (url "https://github.com/libfive/libfive")
646 "1r40kyx30wz31cwwlfvfh7fgqkxq3n8dxhswpi9qpf4r5h3l8wsn"))
647 (file-name (git-file-name name version))
649 ;; Remove bundled catch since we provide our own.
651 (delete-file "libfive/test/catch.hpp")
653 (build-system cmake-build-system)
655 `(#:test-target "libfive-test"
657 (modify-phases %standard-phases
658 (add-after 'unpack 'remove-native-compilation
660 (substitute* "CMakeLists.txt" (("-march=native") ""))
663 `(("pkg-config" ,pkg-config)))
666 ("catch" ,catch-framework)
670 ("guile" ,guile-2.2)))
671 (home-page "https://libfive.com")
672 (synopsis "Tool for programmatic computer-aided design")
674 "Libfive is a tool for programmatic computer-aided design (CAD). In
675 libfive, solid models are defined as Scheme scripts, and there are no opaque
676 function calls into the geometry kernel: everything is visible to the user.
677 Even fundamental, primitive shapes are represented as code in the user-level
679 (license (list license:lgpl2.1+ ;library
680 license:gpl2+))))) ;Guile bindings and GUI
683 (deprecated-package "ao-cad" libfive))
692 (file-name (string-append name "-" version ".tar.xz"))
694 "https://launchpad.net/kicad/" (version-major+minor version)
695 "/" version "/+download/" name "-" version ".tar.xz"))
697 (base32 "17nqjszyvd25wi6550j981whlnb1wxzmlanljdjihiki53j84x9p"))))
698 (build-system cmake-build-system)
700 `(#:out-of-source? #t
701 #:tests? #f ; no tests
702 #:build-type "Release"
704 (list "-DKICAD_STABLE_VERSION=ON"
705 "-DKICAD_REPO_NAME=stable"
706 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
707 "-DKICAD_SCRIPTING=ON"
708 "-DKICAD_SCRIPTING_MODULES=ON"
709 "-DKICAD_SCRIPTING_WXPYTHON=ON"
710 ;; Has to be set explicitely, as we don't have the wxPython
711 ;; headers in the wxwidgets store item, but in wxPython.
712 (string-append "-DCMAKE_CXX_FLAGS=-I"
713 (assoc-ref %build-inputs "wxpython")
715 ,(version-major+minor
716 (package-version python2-wxpython)))
717 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
719 ;; TODO: Enable this when CA certs are working with curl.
720 "-DBUILD_GITHUB_PLUGIN=OFF")
722 (modify-phases %standard-phases
723 (add-after 'unpack 'adjust-boost-include
725 ;; The location of this header changed in Boost 1.66.
726 (substitute* "3d-viewer/3d_cache/3d_cache.cpp"
727 (("boost/uuid/sha1\\.hpp")
728 "boost/uuid/detail/sha1.hpp"))
730 (add-after 'install 'wrap-program
731 ;; Ensure correct Python at runtime.
732 (lambda* (#:key inputs outputs #:allow-other-keys)
733 (let* ((out (assoc-ref outputs "out"))
734 (python (assoc-ref inputs "python"))
735 (file (string-append out "/bin/kicad"))
739 ,(version-major+minor
740 (package-version python))
742 (getenv "PYTHONPATH"))))
744 `("PYTHONPATH" ":" prefix (,path))
746 (,(string-append python "/bin:")))))
750 ("gettext" ,gnu-gettext)
751 ("pkg-config" ,pkg-config)
757 ("desktop-file-utils" ,desktop-file-utils)
760 ("hicolor-icon-theme" ,hicolor-icon-theme)
761 ("libngspice" ,libngspice)
764 ("opencascade-oce" ,opencascade-oce)
767 ("wxwidgets" ,wxwidgets-gtk2)
768 ("wxpython" ,python2-wxpython)))
769 (home-page "http://kicad-pcb.org/")
770 (synopsis "Electronics Design Automation Suite")
771 (description "Kicad is a program for the formation of printed circuit
772 boards and electrical circuits. The software has a number of programs that
773 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
774 electrical diagrams), gerbview (viewing Gerber files) and others.")
775 (license license:gpl3+)))
777 (define-public kicad-library
778 (let ((version "4.0.7"))
780 (name "kicad-library")
785 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
789 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
790 (build-system cmake-build-system)
792 `(#:out-of-source? #t
793 #:tests? #f ; no tests
795 (modify-phases %standard-phases
796 (add-after 'install 'install-footprints ; from footprints tarball
797 (lambda* (#:key inputs outputs #:allow-other-keys)
799 (assoc-ref inputs "kicad-footprints")
800 "-C" (string-append (assoc-ref outputs "out")
801 "/share/kicad/modules")
802 "--strip-components=1")))
803 ;; We change the default global footprint file, which is generated if
804 ;; it doesn't exist in user's home directory, from the one using the
805 ;; github plugin, to the one using the KISYSMOD environment path.
806 (add-after 'install-footprints 'use-pretty-footprint-table
807 (lambda* (#:key outputs #:allow-other-keys)
808 (let* ((out (assoc-ref outputs "out"))
809 (template-dir (string-append out "/share/kicad/template"))
810 (fp-lib-table (string-append template-dir "/fp-lib-table")))
811 (delete-file fp-lib-table)
812 (copy-file (string-append fp-lib-table ".for-pretty")
816 (list (search-path-specification
817 (variable "KISYSMOD") ; footprint path
818 (files '("share/kicad/modules")))
819 (search-path-specification
820 (variable "KISYS3DMOD") ; 3D model path
821 (files '("share/kicad/modules/packages3d")))))
822 ;; Kicad distributes footprints in a separate tarball.
824 `(("kicad-footprints"
828 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
832 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
833 (home-page "http://kicad-pcb.org/")
834 (synopsis "Libraries for kicad")
835 (description "This package provides Kicad component, footprint and 3D
836 render model libraries.")
837 (license license:lgpl2.0+))))
839 (define-public kicad-symbols
841 (name "kicad-symbols")
846 (url "https://github.com/KiCad/kicad-symbols.git")
848 (file-name (string-append "kicad-symbols-" version "-checkout"))
851 "18z5vpdq7hy2mpvm5vz1dz3ra3a5iybavvlzi8q2bmmdb6gsvf64"))))
852 (build-system cmake-build-system)
854 `(#:tests? #f)) ; No tests exist
855 (home-page "http://kicad-pcb.org/")
856 (synopsis "Official KiCad schematic symbol libraries for KiCad 5")
857 (description "This package contains the official KiCad schematic symbol
858 libraries for KiCad 5.")
859 ;; TODO: Exception: "To the extent that the creation of electronic designs that use 'Licensed Material' can be considered to be 'Adapted Material', then the copyright holder waives article 3 of the license with respect to these designs and any generated files which use data provided as part of the 'Licensed Material'."
860 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
861 (license license:cc-by-sa4.0)))
863 (define-public linsmith
870 "mirror://sourceforge/linsmith/linsmith/linsmith-"
871 version "/linsmith-" version ".tar.gz"))
874 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
875 (build-system gnu-build-system)
877 `(("pkg-config" ,pkg-config)
879 ("libgnome" ,libgnomeui)))
880 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
881 (synopsis "Smith Charting program")
882 (description "LinSmith is a Smith Charting program, mainly designed for
883 educational use. As such, there is an emphasis on capabilities that improve
884 the 'showing the effect of'-style of operation.")
885 (license license:gpl2+)))
894 (uri (string-append "http://libvolk.org/releases/volk-"
898 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
899 (build-system cmake-build-system)
903 `(("python-2" ,python-2)
904 ("python2-cheetah" ,python2-cheetah)))
905 (home-page "http://libvolk.org/")
906 (synopsis "Vector-Optimized Library of Kernels")
908 "@code{volk} contains procedures with machine-specific optimizations
909 for mathematical functions. It also provides an machine-independent
910 interface to select the best such procedures to use on a given system.")
911 (license license:gpl3+)))
913 (define-public minicom
920 (uri (string-append "https://alioth.debian.org/frs/download.php/"
921 "file/4215/" name "-" version ".tar.gz"))
924 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
925 (build-system gnu-build-system)
927 `(#:configure-flags '("--enable-lock-dir=/var/lock")
929 (modify-phases %standard-phases
930 (add-after 'unpack 'patch-lock-check
932 (substitute* "configure"
933 (("test -d [$]UUCPLOCK") "true"))
936 `(("ncurses" ,ncurses)))
937 (home-page "https://alioth.debian.org/projects/minicom/")
938 (synopsis "Serial terminal emulator")
939 (description "@code{minicom} is a serial terminal emulator.")
940 (license license:gpl2+)))
942 (define-public harminv
949 (string-append "https://github.com/stevengj/harminv/"
950 "releases/download/v" version "/"
951 name "-" version ".tar.gz"))
954 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
955 (build-system gnu-build-system)
958 (modify-phases %standard-phases
959 (add-before 'configure 'fix-tests
961 (substitute* "./sines-test.sh"
962 ; change test frequency range - default fails
966 `(("fortran" ,gfortran)))
968 `(("lapack" ,lapack)))
969 (home-page "https://github.com/stevengj/harminv")
970 (synopsis "Harmonic inversion solver")
972 "Harminv is a free program (and accompanying library) to solve the problem of
973 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
974 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
975 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
976 (license license:gpl2+)))
978 (define-public guile-libctl
980 (name "guile-libctl")
986 "http://ab-initio.mit.edu/libctl/libctl-"
990 "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
991 (build-system gnu-build-system)
993 `(("fortran" ,gfortran)))
995 `(("guile" ,guile-2.2)))
996 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
997 (synopsis "Flexible control files implementation for scientific simulations")
999 "Libctl is a Guile-based library implementing flexible control files
1000 for scientific simulations.")
1001 (license license:gpl2+)))
1011 "http://ab-initio.mit.edu/mpb/mpb-"
1015 "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
1016 (build-system gnu-build-system)
1019 (list (string-append "--with-libctl="
1020 (assoc-ref %build-inputs "libctl")
1023 `(("fortran" ,gfortran)
1024 ("pkg-config" ,pkg-config)
1029 ("guile" ,guile-2.2)
1032 ("libctl" ,guile-libctl)
1033 ("readline" ,readline)
1035 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1036 (synopsis "Computes band structures and electromagnetic modes of dielectric
1039 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1040 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1041 fully-vectorial and three-dimensional methods.")
1042 (license license:gpl2+)))
1052 "http://ab-initio.mit.edu/meep/meep-"
1056 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
1057 (build-system gnu-build-system)
1060 (list (string-append "--with-libctl="
1061 (assoc-ref %build-inputs "libctl")
1064 `(("fortran" ,gfortran)
1065 ("pkg-config" ,pkg-config)
1070 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
1071 ("harminv" ,harminv)
1074 ("libctl" ,guile-libctl)
1077 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1078 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1080 "Meep is a finite-difference time-domain (FDTD) simulation software package
1081 developed at MIT to model electromagnetic systems.")
1082 (license license:gpl2+)))
1092 "mirror://sourceforge/mot-adms/adms-source/"
1093 (version-major+minor version) "/adms-" version ".tar.gz"))
1096 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1097 (build-system gnu-build-system)
1101 (home-page "https://sourceforge.net/projects/mot-adms")
1102 (synopsis "Automatic device model synthesizer")
1104 "ADMS is a code generator that converts electrical compact device models
1105 specified in high-level description language into ready-to-compile C code for
1106 the API of spice simulators. Based on transformations specified in XML
1107 language, ADMS transforms Verilog-AMS code into other target languages.")
1108 (license license:gpl3)))
1110 (define-public capstone
1116 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1118 (file-name (string-append name "-" version ".tar.gz"))
1121 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
1122 (build-system gnu-build-system)
1125 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1128 (modify-phases %standard-phases
1129 (delete 'configure) ; no configure script
1130 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1131 (add-before 'build 'fix-cstool-ldflags
1132 (lambda* (#:key outputs #:allow-other-keys)
1133 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1134 (assoc-ref outputs "out") "/lib"))
1136 (home-page "https://www.capstone-engine.org")
1137 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1139 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1140 framework. Capstone can disassemble machine code for many supported architectures
1141 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1142 bindings for Python, Java, OCaml and more.")
1143 (license license:bsd-3)))
1145 ;; FIXME: This package has a timestamp embedded in
1146 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1147 (define-public python-capstone
1150 (name "python-capstone")
1152 `(("capstone" ,capstone)))
1153 (build-system python-build-system)
1156 (modify-phases %standard-phases
1157 (add-after 'unpack 'chdir-and-fix-setup-py
1159 (chdir "bindings/python")
1160 ;; Do not build the library again, because we already have it.
1161 (substitute* "setup.py" ((".* build_libraries.*") ""))
1162 ;; This substitution tells python-capstone where to find the
1164 (substitute* "capstone/__init__.py"
1165 (("pkg_resources.resource_filename.*")
1166 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1169 (define-public python2-capstone
1170 (package-with-python2 python-capstone))
1172 (define-public radare2
1178 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1179 name "-" version ".tar.gz"))
1182 "17h4ba5qqahfi8mi4x2dcvq87cqpir5v2dlaqbvmay6vby4zh4v7"))
1183 (modules '((guix build utils)))
1186 (substitute* "libr/asm/p/Makefile"
1187 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1188 (substitute* "libr/parse/p/Makefile"
1189 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1190 (substitute* "libr/bin/p/Makefile"
1191 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1193 (build-system gnu-build-system)
1195 '(#:tests? #f; tests require git and network access
1197 (modify-phases %standard-phases
1198 (add-before 'configure 'mklibdir
1199 (lambda* (#:key inputs #:allow-other-keys)
1200 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1203 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1204 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1208 `(("openssl" ,openssl)
1211 ("capstone" ,capstone)))
1213 `(("pkg-config" ,pkg-config)))
1214 (home-page "https://radare.org/")
1215 (synopsis "Portable reversing framework")
1217 "Radare project started as a forensics tool, a scriptable commandline
1218 hexadecimal editor able to open disk files, but later support for analyzing
1219 binaries, disassembling code, debugging programs, attaching to remote gdb
1221 (license license:lgpl3)))
1229 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1233 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1234 (build-system gnu-build-system)
1236 `(#:tests? #f ; no tests
1237 #:make-flags '("all" "asco-mpi")
1239 (modify-phases %standard-phases
1241 (add-before 'build 'fix-paths
1242 (lambda* (#:key inputs #:allow-other-keys)
1243 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1244 (substitute* '("errfunc.c" "asco.c")
1246 (string-append coreutils "/bin/cp "))
1248 (string-append coreutils "/bin/nice")))
1249 (substitute* "Makefile"
1250 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1252 (replace 'install ; no install target
1253 (lambda* (#:key outputs #:allow-other-keys)
1254 (for-each (lambda (file)
1255 (install-file file (string-append
1256 (assoc-ref outputs "out")
1258 '("asco" "asco-mpi" "asco-test"
1259 "tools/alter/alter" "tools/log/log"))
1262 `(("mpi" ,openmpi)))
1264 `(("coreutils-minimal" ,coreutils-minimal)))
1265 (home-page "http://asco.sourceforge.net/")
1266 (synopsis "SPICE circuit optimizer")
1268 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1269 high-performance parallel differential evolution (DE) optimization algorithm.")
1270 (license license:gpl2+)))
1272 (define-public libngspice
1273 ;; Note: The ngspice's build system does not allow us to build both the
1274 ;; library and the executables in one go. Thus, we have two packages.
1275 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1281 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1282 version "/ngspice-" version ".tar.gz"))
1285 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1286 (modules '((guix build utils)))
1287 ;; We remove the non-free cider and build without it.
1290 (delete-file-recursively "src/ciderlib")
1291 (delete-file "src/ciderinit")
1292 (substitute* "configure"
1293 (("src/ciderlib/Makefile") "")
1294 (("src/ciderlib/input/Makefile") "")
1295 (("src/ciderlib/support/Makefile") "")
1296 (("src/ciderlib/oned/Makefile") "")
1297 (("src/ciderlib/twod/Makefile") ""))
1299 (build-system gnu-build-system)
1301 `(;; No tests for libngspice exist.
1302 ;; The transient tests for ngspice fail.
1305 (modify-phases %standard-phases
1306 (add-after 'unpack 'patch-timestamps
1308 (substitute* "configure"
1309 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1311 (add-after 'unpack 'delete-program-manuals
1313 (substitute* "man/man1/Makefile.in"
1314 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1317 (add-after 'install 'delete-script-files
1318 (lambda* (#:key outputs #:allow-other-keys)
1319 (delete-file-recursively
1320 (string-append (assoc-ref outputs "out")
1321 "/share/ngspice/scripts")))))
1323 (list "--enable-openmp"
1326 "--with-readline=yes")))
1331 `(("libxaw" ,libxaw)
1333 ("readline" ,readline)))
1334 (home-page "http://ngspice.sourceforge.net/")
1335 (synopsis "Mixed-level/mixed-signal circuit simulator")
1337 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1338 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1339 provides code modeling support and simulation of digital components through
1340 an embedded event driven algorithm.")
1341 (license (list license:lgpl2.0+ ; code in frontend/numparam
1342 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1343 license:public-domain)))) ; xspice
1345 (define-public ngspice
1346 ;; The ngspice executables (see libngpsice above.)
1347 (package (inherit libngspice)
1350 (substitute-keyword-arguments (package-arguments libngspice)
1351 ((#:configure-flags flags)
1352 `(delete "--with-ngshared" ,flags))
1354 `(modify-phases ,phases
1355 (add-after 'unpack 'delete-include-files
1357 (substitute* "src/Makefile.in"
1358 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1359 "SUBDIRS = misc maths frontend spicelib"))
1361 (add-after 'install 'delete-cmpp-dlmain
1362 (lambda* (#:key outputs #:allow-other-keys)
1363 (for-each (lambda (file)
1365 (string-append (assoc-ref outputs "out")
1367 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1369 (delete 'delete-program-manuals)
1370 (delete 'delete-script-files)))))
1372 `(("libngspice" ,libngspice)
1373 ("readline" ,readline)))))
1375 (define trilinos-serial-xyce
1376 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1377 ;; keep it private. See
1378 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1379 ;; TODO: Remove when we have modular Trilinos packages?
1381 (name "trilinos-serial-xyce")
1384 (origin (method url-fetch)
1385 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1386 version "-Source.tar.gz"))
1389 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1390 (build-system cmake-build-system)
1392 `(#:out-of-source? #t
1394 (modify-phases %standard-phases
1395 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1397 (add-before 'validate-runpath 'delete-tribits
1398 (lambda* (#:key outputs #:allow-other-keys)
1399 (delete-file-recursively
1400 (string-append (assoc-ref outputs "out")
1401 "/lib/cmake/tribits"))
1404 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1405 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1406 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1407 "-DTrilinos_ENABLE_NOX=ON"
1408 "-DNOX_ENABLE_LOCA=ON"
1409 "-DTrilinos_ENABLE_EpetraExt=ON"
1410 "-DEpetraExt_BUILD_BTF=ON"
1411 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1412 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1413 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1414 "-DTrilinos_ENABLE_Ifpack=ON"
1415 "-DTrilinos_ENABLE_Isorropia=ON"
1416 "-DTrilinos_ENABLE_AztecOO=ON"
1417 "-DTrilinos_ENABLE_Belos=ON"
1418 "-DTrilinos_ENABLE_Teuchos=ON"
1419 "-DTeuchos_ENABLE_COMPLEX=ON"
1420 "-DTrilinos_ENABLE_Amesos=ON"
1421 "-DAmesos_ENABLE_KLU=ON"
1422 "-DAmesos_ENABLE_UMFPACK=ON"
1423 "-DTrilinos_ENABLE_Sacado=ON"
1424 "-DTrilinos_ENABLE_Kokkos=OFF"
1425 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1426 "-DTPL_ENABLE_AMD=ON"
1427 "-DTPL_ENABLE_UMFPACK=ON"
1428 "-DTPL_ENABLE_BLAS=ON"
1429 "-DTPL_ENABLE_LAPACK=ON")))
1431 `(("fortran" ,gfortran)
1436 ("suitesparse" ,suitesparse)))
1437 (home-page "https://trilinos.org")
1438 (synopsis "Engineering and scientific problems algorithms")
1440 "The Trilinos Project is an effort to develop algorithms and enabling
1441 technologies within an object-oriented software framework for the solution of
1442 large-scale, complex multi-physics engineering and scientific problems. A
1443 unique design feature of Trilinos is its focus on packages.")
1444 (license (list license:lgpl2.1+
1447 (define-public xyce-serial
1449 (name "xyce-serial")
1452 (origin (method url-fetch)
1453 (uri (string-append "https://archive.org/download/Xyce-"
1454 version "/Xyce-" version ".tar.gz"))
1457 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1458 (build-system gnu-build-system)
1463 "CXXFLAGS=-O3 -std=c++11"
1464 (string-append "ARCHDIR="
1465 (assoc-ref %build-inputs "trilinos")))))
1469 ("fortran" ,gfortran)))
1472 ("suitesparse" ,suitesparse)
1474 ("trilinos" ,trilinos-serial-xyce)))
1475 (home-page "https://xyce.sandia.gov/")
1476 (synopsis "High-performance analog circuit simulator")
1478 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1479 capable of solving extremely large circuit problems by supporting large-scale
1480 parallel computing platforms. It also supports serial execution.")
1481 (license license:gpl3+)))
1483 (define trilinos-parallel-xyce
1484 (package (inherit trilinos-serial-xyce)
1485 (name "trilinos-parallel-xyce")
1487 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1488 ((#:configure-flags flags)
1489 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1490 "-DTrilinos_ENABLE_Zoltan=ON"
1491 "-DTPL_ENABLE_MPI=ON")
1495 ,@(package-inputs trilinos-serial-xyce)))))
1497 (define-public xyce-parallel
1498 (package (inherit xyce-serial)
1499 (name "xyce-parallel")
1501 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1502 ((#:configure-flags flags)
1503 `(list "CXXFLAGS=-O3 -std=c++11"
1510 (assoc-ref %build-inputs "trilinos")))))))
1512 `(("mpi" ,openmpi)))
1514 `(("trilinos" ,trilinos-parallel-xyce)
1515 ,@(alist-delete "trilinos"
1516 (package-inputs xyce-serial))))))
1518 (define-public freehdl
1524 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1528 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1529 (build-system gnu-build-system)
1532 (modify-phases %standard-phases
1533 (add-before 'configure 'patch-pkg-config
1534 (lambda* (#:key inputs #:allow-other-keys)
1535 (substitute* "freehdl/freehdl-config"
1537 (string-append (assoc-ref inputs "pkg-config")
1540 (string-append (assoc-ref inputs "coreutils")
1543 (add-after 'patch-pkg-config 'setenv
1544 (lambda* (#:key inputs #:allow-other-keys)
1545 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1547 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1550 (add-after 'setenv 'patch-gvhdl
1552 (substitute* "v2cc/gvhdl.in"
1553 (("--mode=link") "--mode=link --tag=CXX")
1554 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1556 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1557 (lambda* (#:key inputs #:allow-other-keys)
1558 (substitute* "freehdl/freehdl-gennodes.in"
1560 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1561 (("\\(debug") ";(debug")
1562 (("\\(@ ") "(apply-emit")
1563 (("\\(@@ ") "(apply-mini-format"))
1565 (add-after 'configure 'patch-freehdl-pc
1566 (lambda* (#:key inputs #:allow-other-keys)
1567 (substitute* "freehdl.pc"
1569 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1572 (string-append "=" (assoc-ref inputs "libtool")
1575 (add-after 'install-scripts 'make-wrapper
1576 (lambda* (#:key inputs outputs #:allow-other-keys)
1577 (let ((out (assoc-ref outputs "out")))
1578 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1580 (wrap-program (string-append out "/bin/gvhdl")
1581 `("CPLUS_INCLUDE_PATH" ":" prefix
1582 (,(string-append (assoc-ref inputs "gcc-toolchain")
1584 `("LIBRARY_PATH" ":" prefix
1585 (,(string-append (assoc-ref inputs "gcc-toolchain")
1588 (,(string-append (assoc-ref inputs "gcc-toolchain")
1590 ,(string-append (assoc-ref inputs "coreutils")
1592 (wrap-program (string-append out "/bin/freehdl-config")
1593 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1596 `(("coreutils" ,coreutils)
1597 ("gcc-toolchain" ,gcc-toolchain)
1598 ("guile" ,guile-2.2)
1600 ("pkg-config" ,pkg-config)
1601 ("libtool" ,libtool)))
1603 `(("pkg-config-native" ,pkg-config)
1604 ("libtool-native" ,libtool)))
1605 (home-page "http://www.freehdl.seul.org/")
1606 (synopsis "VHDL simulator")
1608 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1609 VHDL'93 as well as VHDL'87 standards are supported.")
1610 (license (list license:gpl2+
1611 license:lgpl2.0+)))) ; freehdl's libraries
1614 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1615 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1616 ;; comment and update the package.
1617 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1621 (version (git-version "0.0.19" revision commit))
1625 (url "https://github.com/Qucs/qucs")
1628 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1629 (file-name (string-append name "-" version "-checkout"))))
1630 (build-system gnu-build-system)
1633 (modify-phases %standard-phases
1634 (add-before 'bootstrap 'patch-bootstrap
1636 (for-each patch-shebang
1639 "qucs-doc/bootstrap"
1640 "qucs-core/bootstrap"))
1642 (add-before 'configure 'patch-configure
1643 (lambda* (#:key inputs #:allow-other-keys)
1644 (substitute* "qucs/configure"
1645 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1647 (add-after 'patch-configure 'patch-scripts
1648 (lambda* (#:key inputs outputs #:allow-other-keys)
1649 (substitute* '("qucs/qucs/qucsdigi"
1650 "qucs/qucs/qucsdigilib"
1651 "qucs/qucs/qucsveri")
1653 (string-append (assoc-ref outputs "out") "/bin"))
1655 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1657 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1659 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1661 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1663 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1665 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1667 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1669 (add-before 'check 'pre-check
1671 ;; The test suite requires a running X server.
1672 (system "Xvfb :1 &")
1673 (setenv "DISPLAY" ":1")
1675 (add-after 'install 'make-wrapper
1676 (lambda* (#:key inputs outputs #:allow-other-keys)
1677 (let ((out (assoc-ref outputs "out")))
1678 ;; 'qucs' directly invokes gcc, hence this wrapping.
1679 (wrap-program (string-append out "/bin/qucs")
1680 `("CPLUS_INCLUDE_PATH" ":" prefix
1681 (,(string-append (assoc-ref inputs "gcc-toolchain")
1684 (,(string-append (assoc-ref inputs "gcc-toolchain")
1686 `("LIBRARY_PATH" ":" prefix
1687 (,(string-append (assoc-ref inputs "gcc-toolchain")
1689 `("ADMSXMLBINDIR" ":" prefix
1690 (,(string-append (assoc-ref inputs "adms") "/bin")))
1691 `("ASCOBINDIR" ":" prefix
1692 (,(string-append (assoc-ref inputs "asco") "/bin")))
1693 `("QUCS_OCTAVE" ":" prefix
1694 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1696 #:parallel-build? #f ; race condition
1697 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1699 `(("autoconf" ,autoconf)
1700 ("automake" ,automake)
1704 ("libtool-native" ,libtool)
1705 ("pkg-config" ,pkg-config)
1706 ("python" ,python-2) ; for tests
1707 ("matplotlib" ,python2-matplotlib) ; for tests
1708 ("numpy" ,python2-numpy) ; for tests
1709 ("xorg-server" ,xorg-server))) ; for tests
1713 ("coreutils" ,coreutils)
1714 ("freehdl" ,freehdl)
1715 ("gcc-toolchain" ,gcc-toolchain)
1716 ("iverilog" ,iverilog)
1717 ("libtool" ,libtool)
1718 ("octave" ,octave-cli)
1721 (home-page "http://qucs.sourceforge.net/")
1722 (synopsis "Circuit simulator with graphical user interface")
1724 "Qucs is a circuit simulator with graphical user interface. The software
1725 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1726 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1727 simulations are also supported.")
1728 (license license:gpl2+))))
1730 (define-public qucs-s
1736 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1738 (file-name (string-append name "-" version ".tar.gz"))
1741 "01dizf4rjciqc8x7bmv3kbhdlz90bm6n9m9fz7dbzqcwvszcs1hx"))))
1742 (build-system cmake-build-system)
1744 `(#:tests? #f ; no tests
1746 (modify-phases %standard-phases
1747 (add-before 'configure 'patch-scripts
1748 (lambda* (#:key inputs #:allow-other-keys)
1749 (substitute* '("qucs/qucsdigi"
1753 (string-append (assoc-ref inputs "qucs") "/bin"))
1755 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1757 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1759 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1761 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1763 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1765 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1767 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1769 (add-after 'patch-scripts 'patch-paths
1770 (lambda* (#:key inputs #:allow-other-keys)
1771 (substitute* "qucs/main.cpp"
1772 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1773 "\\+ \"qucsator\" \\+ executableSuffix"))
1774 (string-append "}{ QucsSettings.Qucsator = \""
1775 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1776 (((string-append "QucsSettings\\.XyceExecutable = "
1777 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1778 (string-append "}{ QucsSettings.XyceExecutable = \""
1779 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1780 (((string-append "else QucsSettings\\.XyceParExecutable = "
1781 "\"mpirun -np %p /usr/local"
1782 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1783 (string-append "QucsSettings.XyceParExecutable = \""
1784 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1785 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1786 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1787 (string-append "QucsSettings.NgspiceExecutable = " "\""
1788 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1789 (substitute* "qucs/extsimkernels/ngspice.cpp"
1790 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1791 (substitute* "qucs/qucs_actions.cpp"
1793 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1795 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1797 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1799 (add-after 'install 'install-scripts
1800 (lambda* (#:key inputs outputs #:allow-other-keys)
1803 (let ((file (string-append "../qucs_s-" ,version
1805 (out (assoc-ref outputs "out")))
1806 (install-file file (string-append out "/bin"))
1807 (chmod (string-append out "/bin/" script) #o555)))
1808 '("qucsdigi" "qucsdigilib" "qucsveri"))
1810 (add-after 'install-scripts 'make-wrapper
1811 (lambda* (#:key inputs outputs #:allow-other-keys)
1812 (let* ((out (assoc-ref outputs "out"))
1813 (file (string-append out "/bin/qucs-s"))
1814 (qucs (assoc-ref inputs "qucs"))
1815 (qucsator (string-append qucs "/bin/qucsator")))
1817 `("CPLUS_INCLUDE_PATH" ":" prefix
1818 (,(string-append (assoc-ref inputs "gcc-toolchain")
1821 (,(string-append (assoc-ref inputs "gcc-toolchain")
1823 `("LIBRARY_PATH" ":" prefix
1824 (,(string-append (assoc-ref inputs "gcc-toolchain")
1826 `("QUCSATOR" ":" prefix (,qucsator))
1827 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1828 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1830 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1832 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1834 (symlink qucsator (string-append out "/bin/qucsator"))
1837 `(("libtool-native" ,libtool)))
1841 ("coreutils" ,coreutils)
1842 ("freehdl" ,freehdl)
1843 ("gcc-toolchain" ,gcc-toolchain)
1844 ("iverilog" ,iverilog)
1845 ("libtool" ,libtool)
1847 ("ngspice" ,ngspice)
1848 ("octave" ,octave-cli)
1852 ("xyce-serial" ,xyce-serial)
1853 ("xyce-parallel" ,xyce-parallel)))
1854 (home-page "https://ra3xdh.github.io/")
1855 (synopsis "Circuit simulator with graphical user interface")
1857 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1858 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1859 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1860 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1861 (license license:gpl2+)))
1863 (define-public librepcb
1870 (uri (string-append "https://download.librepcb.org/releases/0.1.0/librepcb-"
1871 version "-source.zip"))
1874 "0affvwwgs1j2wx6bb3zfa2jbfxpckklr8cka2nkswca0p82wd3dv"))))
1875 (build-system gnu-build-system)
1877 `(("qtbase" ,qtbase)
1880 `(("qttools" ,qttools) ; for lrelease
1884 (modify-phases %standard-phases
1886 (lambda* (#:key inputs outputs #:allow-other-keys)
1889 (let ((lrelease (string-append (assoc-ref inputs "qttools")
1891 (out (assoc-ref outputs "out")))
1893 (string-append "QMAKE_LRELEASE=" lrelease)
1894 (string-append "PREFIX=" out)
1895 "../librepcb.pro")))))))
1896 (home-page "https://librepcb.org/")
1897 (synopsis "Electronic Design Automation tool")
1898 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
1899 software to develop printed circuit boards. It features human readable file
1900 formats and complete project management with library, schematic and board
1902 (license (list license:gpl3+
1903 license:boost1.0 ; libs/clipper,
1904 ; libs/optional/tests/catch.hpp,
1905 ; libs/sexpresso/tests/catch.hpp
1906 license:expat ; libs/delaunay-triangulation,
1907 ; libs/parseagle, libs/type_safe
1908 license:asl2.0 ; libs/fontobene, libs/googletest,
1910 license:isc ; libs/hoedown
1911 license:cc0 ; libs/optional, libs/sexpresso
1912 license:bsd-2 ; libs/optional/tests/catch.hpp
1913 license:lgpl2.1+)))) ; libs/quazip