1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 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>
13 ;;; Copyright © 2019 Tim Stahel <swedneck@swedneck.xyz>
15 ;;; This file is part of GNU Guix.
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30 (define-module (gnu packages engineering)
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix gexp)
34 #:use-module (guix git-download)
35 #:use-module (guix monads)
36 #:use-module (guix store)
37 #:use-module (guix utils)
38 #:use-module ((srfi srfi-1) #:hide (zip))
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix build-system cmake)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system python)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages algebra)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bison)
48 #:use-module (gnu packages boost)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages commencement)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages flex)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages fpga)
56 #:use-module (gnu packages freedesktop)
57 #:use-module (gnu packages gcc)
58 #:use-module (gnu packages gd)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages ghostscript)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gnome)
64 #:use-module (gnu packages gperf)
65 #:use-module (gnu packages groff)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages guile)
68 #:use-module (gnu packages image)
69 #:use-module (gnu packages imagemagick)
70 #:use-module (gnu packages linux) ;FIXME: for pcb
71 #:use-module (gnu packages m4)
72 #:use-module (gnu packages maths)
73 #:use-module (gnu packages multiprecision)
74 #:use-module (gnu packages mpi)
75 #:use-module (gnu packages ncurses)
76 #:use-module (gnu packages perl)
77 #:use-module (gnu packages pkg-config)
78 #:use-module (gnu packages python)
79 #:use-module (gnu packages python-xyz)
80 #:use-module (gnu packages qt)
81 #:use-module (gnu packages readline)
82 #:use-module (gnu packages swig)
83 #:use-module (gnu packages tcl)
84 #:use-module (gnu packages texinfo)
85 #:use-module (gnu packages tls)
86 #:use-module (gnu packages tex)
87 #:use-module (gnu packages wxwidgets)
88 #:use-module (gnu packages xorg))
90 (define-public librecad
97 "https://github.com/LibreCAD/LibreCAD/archive/"
99 (file-name (string-append name "-" version ".tar.gz"))
102 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
103 (build-system gnu-build-system)
106 (modify-phases %standard-phases
107 ;; Without this patch boost complains that "make_array" is not a
108 ;; member of "boost::serialization".
109 (add-after 'unpack 'patch-boost-error
111 (substitute* "librecad/src/lib/math/lc_quadratic.h"
112 (("#include \"rs_vector.h\"" line)
114 "\n#include <boost/serialization/array_wrapper.hpp>")))
115 (substitute* "librecad/src/lib/math/rs_math.cpp"
116 (("#include <boost/numeric/ublas/matrix.hpp>" line)
117 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
120 ;; Fix build against Qt 5.11.
121 (add-after 'unpack 'add-missing-headers
123 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
124 (("#include <QPushButton>") "#include <QPushButton>
125 #include <QActionGroup>"))
127 (add-after 'unpack 'patch-paths
128 (lambda* (#:key outputs #:allow-other-keys)
129 (let ((out (assoc-ref outputs "out")))
130 (substitute* "librecad/src/lib/engine/rs_system.cpp"
131 (("/usr/share") (string-append out "/share"))))))
133 (lambda* (#:key inputs #:allow-other-keys)
134 (system* "qmake" (string-append "BOOST_DIR="
135 (assoc-ref inputs "boost")))))
137 (lambda* (#:key outputs #:allow-other-keys)
138 (let* ((out (assoc-ref outputs "out"))
139 (bin (string-append out "/bin"))
140 (share (string-append out "/share/librecad")))
142 (install-file "unix/librecad" bin)
144 (copy-recursively "unix/resources" share))
146 ;; Ensure that icons are found at runtime
147 (add-after 'install 'wrap-executable
148 (lambda* (#:key inputs outputs #:allow-other-keys)
149 (let* ((out (assoc-ref outputs "out"))
150 (qt '("qtbase" "qtsvg")))
151 (wrap-program (string-append out "/bin/librecad")
152 `("QT_PLUGIN_PATH" ":" prefix
153 ,(map (lambda (label)
154 (string-append (assoc-ref inputs label)
155 "/lib/qt5/plugins/"))
160 ("muparser" ,muparser)
161 ("freetype" ,freetype)
165 `(("pkg-config" ,pkg-config)
167 (home-page "http://librecad.org/")
168 (synopsis "Computer-aided design (CAD) application")
170 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
172 (license license:gpl2)))
174 (define-public geda-gaf
181 "http://ftp.geda-project.org/geda-gaf/unstable/v"
182 (version-major+minor version) "/"
183 version "/geda-gaf-" version ".tar.gz"))
186 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
187 (build-system gnu-build-system)
190 (modify-phases %standard-phases
191 ;; tests require a writable HOME
192 (add-before 'check 'set-home
194 (setenv "HOME" (getenv "TMPDIR"))
196 ;; FIXME: These two tests fail for unknown reasons. They return "2"
197 ;; when they should return "1".
198 (add-after 'unpack 'disable-failing-tests
200 (substitute* "utils/tests/gxyrs/tests.list"
201 (("^do_nothing.*") ""))
204 (let ((pcb (assoc-ref %build-inputs "pcb")))
205 (list (string-append "--with-pcb-datadir=" pcb "/share")
206 (string-append "--with-pcb-lib-path="
207 pcb "/share/pcb/pcblib-newlib:"
208 pcb "/share/pcb/newlib")))))
213 ("desktop-file-utils" ,desktop-file-utils)
214 ("shared-mime-info" ,shared-mime-info)
218 `(("pkg-config" ,pkg-config)
219 ("perl" ,perl))) ; for tests
220 (home-page "http://geda-project.org/")
221 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
223 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
224 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
225 which currently includes: gschem, a schematic capture program; gnetlist, a
226 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
227 gattrib, a spreadsheet programm that manipulates the properties of symbols of
228 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
229 tool to forward annotation from your schematic to layout using PCB; some minor
231 (license license:gpl2+)))
233 (define-public lepton-eda
234 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
235 ;; keep and to extend Guile support.
239 (version "1.9.5-20180820")
240 (home-page "https://github.com/lepton-eda/lepton-eda")
243 (uri (git-reference (url home-page) (commit version)))
246 "1ayaccvw18zh4g7a4x5jf6yxkphi5xafb0hpc732g59qkgwfcmlr"))
247 (file-name (git-file-name name version))))
249 `(("autoconf" ,autoconf)
250 ("automake" ,automake)
252 ("gettext" ,gnu-gettext)
256 ,@(package-native-inputs geda-gaf)))
257 ;; For now it's Guile 2.0, not 2.2.
259 (substitute-keyword-arguments (package-arguments geda-gaf)
260 ((#:configure-flags flags ''())
261 ;; When running "make", the POT files are built with the build time as
262 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
263 ;; files were updated and goes on to run "msgmerge"; as a result, the
264 ;; non-deterministic POT-Creation-Date finds its way into .po files,
265 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
266 ;; never runs. See <https://bugs.debian.org/792687>.
267 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
268 ((#:phases phases '%standard-phases)
269 `(modify-phases ,phases
270 (add-before 'bootstrap 'prepare
272 ;; Some of the scripts there are invoked by autogen.sh.
273 (for-each patch-shebang (find-files "build-tools"))
275 ;; Make sure 'msgmerge' can modify the PO files.
276 (for-each (lambda (po)
278 (find-files "." "\\.po$"))
280 ;; This would normally be created by invoking 'git', but it
281 ;; doesn't work here.
282 (call-with-output-file "version.h"
284 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
285 ,(string-drop version
286 (+ 1 (string-index version #\-))))
287 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
288 ,(string-take version
289 (string-index version #\-)))
290 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
293 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
294 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
295 design, schematic capture, simulation, prototyping, and production. Lepton
296 EDA includes tools for schematic capture, attribute management, bill of
297 materials (BOM) generation, netlisting into over 20 netlist formats, analog
298 and digital simulation, and printed circuit board (PCB) layout, and many other
307 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
308 "/pcb-" version ".tar.gz"))
311 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
312 (build-system gnu-build-system)
315 (modify-phases %standard-phases
316 (add-after 'unpack 'use-wish8.6
318 (substitute* "configure"
319 (("wish85") "wish8.6"))
321 ;; It checks for "xhost", which we don't have. This shouldn't
322 ;; matter, because the test is supposed to be skipped, but it causes
323 ;; "run_tests.sh" (and thus the "check" phase) to fail.
324 (add-after 'unpack 'fix-check-for-display
326 (substitute* "tests/run_tests.sh"
327 (("have_display=no") "have_display=yes"))
329 (add-after 'install 'wrap
330 (lambda* (#:key inputs outputs #:allow-other-keys)
331 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
332 ;; fix of the mesa package we wrap the pcb executable such that
333 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
334 (let* ((out (assoc-ref outputs "out"))
335 (path (string-append (assoc-ref inputs "udev") "/lib")))
336 (wrap-program (string-append out "/bin/pcb")
337 `("LD_LIBRARY_PATH" ":" prefix (,path))))
339 (add-before 'check 'pre-check
342 (setenv "DISPLAY" ":1")
347 ("udev" ,eudev) ;FIXME: required by mesa
351 ("gtkglext" ,gtkglext)
352 ("desktop-file-utils" ,desktop-file-utils)
353 ("shared-mime-info" ,shared-mime-info)
356 `(("pkg-config" ,pkg-config)
357 ("intltool" ,intltool)
361 ("imagemagick" ,imagemagick)
363 ("ghostscript" ,ghostscript)
364 ("xvfb" ,xorg-server)))
365 (home-page "http://pcb.geda-project.org/")
366 (synopsis "Design printed circuit board layouts")
368 "GNU PCB is an interactive tool for editing printed circuit board
369 layouts. It features a rats-nest implementation, schematic/netlist import,
370 and design rule checking. It also includes an autorouter and a trace
371 optimizer; and it can produce photorealistic and design review images.")
372 (license license:gpl2+)))
374 (define-public pcb-rnd
375 (package (inherit pcb)
380 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
381 "pcb-rnd-" version ".tar.gz"))
384 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
386 `(#:tests? #f ; no check target
388 (modify-phases %standard-phases
389 (add-after 'unpack 'cc-is-gcc
390 (lambda _ (setenv "CC" "gcc") #t))
392 ;; The configure script doesn't tolerate most of our configure flags.
393 (lambda* (#:key outputs #:allow-other-keys)
394 (invoke "sh" "configure"
395 (string-append "--prefix="
396 (assoc-ref outputs "out"))))))))
397 (home-page "http://repo.hu/projects/pcb-rnd/")
398 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
399 featuring various improvements and bug fixes.")))
401 (define-public fastcap
404 (version "2.0-18Sep92")
406 (method url-fetch/tarbomb)
407 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
408 name "-" version ".tgz"))
411 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
413 ;; Remove a non-free file.
415 (delete-file "doc/psfig.sty")
417 (patches (search-patches "fastcap-mulSetup.patch"
418 "fastcap-mulGlobal.patch"))))
419 (build-system gnu-build-system)
421 ;; FIXME: with texlive-tiny citation references are rendered as question
422 ;; marks. During the build warnings like these are printed:
423 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
424 `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts)))
425 ("ghostscript" ,ghostscript)))
427 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
429 #:tests? #f ;; no tests-suite
430 #:modules ((srfi srfi-1)
431 ,@%gnu-build-system-modules)
433 (modify-phases %standard-phases
434 (add-after 'build 'make-doc
436 (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
437 (add-before 'make-doc 'fix-doc
439 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
440 (substitute* (find-files "doc" "\\.tex")
441 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
443 (string-append "\\includegraphics[scale=" scale "]{"
445 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
447 (string-append "\\includegraphics[width=" width "]{"
449 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
451 (string-append "\\includegraphics[height=" height "]{"
453 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
454 (string-append "\\includegraphics{" file "}")))
455 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
456 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
458 (string-append "\\documentclass[" options "]{"
460 "\\usepackage{graphicx}\n"
461 "\\usepackage{robinspace}"))
462 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
463 (string-append "%" all))
464 (("\\\\setstretch\\{.*\\}" all)
465 (string-append "%" all)))
468 (add-before 'install 'clean-bin
470 (delete-file (string-append (getcwd) "/bin/README"))
472 (add-before 'install 'make-pdf
474 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
475 (with-directory-excursion "doc"
477 (for-each (lambda (file)
478 (invoke "dvips" file "-o"))
479 (find-files "." "\\.dvi"))
480 (for-each (lambda (file)
481 (invoke "ps2pdf" file))
482 '("mtt.ps" "ug.ps" "tcad.ps"))
483 (invoke "make" "clean")))))
485 (lambda* (#:key outputs #:allow-other-keys)
486 (let* ((out (assoc-ref outputs "out"))
487 (data (string-append out "/share"))
488 (bin (string-append out "/bin"))
489 (doc (string-append data "/doc/" ,name "-" ,version))
490 (examples (string-append doc "/examples")))
491 (with-directory-excursion "bin"
492 (for-each (lambda (f)
493 (install-file f bin))
494 (find-files "." ".*")))
495 (copy-recursively "doc" doc)
496 (copy-recursively "examples" examples)
498 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
499 (synopsis "Multipole-accelerated capacitance extraction program")
501 "Fastcap is a capacitance extraction program based on a
502 multipole-accelerated algorithm.")
503 (license (license:non-copyleft #f "See fastcap.c."))))
505 (define-public fasthenry
508 (version "3.0-12Nov96")
511 (file-name (string-append name "-" version ".tar.gz"))
513 "http://www.rle.mit.edu/cpg/codes/" name
514 "-" version ".tar.z"))
516 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
517 (patches (search-patches "fasthenry-spAllocate.patch"
518 "fasthenry-spBuild.patch"
519 "fasthenry-spUtils.patch"
520 "fasthenry-spSolve.patch"
521 "fasthenry-spFactor.patch"))))
522 (build-system gnu-build-system)
524 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
526 #:tests? #f ;; no tests-suite
527 #:modules ((srfi srfi-1)
528 ,@%gnu-build-system-modules)
530 (modify-phases %standard-phases
533 (lambda* (#:key outputs #:allow-other-keys)
534 (let* ((out (assoc-ref outputs "out"))
535 (data (string-append out "/share"))
536 (bin (string-append out "/bin"))
537 (doc (string-append data "/doc/" ,name "-" ,version))
538 (examples (string-append doc "/examples")))
539 (with-directory-excursion "bin"
540 (for-each (lambda (f)
541 (install-file f bin))
542 (find-files "." ".*")))
543 (copy-recursively "doc" doc)
544 (copy-recursively "examples" examples)
546 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
547 (synopsis "Multipole-accelerated inductance analysis program")
549 "Fasthenry is an inductance extraction program based on a
550 multipole-accelerated algorithm.")
551 (license (license:non-copyleft #f "See induct.c."))))
553 (define-public fritzing
559 (uri (string-append "https://github.com/fritzing/"
560 "fritzing-app/archive/" version ".tar.gz"))
561 (file-name (string-append name "-" version ".tar.gz"))
564 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
565 (build-system gnu-build-system)
568 (modify-phases %standard-phases
570 (lambda* (#:key inputs outputs #:allow-other-keys)
571 (and (zero? (system* "tar"
572 "-xvf" (assoc-ref inputs "fritzing-parts-db")
574 (zero? (system* "qmake"
575 (string-append "PREFIX="
576 (assoc-ref outputs "out"))
577 "phoenix.pro"))))))))
580 ("qtserialport" ,qtserialport)
587 (uri (string-append "https://github.com/fritzing/"
588 "fritzing-parts/archive/" version ".tar.gz"))
589 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
592 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
593 (home-page "http://fritzing.org")
594 (synopsis "Electronic circuit design")
596 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
597 software with a low entry barrier, suited for the needs of makers and
598 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
599 library with many commonly used high-level components. Fritzing makes it very
600 easy to communicate about circuits, as well as to turn them into PCB layouts
601 ready for production.")
602 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
603 ;; released under GPLv3+.
604 (license (list license:gpl3+ license:cc-by-sa3.0))))
612 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
613 version "/gerbv-" version ".tar.gz"))
616 "1cw8k6ni0q8kswad03kha86fk7n06vq8p0wzsfhcnalsdshrn17i"))))
617 (build-system gnu-build-system)
619 `(("pkg-config" ,pkg-config)))
623 ("desktop-file-utils" ,desktop-file-utils)))
624 (home-page "http://gerbv.geda-project.org/")
625 (synopsis "Gerber file viewer")
627 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
628 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
629 you load several files on top of each other, do measurements on the displayed
630 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
631 as well as pick-place files.")
632 (license license:gpl2+)))
634 (define-public libfive
635 (let ((commit "9d857d1923abecb0e5935b9287d22661f6efaac5")
639 (version (git-version "0" revision commit))
643 (url "https://github.com/libfive/libfive")
647 "1r40kyx30wz31cwwlfvfh7fgqkxq3n8dxhswpi9qpf4r5h3l8wsn"))
648 (file-name (git-file-name name version))
650 ;; Remove bundled catch since we provide our own.
652 (delete-file "libfive/test/catch.hpp")
654 (build-system cmake-build-system)
656 `(#:test-target "libfive-test"
658 (modify-phases %standard-phases
659 (add-after 'unpack 'remove-native-compilation
661 (substitute* "CMakeLists.txt" (("-march=native") ""))
664 `(("pkg-config" ,pkg-config)))
667 ("catch" ,catch-framework)
671 ("guile" ,guile-2.2)))
672 (home-page "https://libfive.com")
673 (synopsis "Tool for programmatic computer-aided design")
675 "Libfive is a tool for programmatic computer-aided design (CAD). In
676 libfive, solid models are defined as Scheme scripts, and there are no opaque
677 function calls into the geometry kernel: everything is visible to the user.
678 Even fundamental, primitive shapes are represented as code in the user-level
680 (license (list license:lgpl2.1+ ;library
681 license:gpl2+))))) ;Guile bindings and GUI
684 (deprecated-package "ao-cad" libfive))
693 (file-name (string-append name "-" version ".tar.xz"))
695 "https://launchpad.net/kicad/" (version-major+minor version)
696 "/" version "/+download/" name "-" version ".tar.xz"))
698 (base32 "17nqjszyvd25wi6550j981whlnb1wxzmlanljdjihiki53j84x9p"))))
699 (build-system cmake-build-system)
701 `(#:out-of-source? #t
702 #:tests? #f ; no tests
703 #:build-type "Release"
705 (list "-DKICAD_STABLE_VERSION=ON"
706 "-DKICAD_REPO_NAME=stable"
707 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
708 "-DKICAD_SCRIPTING=ON"
709 "-DKICAD_SCRIPTING_MODULES=ON"
710 "-DKICAD_SCRIPTING_WXPYTHON=ON"
711 ;; Has to be set explicitely, as we don't have the wxPython
712 ;; headers in the wxwidgets store item, but in wxPython.
713 (string-append "-DCMAKE_CXX_FLAGS=-I"
714 (assoc-ref %build-inputs "wxpython")
716 ,(version-major+minor
717 (package-version python2-wxpython)))
718 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
720 ;; TODO: Enable this when CA certs are working with curl.
721 "-DBUILD_GITHUB_PLUGIN=OFF")
723 (modify-phases %standard-phases
724 (add-after 'unpack 'adjust-boost-include
726 ;; The location of this header changed in Boost 1.66.
727 (substitute* "3d-viewer/3d_cache/3d_cache.cpp"
728 (("boost/uuid/sha1\\.hpp")
729 "boost/uuid/detail/sha1.hpp"))
731 (add-after 'install 'wrap-program
732 ;; Ensure correct Python at runtime.
733 (lambda* (#:key inputs outputs #:allow-other-keys)
734 (let* ((out (assoc-ref outputs "out"))
735 (python (assoc-ref inputs "python"))
736 (file (string-append out "/bin/kicad"))
740 ,(version-major+minor
741 (package-version python))
743 (getenv "PYTHONPATH"))))
745 `("PYTHONPATH" ":" prefix (,path))
747 (,(string-append python "/bin:")))))
751 ("gettext" ,gnu-gettext)
752 ("pkg-config" ,pkg-config)
758 ("desktop-file-utils" ,desktop-file-utils)
761 ("hicolor-icon-theme" ,hicolor-icon-theme)
762 ("libngspice" ,libngspice)
765 ("opencascade-oce" ,opencascade-oce)
768 ("wxwidgets" ,wxwidgets-gtk2)
769 ("wxpython" ,python2-wxpython)))
770 (home-page "http://kicad-pcb.org/")
771 (synopsis "Electronics Design Automation Suite")
772 (description "Kicad is a program for the formation of printed circuit
773 boards and electrical circuits. The software has a number of programs that
774 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
775 electrical diagrams), gerbview (viewing Gerber files) and others.")
776 (license license:gpl3+)))
778 (define-public kicad-library
779 (let ((version "4.0.7"))
781 (name "kicad-library")
786 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
790 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
791 (build-system cmake-build-system)
793 `(#:out-of-source? #t
794 #:tests? #f ; no tests
796 (modify-phases %standard-phases
797 (add-after 'install 'install-footprints ; from footprints tarball
798 (lambda* (#:key inputs outputs #:allow-other-keys)
800 (assoc-ref inputs "kicad-footprints")
801 "-C" (string-append (assoc-ref outputs "out")
802 "/share/kicad/modules")
803 "--strip-components=1")))
804 ;; We change the default global footprint file, which is generated if
805 ;; it doesn't exist in user's home directory, from the one using the
806 ;; github plugin, to the one using the KISYSMOD environment path.
807 (add-after 'install-footprints 'use-pretty-footprint-table
808 (lambda* (#:key outputs #:allow-other-keys)
809 (let* ((out (assoc-ref outputs "out"))
810 (template-dir (string-append out "/share/kicad/template"))
811 (fp-lib-table (string-append template-dir "/fp-lib-table")))
812 (delete-file fp-lib-table)
813 (copy-file (string-append fp-lib-table ".for-pretty")
817 (list (search-path-specification
818 (variable "KISYSMOD") ; footprint path
819 (files '("share/kicad/modules")))
820 (search-path-specification
821 (variable "KISYS3DMOD") ; 3D model path
822 (files '("share/kicad/modules/packages3d")))))
823 ;; Kicad distributes footprints in a separate tarball.
825 `(("kicad-footprints"
829 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
833 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
834 (home-page "http://kicad-pcb.org/")
835 (synopsis "Libraries for kicad")
836 (description "This package provides Kicad component, footprint and 3D
837 render model libraries.")
838 (license license:lgpl2.0+))))
840 (define-public kicad-symbols
842 (name "kicad-symbols")
847 (url "https://github.com/KiCad/kicad-symbols.git")
849 (file-name (string-append "kicad-symbols-" version "-checkout"))
852 "18z5vpdq7hy2mpvm5vz1dz3ra3a5iybavvlzi8q2bmmdb6gsvf64"))))
853 (build-system cmake-build-system)
855 `(#:tests? #f)) ; No tests exist
856 (home-page "http://kicad-pcb.org/")
857 (synopsis "Official KiCad schematic symbol libraries for KiCad 5")
858 (description "This package contains the official KiCad schematic symbol
859 libraries for KiCad 5.")
860 ;; 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'."
861 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
862 (license license:cc-by-sa4.0)))
864 (define-public linsmith
871 "mirror://sourceforge/linsmith/linsmith/linsmith-"
872 version "/linsmith-" version ".tar.gz"))
875 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
876 (build-system gnu-build-system)
878 `(("pkg-config" ,pkg-config)
880 ("libgnome" ,libgnomeui)))
881 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
882 (synopsis "Smith Charting program")
883 (description "LinSmith is a Smith Charting program, mainly designed for
884 educational use. As such, there is an emphasis on capabilities that improve
885 the 'showing the effect of'-style of operation.")
886 (license license:gpl2+)))
895 (uri (string-append "http://libvolk.org/releases/volk-"
899 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
900 (build-system cmake-build-system)
904 `(("python-2" ,python-2)
905 ("python2-cheetah" ,python2-cheetah)))
906 (home-page "http://libvolk.org/")
907 (synopsis "Vector-Optimized Library of Kernels")
909 "@code{volk} contains procedures with machine-specific optimizations
910 for mathematical functions. It also provides an machine-independent
911 interface to select the best such procedures to use on a given system.")
912 (license license:gpl3+)))
914 (define-public minicom
921 (uri (string-append "https://alioth.debian.org/frs/download.php/"
922 "file/4215/" name "-" version ".tar.gz"))
925 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
926 (build-system gnu-build-system)
928 `(#:configure-flags '("--enable-lock-dir=/var/lock")
930 (modify-phases %standard-phases
931 (add-after 'unpack 'patch-lock-check
933 (substitute* "configure"
934 (("test -d [$]UUCPLOCK") "true"))
937 `(("ncurses" ,ncurses)))
938 (home-page "https://alioth.debian.org/projects/minicom/")
939 (synopsis "Serial terminal emulator")
940 (description "@code{minicom} is a serial terminal emulator.")
941 (license license:gpl2+)))
943 (define-public harminv
950 (string-append "https://github.com/stevengj/harminv/"
951 "releases/download/v" version "/"
952 name "-" version ".tar.gz"))
955 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
956 (build-system gnu-build-system)
959 (modify-phases %standard-phases
960 (add-before 'configure 'fix-tests
962 (substitute* "./sines-test.sh"
963 ; change test frequency range - default fails
967 `(("fortran" ,gfortran)))
969 `(("lapack" ,lapack)))
970 (home-page "https://github.com/stevengj/harminv")
971 (synopsis "Harmonic inversion solver")
973 "Harminv is a free program (and accompanying library) to solve the problem of
974 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
975 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
976 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
977 (license license:gpl2+)))
979 (define-public guile-libctl
981 (name "guile-libctl")
987 "http://ab-initio.mit.edu/libctl/libctl-"
991 "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
992 (build-system gnu-build-system)
994 `(("fortran" ,gfortran)))
996 `(("guile" ,guile-2.2)))
997 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
998 (synopsis "Flexible control files implementation for scientific simulations")
1000 "Libctl is a Guile-based library implementing flexible control files
1001 for scientific simulations.")
1002 (license license:gpl2+)))
1012 "http://ab-initio.mit.edu/mpb/mpb-"
1016 "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
1017 (build-system gnu-build-system)
1020 (list (string-append "--with-libctl="
1021 (assoc-ref %build-inputs "libctl")
1024 `(("fortran" ,gfortran)
1025 ("pkg-config" ,pkg-config)
1030 ("guile" ,guile-2.2)
1033 ("libctl" ,guile-libctl)
1034 ("readline" ,readline)
1036 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1037 (synopsis "Computes band structures and electromagnetic modes of dielectric
1040 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1041 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1042 fully-vectorial and three-dimensional methods.")
1043 (license license:gpl2+)))
1053 "http://ab-initio.mit.edu/meep/meep-"
1057 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
1058 (build-system gnu-build-system)
1061 (list (string-append "--with-libctl="
1062 (assoc-ref %build-inputs "libctl")
1065 `(("fortran" ,gfortran)
1066 ("pkg-config" ,pkg-config)
1071 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
1072 ("harminv" ,harminv)
1075 ("libctl" ,guile-libctl)
1078 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1079 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1081 "Meep is a finite-difference time-domain (FDTD) simulation software package
1082 developed at MIT to model electromagnetic systems.")
1083 (license license:gpl2+)))
1093 "mirror://sourceforge/mot-adms/adms-source/"
1094 (version-major+minor version) "/adms-" version ".tar.gz"))
1097 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1098 (build-system gnu-build-system)
1102 (home-page "https://sourceforge.net/projects/mot-adms")
1103 (synopsis "Automatic device model synthesizer")
1105 "ADMS is a code generator that converts electrical compact device models
1106 specified in high-level description language into ready-to-compile C code for
1107 the API of spice simulators. Based on transformations specified in XML
1108 language, ADMS transforms Verilog-AMS code into other target languages.")
1109 (license license:gpl3)))
1111 (define-public capstone
1117 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1119 (file-name (string-append name "-" version ".tar.gz"))
1122 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
1123 (build-system gnu-build-system)
1126 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1129 (modify-phases %standard-phases
1130 (delete 'configure) ; no configure script
1131 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1132 (add-before 'build 'fix-cstool-ldflags
1133 (lambda* (#:key outputs #:allow-other-keys)
1134 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1135 (assoc-ref outputs "out") "/lib"))
1137 (home-page "https://www.capstone-engine.org")
1138 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1140 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1141 framework. Capstone can disassemble machine code for many supported architectures
1142 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1143 bindings for Python, Java, OCaml and more.")
1144 (license license:bsd-3)))
1146 ;; FIXME: This package has a timestamp embedded in
1147 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1148 (define-public python-capstone
1151 (name "python-capstone")
1153 `(("capstone" ,capstone)))
1154 (build-system python-build-system)
1157 (modify-phases %standard-phases
1158 (add-after 'unpack 'chdir-and-fix-setup-py
1160 (chdir "bindings/python")
1161 ;; Do not build the library again, because we already have it.
1162 (substitute* "setup.py" ((".* build_libraries.*") ""))
1163 ;; This substitution tells python-capstone where to find the
1165 (substitute* "capstone/__init__.py"
1166 (("pkg_resources.resource_filename.*")
1167 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1170 (define-public python2-capstone
1171 (package-with-python2 python-capstone))
1173 (define-public radare2
1179 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1180 name "-" version ".tar.gz"))
1183 "17h4ba5qqahfi8mi4x2dcvq87cqpir5v2dlaqbvmay6vby4zh4v7"))
1184 (modules '((guix build utils)))
1187 (substitute* "libr/asm/p/Makefile"
1188 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1189 (substitute* "libr/parse/p/Makefile"
1190 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1191 (substitute* "libr/bin/p/Makefile"
1192 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1194 (build-system gnu-build-system)
1196 '(#:tests? #f; tests require git and network access
1198 (modify-phases %standard-phases
1199 (add-before 'configure 'mklibdir
1200 (lambda* (#:key inputs #:allow-other-keys)
1201 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1204 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1205 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1209 `(("openssl" ,openssl)
1212 ("capstone" ,capstone)))
1214 `(("pkg-config" ,pkg-config)))
1215 (home-page "https://radare.org/")
1216 (synopsis "Portable reversing framework")
1218 "Radare project started as a forensics tool, a scriptable commandline
1219 hexadecimal editor able to open disk files, but later support for analyzing
1220 binaries, disassembling code, debugging programs, attaching to remote gdb
1222 (license license:lgpl3)))
1230 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1234 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1235 (build-system gnu-build-system)
1237 `(#:tests? #f ; no tests
1238 #:make-flags '("all" "asco-mpi")
1240 (modify-phases %standard-phases
1242 (add-before 'build 'fix-paths
1243 (lambda* (#:key inputs #:allow-other-keys)
1244 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1245 (substitute* '("errfunc.c" "asco.c")
1247 (string-append coreutils "/bin/cp "))
1249 (string-append coreutils "/bin/nice")))
1250 (substitute* "Makefile"
1251 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1253 (replace 'install ; no install target
1254 (lambda* (#:key outputs #:allow-other-keys)
1255 (for-each (lambda (file)
1256 (install-file file (string-append
1257 (assoc-ref outputs "out")
1259 '("asco" "asco-mpi" "asco-test"
1260 "tools/alter/alter" "tools/log/log"))
1263 `(("mpi" ,openmpi)))
1265 `(("coreutils-minimal" ,coreutils-minimal)))
1266 (home-page "http://asco.sourceforge.net/")
1267 (synopsis "SPICE circuit optimizer")
1269 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1270 high-performance parallel differential evolution (DE) optimization algorithm.")
1271 (license license:gpl2+)))
1273 (define-public libngspice
1274 ;; Note: The ngspice's build system does not allow us to build both the
1275 ;; library and the executables in one go. Thus, we have two packages.
1276 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1282 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1283 version "/ngspice-" version ".tar.gz"))
1286 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1287 (modules '((guix build utils)))
1288 ;; We remove the non-free cider and build without it.
1291 (delete-file-recursively "src/ciderlib")
1292 (delete-file "src/ciderinit")
1293 (substitute* "configure"
1294 (("src/ciderlib/Makefile") "")
1295 (("src/ciderlib/input/Makefile") "")
1296 (("src/ciderlib/support/Makefile") "")
1297 (("src/ciderlib/oned/Makefile") "")
1298 (("src/ciderlib/twod/Makefile") ""))
1300 (build-system gnu-build-system)
1302 `(;; No tests for libngspice exist.
1303 ;; The transient tests for ngspice fail.
1306 (modify-phases %standard-phases
1307 (add-after 'unpack 'patch-timestamps
1309 (substitute* "configure"
1310 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1312 (add-after 'unpack 'delete-program-manuals
1314 (substitute* "man/man1/Makefile.in"
1315 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1318 (add-after 'install 'delete-script-files
1319 (lambda* (#:key outputs #:allow-other-keys)
1320 (delete-file-recursively
1321 (string-append (assoc-ref outputs "out")
1322 "/share/ngspice/scripts")))))
1324 (list "--enable-openmp"
1327 "--with-readline=yes")))
1332 `(("libxaw" ,libxaw)
1334 ("readline" ,readline)))
1335 (home-page "http://ngspice.sourceforge.net/")
1336 (synopsis "Mixed-level/mixed-signal circuit simulator")
1338 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1339 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1340 provides code modeling support and simulation of digital components through
1341 an embedded event driven algorithm.")
1342 (license (list license:lgpl2.0+ ; code in frontend/numparam
1343 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1344 license:public-domain)))) ; xspice
1346 (define-public ngspice
1347 ;; The ngspice executables (see libngpsice above.)
1348 (package (inherit libngspice)
1351 (substitute-keyword-arguments (package-arguments libngspice)
1352 ((#:configure-flags flags)
1353 `(delete "--with-ngshared" ,flags))
1355 `(modify-phases ,phases
1356 (add-after 'unpack 'delete-include-files
1358 (substitute* "src/Makefile.in"
1359 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1360 "SUBDIRS = misc maths frontend spicelib"))
1362 (add-after 'install 'delete-cmpp-dlmain
1363 (lambda* (#:key outputs #:allow-other-keys)
1364 (for-each (lambda (file)
1366 (string-append (assoc-ref outputs "out")
1368 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1370 (delete 'delete-program-manuals)
1371 (delete 'delete-script-files)))))
1373 `(("libngspice" ,libngspice)
1374 ("readline" ,readline)))))
1376 (define trilinos-serial-xyce
1377 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1378 ;; keep it private. See
1379 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1380 ;; TODO: Remove when we have modular Trilinos packages?
1382 (name "trilinos-serial-xyce")
1385 (origin (method url-fetch)
1386 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1387 version "-Source.tar.gz"))
1390 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1391 (build-system cmake-build-system)
1393 `(#:out-of-source? #t
1395 (modify-phases %standard-phases
1396 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1398 (add-before 'validate-runpath 'delete-tribits
1399 (lambda* (#:key outputs #:allow-other-keys)
1400 (delete-file-recursively
1401 (string-append (assoc-ref outputs "out")
1402 "/lib/cmake/tribits"))
1405 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1406 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1407 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1408 "-DTrilinos_ENABLE_NOX=ON"
1409 "-DNOX_ENABLE_LOCA=ON"
1410 "-DTrilinos_ENABLE_EpetraExt=ON"
1411 "-DEpetraExt_BUILD_BTF=ON"
1412 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1413 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1414 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1415 "-DTrilinos_ENABLE_Ifpack=ON"
1416 "-DTrilinos_ENABLE_Isorropia=ON"
1417 "-DTrilinos_ENABLE_AztecOO=ON"
1418 "-DTrilinos_ENABLE_Belos=ON"
1419 "-DTrilinos_ENABLE_Teuchos=ON"
1420 "-DTeuchos_ENABLE_COMPLEX=ON"
1421 "-DTrilinos_ENABLE_Amesos=ON"
1422 "-DAmesos_ENABLE_KLU=ON"
1423 "-DAmesos_ENABLE_UMFPACK=ON"
1424 "-DTrilinos_ENABLE_Sacado=ON"
1425 "-DTrilinos_ENABLE_Kokkos=OFF"
1426 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1427 "-DTPL_ENABLE_AMD=ON"
1428 "-DTPL_ENABLE_UMFPACK=ON"
1429 "-DTPL_ENABLE_BLAS=ON"
1430 "-DTPL_ENABLE_LAPACK=ON")))
1432 `(("fortran" ,gfortran)
1437 ("suitesparse" ,suitesparse)))
1438 (home-page "https://trilinos.org")
1439 (synopsis "Engineering and scientific problems algorithms")
1441 "The Trilinos Project is an effort to develop algorithms and enabling
1442 technologies within an object-oriented software framework for the solution of
1443 large-scale, complex multi-physics engineering and scientific problems. A
1444 unique design feature of Trilinos is its focus on packages.")
1445 (license (list license:lgpl2.1+
1448 (define-public xyce-serial
1450 (name "xyce-serial")
1453 (origin (method url-fetch)
1454 (uri (string-append "https://archive.org/download/Xyce-"
1455 version "/Xyce-" version ".tar.gz"))
1458 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1459 (build-system gnu-build-system)
1464 "CXXFLAGS=-O3 -std=c++11"
1465 (string-append "ARCHDIR="
1466 (assoc-ref %build-inputs "trilinos")))))
1470 ("fortran" ,gfortran)))
1473 ("suitesparse" ,suitesparse)
1475 ("trilinos" ,trilinos-serial-xyce)))
1476 (home-page "https://xyce.sandia.gov/")
1477 (synopsis "High-performance analog circuit simulator")
1479 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1480 capable of solving extremely large circuit problems by supporting large-scale
1481 parallel computing platforms. It also supports serial execution.")
1482 (license license:gpl3+)))
1484 (define trilinos-parallel-xyce
1485 (package (inherit trilinos-serial-xyce)
1486 (name "trilinos-parallel-xyce")
1488 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1489 ((#:configure-flags flags)
1490 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1491 "-DTrilinos_ENABLE_Zoltan=ON"
1492 "-DTPL_ENABLE_MPI=ON")
1496 ,@(package-inputs trilinos-serial-xyce)))))
1498 (define-public xyce-parallel
1499 (package (inherit xyce-serial)
1500 (name "xyce-parallel")
1502 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1503 ((#:configure-flags flags)
1504 `(list "CXXFLAGS=-O3 -std=c++11"
1511 (assoc-ref %build-inputs "trilinos")))))))
1513 `(("mpi" ,openmpi)))
1515 `(("trilinos" ,trilinos-parallel-xyce)
1516 ,@(alist-delete "trilinos"
1517 (package-inputs xyce-serial))))))
1519 (define-public freehdl
1525 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1529 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1530 (build-system gnu-build-system)
1533 (modify-phases %standard-phases
1534 (add-before 'configure 'patch-pkg-config
1535 (lambda* (#:key inputs #:allow-other-keys)
1536 (substitute* "freehdl/freehdl-config"
1538 (string-append (assoc-ref inputs "pkg-config")
1541 (string-append (assoc-ref inputs "coreutils")
1544 (add-after 'patch-pkg-config 'setenv
1545 (lambda* (#:key inputs #:allow-other-keys)
1546 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1548 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1551 (add-after 'setenv 'patch-gvhdl
1553 (substitute* "v2cc/gvhdl.in"
1554 (("--mode=link") "--mode=link --tag=CXX")
1555 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1557 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1558 (lambda* (#:key inputs #:allow-other-keys)
1559 (substitute* "freehdl/freehdl-gennodes.in"
1561 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1562 (("\\(debug") ";(debug")
1563 (("\\(@ ") "(apply-emit")
1564 (("\\(@@ ") "(apply-mini-format"))
1566 (add-after 'configure 'patch-freehdl-pc
1567 (lambda* (#:key inputs #:allow-other-keys)
1568 (substitute* "freehdl.pc"
1570 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1573 (string-append "=" (assoc-ref inputs "libtool")
1576 (add-after 'install-scripts 'make-wrapper
1577 (lambda* (#:key inputs outputs #:allow-other-keys)
1578 (let ((out (assoc-ref outputs "out")))
1579 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1581 (wrap-program (string-append out "/bin/gvhdl")
1582 `("CPLUS_INCLUDE_PATH" ":" prefix
1583 (,(string-append (assoc-ref inputs "gcc-toolchain")
1585 `("LIBRARY_PATH" ":" prefix
1586 (,(string-append (assoc-ref inputs "gcc-toolchain")
1589 (,(string-append (assoc-ref inputs "gcc-toolchain")
1591 ,(string-append (assoc-ref inputs "coreutils")
1593 (wrap-program (string-append out "/bin/freehdl-config")
1594 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1597 `(("coreutils" ,coreutils)
1598 ("gcc-toolchain" ,gcc-toolchain)
1599 ("guile" ,guile-2.2)
1601 ("pkg-config" ,pkg-config)
1602 ("libtool" ,libtool)))
1604 `(("pkg-config-native" ,pkg-config)
1605 ("libtool-native" ,libtool)))
1606 (home-page "http://www.freehdl.seul.org/")
1607 (synopsis "VHDL simulator")
1609 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1610 VHDL'93 as well as VHDL'87 standards are supported.")
1611 (license (list license:gpl2+
1612 license:lgpl2.0+)))) ; freehdl's libraries
1615 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1616 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1617 ;; comment and update the package.
1618 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1622 (version (git-version "0.0.19" revision commit))
1626 (url "https://github.com/Qucs/qucs")
1629 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1630 (file-name (string-append name "-" version "-checkout"))))
1631 (build-system gnu-build-system)
1634 (modify-phases %standard-phases
1635 (add-before 'bootstrap 'patch-bootstrap
1637 (for-each patch-shebang
1640 "qucs-doc/bootstrap"
1641 "qucs-core/bootstrap"))
1643 (add-before 'configure 'patch-configure
1644 (lambda* (#:key inputs #:allow-other-keys)
1645 (substitute* "qucs/configure"
1646 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1648 (add-after 'patch-configure 'patch-scripts
1649 (lambda* (#:key inputs outputs #:allow-other-keys)
1650 (substitute* '("qucs/qucs/qucsdigi"
1651 "qucs/qucs/qucsdigilib"
1652 "qucs/qucs/qucsveri")
1654 (string-append (assoc-ref outputs "out") "/bin"))
1656 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1658 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1660 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1662 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1664 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1666 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1668 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1670 (add-before 'check 'pre-check
1672 ;; The test suite requires a running X server.
1673 (system "Xvfb :1 &")
1674 (setenv "DISPLAY" ":1")
1676 (add-after 'install 'make-wrapper
1677 (lambda* (#:key inputs outputs #:allow-other-keys)
1678 (let ((out (assoc-ref outputs "out")))
1679 ;; 'qucs' directly invokes gcc, hence this wrapping.
1680 (wrap-program (string-append out "/bin/qucs")
1681 `("CPLUS_INCLUDE_PATH" ":" prefix
1682 (,(string-append (assoc-ref inputs "gcc-toolchain")
1685 (,(string-append (assoc-ref inputs "gcc-toolchain")
1687 `("LIBRARY_PATH" ":" prefix
1688 (,(string-append (assoc-ref inputs "gcc-toolchain")
1690 `("ADMSXMLBINDIR" ":" prefix
1691 (,(string-append (assoc-ref inputs "adms") "/bin")))
1692 `("ASCOBINDIR" ":" prefix
1693 (,(string-append (assoc-ref inputs "asco") "/bin")))
1694 `("QUCS_OCTAVE" ":" prefix
1695 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1697 #:parallel-build? #f ; race condition
1698 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1700 `(("autoconf" ,autoconf)
1701 ("automake" ,automake)
1705 ("libtool-native" ,libtool)
1706 ("pkg-config" ,pkg-config)
1707 ("python" ,python-2) ; for tests
1708 ("matplotlib" ,python2-matplotlib) ; for tests
1709 ("numpy" ,python2-numpy) ; for tests
1710 ("xorg-server" ,xorg-server))) ; for tests
1714 ("coreutils" ,coreutils)
1715 ("freehdl" ,freehdl)
1716 ("gcc-toolchain" ,gcc-toolchain)
1717 ("iverilog" ,iverilog)
1718 ("libtool" ,libtool)
1719 ("octave" ,octave-cli)
1722 (home-page "http://qucs.sourceforge.net/")
1723 (synopsis "Circuit simulator with graphical user interface")
1725 "Qucs is a circuit simulator with graphical user interface. The software
1726 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1727 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1728 simulations are also supported.")
1729 (license license:gpl2+))))
1731 (define-public qucs-s
1737 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1739 (file-name (string-append name "-" version ".tar.gz"))
1742 "01dizf4rjciqc8x7bmv3kbhdlz90bm6n9m9fz7dbzqcwvszcs1hx"))))
1743 (build-system cmake-build-system)
1745 `(#:tests? #f ; no tests
1747 (modify-phases %standard-phases
1748 (add-before 'configure 'patch-scripts
1749 (lambda* (#:key inputs #:allow-other-keys)
1750 (substitute* '("qucs/qucsdigi"
1754 (string-append (assoc-ref inputs "qucs") "/bin"))
1756 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1758 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1760 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1762 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1764 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1766 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1768 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1770 (add-after 'patch-scripts 'patch-paths
1771 (lambda* (#:key inputs #:allow-other-keys)
1772 (substitute* "qucs/main.cpp"
1773 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1774 "\\+ \"qucsator\" \\+ executableSuffix"))
1775 (string-append "}{ QucsSettings.Qucsator = \""
1776 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1777 (((string-append "QucsSettings\\.XyceExecutable = "
1778 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1779 (string-append "}{ QucsSettings.XyceExecutable = \""
1780 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1781 (((string-append "else QucsSettings\\.XyceParExecutable = "
1782 "\"mpirun -np %p /usr/local"
1783 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1784 (string-append "QucsSettings.XyceParExecutable = \""
1785 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1786 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1787 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1788 (string-append "QucsSettings.NgspiceExecutable = " "\""
1789 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1790 (substitute* "qucs/extsimkernels/ngspice.cpp"
1791 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1792 (substitute* "qucs/qucs_actions.cpp"
1794 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1796 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1798 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1800 (add-after 'install 'install-scripts
1801 (lambda* (#:key inputs outputs #:allow-other-keys)
1804 (let ((file (string-append "../qucs_s-" ,version
1806 (out (assoc-ref outputs "out")))
1807 (install-file file (string-append out "/bin"))
1808 (chmod (string-append out "/bin/" script) #o555)))
1809 '("qucsdigi" "qucsdigilib" "qucsveri"))
1811 (add-after 'install-scripts 'make-wrapper
1812 (lambda* (#:key inputs outputs #:allow-other-keys)
1813 (let* ((out (assoc-ref outputs "out"))
1814 (file (string-append out "/bin/qucs-s"))
1815 (qucs (assoc-ref inputs "qucs"))
1816 (qucsator (string-append qucs "/bin/qucsator")))
1818 `("CPLUS_INCLUDE_PATH" ":" prefix
1819 (,(string-append (assoc-ref inputs "gcc-toolchain")
1822 (,(string-append (assoc-ref inputs "gcc-toolchain")
1824 `("LIBRARY_PATH" ":" prefix
1825 (,(string-append (assoc-ref inputs "gcc-toolchain")
1827 `("QUCSATOR" ":" prefix (,qucsator))
1828 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1829 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1831 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1833 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1835 (symlink qucsator (string-append out "/bin/qucsator"))
1838 `(("libtool-native" ,libtool)))
1842 ("coreutils" ,coreutils)
1843 ("freehdl" ,freehdl)
1844 ("gcc-toolchain" ,gcc-toolchain)
1845 ("iverilog" ,iverilog)
1846 ("libtool" ,libtool)
1848 ("ngspice" ,ngspice)
1849 ("octave" ,octave-cli)
1853 ("xyce-serial" ,xyce-serial)
1854 ("xyce-parallel" ,xyce-parallel)))
1855 (home-page "https://ra3xdh.github.io/")
1856 (synopsis "Circuit simulator with graphical user interface")
1858 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1859 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1860 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1861 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1862 (license license:gpl2+)))
1864 (define-public librepcb
1871 (uri (string-append "https://download.librepcb.org/releases/0.1.0/librepcb-"
1872 version "-source.zip"))
1875 "0affvwwgs1j2wx6bb3zfa2jbfxpckklr8cka2nkswca0p82wd3dv"))))
1876 (build-system gnu-build-system)
1878 `(("qtbase" ,qtbase)
1881 `(("qttools" ,qttools) ; for lrelease
1885 (modify-phases %standard-phases
1887 (lambda* (#:key inputs outputs #:allow-other-keys)
1890 (let ((lrelease (string-append (assoc-ref inputs "qttools")
1892 (out (assoc-ref outputs "out")))
1894 (string-append "QMAKE_LRELEASE=" lrelease)
1895 (string-append "PREFIX=" out)
1896 "../librepcb.pro")))))))
1897 (home-page "https://librepcb.org/")
1898 (synopsis "Electronic Design Automation tool")
1899 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
1900 software to develop printed circuit boards. It features human readable file
1901 formats and complete project management with library, schematic and board
1903 (license (list license:gpl3+
1904 license:boost1.0 ; libs/clipper,
1905 ; libs/optional/tests/catch.hpp,
1906 ; libs/sexpresso/tests/catch.hpp
1907 license:expat ; libs/delaunay-triangulation,
1908 ; libs/parseagle, libs/type_safe
1909 license:asl2.0 ; libs/fontobene, libs/googletest,
1911 license:isc ; libs/hoedown
1912 license:cc0 ; libs/optional, libs/sexpresso
1913 license:bsd-2 ; libs/optional/tests/catch.hpp
1914 license:lgpl2.1+)))) ; libs/quazip
1923 (url "https://github.com/markwal/GPX.git")
1927 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
1928 (build-system gnu-build-system)
1929 (home-page "https://github.com/markwal/GPX")
1930 (synopsis "Converting gcode to x3g files for 3D printing")
1932 "GPX is a post processing utility for converting gcode output from 3D
1933 slicing software to x3g files for standalone 3D printing on common 3D
1935 (license license:gpl2+)))