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, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
11 ;;; Copyright © 2018, 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
12 ;;; Copyright © 2018, 2019 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 ant)
41 #:use-module (guix build-system cmake)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system python)
44 #:use-module (gnu packages)
45 #:use-module (gnu packages algebra)
46 #:use-module (gnu packages autotools)
47 #:use-module (gnu packages base)
48 #:use-module (gnu packages bison)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages commencement)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages curl)
54 #:use-module (gnu packages flex)
55 #:use-module (gnu packages fontutils)
56 #:use-module (gnu packages fpga)
57 #:use-module (gnu packages freedesktop)
58 #:use-module (gnu packages gcc)
59 #:use-module (gnu packages gd)
60 #:use-module (gnu packages gettext)
61 #:use-module (gnu packages ghostscript)
62 #:use-module (gnu packages gl)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gnome)
65 #:use-module (gnu packages gperf)
66 #:use-module (gnu packages groff)
67 #:use-module (gnu packages gtk)
68 #:use-module (gnu packages guile)
69 #:use-module (gnu packages image)
70 #:use-module (gnu packages imagemagick)
71 #:use-module (gnu packages linux) ;FIXME: for pcb
72 #:use-module (gnu packages m4)
73 #:use-module (gnu packages maths)
74 #:use-module (gnu packages multiprecision)
75 #:use-module (gnu packages mpi)
76 #:use-module (gnu packages ncurses)
77 #:use-module (gnu packages perl)
78 #:use-module (gnu packages pkg-config)
79 #:use-module (gnu packages python)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages qt)
82 #:use-module (gnu packages readline)
83 #:use-module (gnu packages swig)
84 #:use-module (gnu packages tcl)
85 #:use-module (gnu packages texinfo)
86 #:use-module (gnu packages tls)
87 #:use-module (gnu packages tex)
88 #:use-module (gnu packages version-control)
89 #:use-module (gnu packages wxwidgets)
90 #:use-module (gnu packages xorg))
92 (define-public librecad
99 "https://github.com/LibreCAD/LibreCAD/archive/"
101 (file-name (string-append name "-" version ".tar.gz"))
104 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
105 (build-system gnu-build-system)
108 (modify-phases %standard-phases
109 ;; Without this patch boost complains that "make_array" is not a
110 ;; member of "boost::serialization".
111 (add-after 'unpack 'patch-boost-error
113 (substitute* "librecad/src/lib/math/lc_quadratic.h"
114 (("#include \"rs_vector.h\"" line)
116 "\n#include <boost/serialization/array_wrapper.hpp>")))
117 (substitute* "librecad/src/lib/math/rs_math.cpp"
118 (("#include <boost/numeric/ublas/matrix.hpp>" line)
119 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
122 ;; Fix build against Qt 5.11.
123 (add-after 'unpack 'add-missing-headers
125 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
126 (("#include <QPushButton>") "#include <QPushButton>
127 #include <QActionGroup>"))
129 (add-after 'unpack 'patch-paths
130 (lambda* (#:key outputs #:allow-other-keys)
131 (let ((out (assoc-ref outputs "out")))
132 (substitute* "librecad/src/lib/engine/rs_system.cpp"
133 (("/usr/share") (string-append out "/share"))))))
135 (lambda* (#:key inputs #:allow-other-keys)
136 (system* "qmake" (string-append "BOOST_DIR="
137 (assoc-ref inputs "boost")))))
139 (lambda* (#:key outputs #:allow-other-keys)
140 (let* ((out (assoc-ref outputs "out"))
141 (bin (string-append out "/bin"))
142 (share (string-append out "/share/librecad")))
144 (install-file "unix/librecad" bin)
146 (copy-recursively "unix/resources" share))
148 ;; Ensure that icons are found at runtime
149 (add-after 'install 'wrap-executable
150 (lambda* (#:key inputs outputs #:allow-other-keys)
151 (let* ((out (assoc-ref outputs "out"))
152 (qt '("qtbase" "qtsvg")))
153 (wrap-program (string-append out "/bin/librecad")
154 `("QT_PLUGIN_PATH" ":" prefix
155 ,(map (lambda (label)
156 (string-append (assoc-ref inputs label)
157 "/lib/qt5/plugins/"))
162 ("muparser" ,muparser)
163 ("freetype" ,freetype)
167 `(("pkg-config" ,pkg-config)
169 (home-page "http://librecad.org/")
170 (synopsis "Computer-aided design (CAD) application")
172 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
174 (license license:gpl2)))
176 (define-public geda-gaf
183 "http://ftp.geda-project.org/geda-gaf/unstable/v"
184 (version-major+minor version) "/"
185 version "/geda-gaf-" version ".tar.gz"))
188 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
189 (build-system gnu-build-system)
192 (modify-phases %standard-phases
193 ;; tests require a writable HOME
194 (add-before 'check 'set-home
196 (setenv "HOME" (getenv "TMPDIR"))
198 ;; FIXME: These two tests fail for unknown reasons. They return "2"
199 ;; when they should return "1".
200 (add-after 'unpack 'disable-failing-tests
202 (substitute* "utils/tests/gxyrs/tests.list"
203 (("^do_nothing.*") ""))
206 (let ((pcb (assoc-ref %build-inputs "pcb")))
207 (list (string-append "--with-pcb-datadir=" pcb "/share")
208 (string-append "--with-pcb-lib-path="
209 pcb "/share/pcb/pcblib-newlib:"
210 pcb "/share/pcb/newlib")))))
215 ("desktop-file-utils" ,desktop-file-utils)
216 ("shared-mime-info" ,shared-mime-info)
220 `(("pkg-config" ,pkg-config)
221 ("perl" ,perl))) ; for tests
222 (home-page "http://geda-project.org/")
223 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
225 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
226 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
227 which currently includes: gschem, a schematic capture program; gnetlist, a
228 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
229 gattrib, a spreadsheet programm that manipulates the properties of symbols of
230 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
231 tool to forward annotation from your schematic to layout using PCB; some minor
233 (license license:gpl2+)))
235 (define-public lepton-eda
236 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
237 ;; keep and to extend Guile support.
241 (version "1.9.5-20180820")
242 (home-page "https://github.com/lepton-eda/lepton-eda")
245 (uri (git-reference (url home-page) (commit version)))
248 "1ayaccvw18zh4g7a4x5jf6yxkphi5xafb0hpc732g59qkgwfcmlr"))
249 (file-name (git-file-name name version))))
251 `(("autoconf" ,autoconf)
252 ("automake" ,automake)
254 ("gettext" ,gnu-gettext)
258 ,@(package-native-inputs geda-gaf)))
259 ;; For now it's Guile 2.0, not 2.2.
261 (substitute-keyword-arguments (package-arguments geda-gaf)
262 ((#:configure-flags flags ''())
263 ;; When running "make", the POT files are built with the build time as
264 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
265 ;; files were updated and goes on to run "msgmerge"; as a result, the
266 ;; non-deterministic POT-Creation-Date finds its way into .po files,
267 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
268 ;; never runs. See <https://bugs.debian.org/792687>.
269 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
270 ((#:phases phases '%standard-phases)
271 `(modify-phases ,phases
272 (add-before 'bootstrap 'prepare
274 ;; Some of the scripts there are invoked by autogen.sh.
275 (for-each patch-shebang (find-files "build-tools"))
277 ;; Make sure 'msgmerge' can modify the PO files.
278 (for-each (lambda (po)
280 (find-files "." "\\.po$"))
282 ;; This would normally be created by invoking 'git', but it
283 ;; doesn't work here.
284 (call-with-output-file "version.h"
286 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
287 ,(string-drop version
288 (+ 1 (string-index version #\-))))
289 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
290 ,(string-take version
291 (string-index version #\-)))
292 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
295 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
296 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
297 design, schematic capture, simulation, prototyping, and production. Lepton
298 EDA includes tools for schematic capture, attribute management, bill of
299 materials (BOM) generation, netlisting into over 20 netlist formats, analog
300 and digital simulation, and printed circuit board (PCB) layout, and many other
309 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
310 "/pcb-" version ".tar.gz"))
313 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
314 (build-system gnu-build-system)
317 (modify-phases %standard-phases
318 (add-after 'unpack 'use-wish8.6
320 (substitute* "configure"
321 (("wish85") "wish8.6"))
323 ;; It checks for "xhost", which we don't have. This shouldn't
324 ;; matter, because the test is supposed to be skipped, but it causes
325 ;; "run_tests.sh" (and thus the "check" phase) to fail.
326 (add-after 'unpack 'fix-check-for-display
328 (substitute* "tests/run_tests.sh"
329 (("have_display=no") "have_display=yes"))
331 (add-after 'install 'wrap
332 (lambda* (#:key inputs outputs #:allow-other-keys)
333 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
334 ;; fix of the mesa package we wrap the pcb executable such that
335 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
336 (let* ((out (assoc-ref outputs "out"))
337 (path (string-append (assoc-ref inputs "udev") "/lib")))
338 (wrap-program (string-append out "/bin/pcb")
339 `("LD_LIBRARY_PATH" ":" prefix (,path))))
341 (add-before 'check 'pre-check
344 (setenv "DISPLAY" ":1")
349 ("udev" ,eudev) ;FIXME: required by mesa
353 ("gtkglext" ,gtkglext)
354 ("desktop-file-utils" ,desktop-file-utils)
355 ("shared-mime-info" ,shared-mime-info)
358 `(("pkg-config" ,pkg-config)
359 ("intltool" ,intltool)
363 ("imagemagick" ,imagemagick)
365 ("ghostscript" ,ghostscript)
366 ("xvfb" ,xorg-server)))
367 (home-page "http://pcb.geda-project.org/")
368 (synopsis "Design printed circuit board layouts")
370 "GNU PCB is an interactive tool for editing printed circuit board
371 layouts. It features a rats-nest implementation, schematic/netlist import,
372 and design rule checking. It also includes an autorouter and a trace
373 optimizer; and it can produce photorealistic and design review images.")
374 (license license:gpl2+)))
376 (define-public pcb-rnd
377 (package (inherit pcb)
382 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
383 "pcb-rnd-" version ".tar.gz"))
386 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
388 `(#:tests? #f ; no check target
390 (modify-phases %standard-phases
391 (add-after 'unpack 'cc-is-gcc
392 (lambda _ (setenv "CC" "gcc") #t))
394 ;; The configure script doesn't tolerate most of our configure flags.
395 (lambda* (#:key outputs #:allow-other-keys)
396 (invoke "sh" "configure"
397 (string-append "--prefix="
398 (assoc-ref outputs "out"))))))))
399 (home-page "http://repo.hu/projects/pcb-rnd/")
400 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
401 featuring various improvements and bug fixes.")))
403 (define-public fastcap
406 (version "2.0-18Sep92")
408 (method url-fetch/tarbomb)
409 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
410 name "-" version ".tgz"))
413 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
415 ;; Remove a non-free file.
417 (delete-file "doc/psfig.sty")
419 (patches (search-patches "fastcap-mulSetup.patch"
420 "fastcap-mulGlobal.patch"))))
421 (build-system gnu-build-system)
423 ;; FIXME: with texlive-tiny citation references are rendered as question
424 ;; marks. During the build warnings like these are printed:
425 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
426 `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts)))
427 ("ghostscript" ,ghostscript)))
429 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
431 #:tests? #f ;; no tests-suite
432 #:modules ((srfi srfi-1)
433 ,@%gnu-build-system-modules)
435 (modify-phases %standard-phases
436 (add-after 'build 'make-doc
438 (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
439 (add-before 'make-doc 'fix-doc
441 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
442 (substitute* (find-files "doc" "\\.tex")
443 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
445 (string-append "\\includegraphics[scale=" scale "]{"
447 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
449 (string-append "\\includegraphics[width=" width "]{"
451 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
453 (string-append "\\includegraphics[height=" height "]{"
455 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
456 (string-append "\\includegraphics{" file "}")))
457 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
458 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
460 (string-append "\\documentclass[" options "]{"
462 "\\usepackage{graphicx}\n"
463 "\\usepackage{robinspace}"))
464 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
465 (string-append "%" all))
466 (("\\\\setstretch\\{.*\\}" all)
467 (string-append "%" all)))
470 (add-before 'install 'clean-bin
472 (delete-file (string-append (getcwd) "/bin/README"))
474 (add-before 'install 'make-pdf
476 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
477 (with-directory-excursion "doc"
479 (for-each (lambda (file)
480 (invoke "dvips" file "-o"))
481 (find-files "." "\\.dvi"))
482 (for-each (lambda (file)
483 (invoke "ps2pdf" file))
484 '("mtt.ps" "ug.ps" "tcad.ps"))
485 (invoke "make" "clean")))))
487 (lambda* (#:key outputs #:allow-other-keys)
488 (let* ((out (assoc-ref outputs "out"))
489 (data (string-append out "/share"))
490 (bin (string-append out "/bin"))
491 (doc (string-append data "/doc/" ,name "-" ,version))
492 (examples (string-append doc "/examples")))
493 (with-directory-excursion "bin"
494 (for-each (lambda (f)
495 (install-file f bin))
496 (find-files "." ".*")))
497 (copy-recursively "doc" doc)
498 (copy-recursively "examples" examples)
500 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
501 (synopsis "Multipole-accelerated capacitance extraction program")
503 "Fastcap is a capacitance extraction program based on a
504 multipole-accelerated algorithm.")
505 (license (license:non-copyleft #f "See fastcap.c."))))
507 (define-public fasthenry
510 (version "3.0-12Nov96")
513 (file-name (string-append name "-" version ".tar.gz"))
515 "http://www.rle.mit.edu/cpg/codes/" name
516 "-" version ".tar.z"))
518 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
519 (patches (search-patches "fasthenry-spAllocate.patch"
520 "fasthenry-spBuild.patch"
521 "fasthenry-spUtils.patch"
522 "fasthenry-spSolve.patch"
523 "fasthenry-spFactor.patch"))))
524 (build-system gnu-build-system)
526 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
528 #:tests? #f ;; no tests-suite
529 #:modules ((srfi srfi-1)
530 ,@%gnu-build-system-modules)
532 (modify-phases %standard-phases
535 (lambda* (#:key outputs #:allow-other-keys)
536 (let* ((out (assoc-ref outputs "out"))
537 (data (string-append out "/share"))
538 (bin (string-append out "/bin"))
539 (doc (string-append data "/doc/" ,name "-" ,version))
540 (examples (string-append doc "/examples")))
541 (with-directory-excursion "bin"
542 (for-each (lambda (f)
543 (install-file f bin))
544 (find-files "." ".*")))
545 (copy-recursively "doc" doc)
546 (copy-recursively "examples" examples)
548 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
549 (synopsis "Multipole-accelerated inductance analysis program")
551 "Fasthenry is an inductance extraction program based on a
552 multipole-accelerated algorithm.")
553 (license (license:non-copyleft #f "See induct.c."))))
555 (define-public fritzing
562 (url "https://github.com/fritzing/fritzing-app.git")
564 (file-name (git-file-name name version))
567 "0hpyc550xfhr6gmnc85nq60w00rm0ljm0y744dp0z88ikl04f4s3"))))
568 (build-system gnu-build-system)
571 (modify-phases %standard-phases
573 (lambda* (#:key inputs outputs #:allow-other-keys)
574 (copy-recursively (assoc-ref inputs "fritzing-parts-db")
576 ;; Make compatible with libgit2 > 0.24
577 (substitute* "src/version/partschecker.cpp"
578 (("error = git_remote_connect\\(remote, GIT_DIRECTION_FETCH, &callbacks\\)")
579 "error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks, NULL, NULL)"))
581 ;; Use system libgit2 and boost.
582 (substitute* "phoenix.pro"
583 (("^LIBGIT2INCLUDE =.*")
584 (string-append "LIBGIT2INCLUDE="
585 (assoc-ref inputs "libgit2") "/include\n"))
586 (("^ LIBGIT2LIB =.*")
587 (string-append " LIBGIT2LIB="
588 (assoc-ref inputs "libgit2") "/lib\n")))
589 ;; This file checks for old versions of Boost, insisting on
590 ;; having us download the boost sources and placing them in the
592 (substitute* "pri/utils.pri"
593 (("error\\(") "message("))
595 (let ((out (assoc-ref outputs "out")))
597 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib")
598 (string-append "PREFIX=" out)
602 ("qtserialport" ,qtserialport)
611 (url "https://github.com/fritzing/fritzing-parts.git")
613 (file-name (git-file-name "fritzing-parts" version))
616 "1d2v8k7p176j0lczx4vx9n9gbg3vw09n2c4b6w0wj5wqmifywhc1"))))))
617 (home-page "http://fritzing.org")
618 (synopsis "Electronic circuit design")
620 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
621 software with a low entry barrier, suited for the needs of makers and
622 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
623 library with many commonly used high-level components. Fritzing makes it very
624 easy to communicate about circuits, as well as to turn them into PCB layouts
625 ready for production.")
626 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
627 ;; released under GPLv3+.
628 (license (list license:gpl3+ license:cc-by-sa3.0))))
636 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
637 version "/gerbv-" version ".tar.gz"))
640 "1d2k43k7i4yvbpi4sw1263a8d0q98z2n7aqhmpinpkih8a681vn5"))))
641 (build-system gnu-build-system)
643 `(("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
644 ("pkg-config" ,pkg-config)))
648 ("desktop-file-utils" ,desktop-file-utils)))
649 (home-page "http://gerbv.geda-project.org/")
650 (synopsis "Gerber file viewer")
652 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
653 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
654 you load several files on top of each other, do measurements on the displayed
655 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
656 as well as pick-place files.")
657 (license license:gpl2+)))
659 (define-public translate2geda
660 ;; There has been no formal release yet.
661 (let ((commit "4c19e7eefa338cea8f1ee999ea8b37f8d0698169")
664 (name "translate2geda")
665 (version (git-version "0" revision commit))
669 (url "https://github.com/erichVK5/translate2geda.git")
671 (file-name (git-file-name name version))
674 "1h062bbpw8nk0jamkya1k4lsgaia796jyviiz2gkdi6k1bxhwgpa"))))
675 (build-system ant-build-system)
677 `(#:tests? #f ; there are no tests
678 #:jar-name "translate2geda.jar"
680 #:main-class "translate2geda"
682 (modify-phases %standard-phases
683 (add-after 'install 'install-bin
684 (lambda* (#:key inputs outputs #:allow-other-keys)
685 (let* ((out (assoc-ref outputs "out"))
686 (bin (string-append out "/bin"))
687 (wrapper (string-append bin "/translate2geda")))
689 (with-output-to-file wrapper
691 (format #t "#!/bin/sh~%exec ~a -jar ~a/share/java/translate2geda.jar"
692 (which "java") out)))
693 (chmod wrapper #o555))
695 (home-page "https://github.com/erichVK5/translate2geda")
696 (synopsis "Utility for converting symbol and footprint formats to gEDA")
698 "This package provides a utility for converting Kicad (@file{.mod},
699 @file{.lib}), Eagle (@file{.lbr}), gerber (@file{.gbr}, etc..),
700 BXL (@file{.bxl}), IBIS (@file{.ibs}), symdef, LT-Spice (@file{.asc}),
701 QUCS (@file{.sch}), and BSDL (@file{.bsd}) symbols and footprints and EggBot
703 (license license:gpl2+))))
705 (define-public libfive
706 (let ((commit "9d857d1923abecb0e5935b9287d22661f6efaac5")
710 (version (git-version "0" revision commit))
714 (url "https://github.com/libfive/libfive")
718 "1r40kyx30wz31cwwlfvfh7fgqkxq3n8dxhswpi9qpf4r5h3l8wsn"))
719 (file-name (git-file-name name version))
721 ;; Remove bundled catch since we provide our own.
723 (delete-file "libfive/test/catch.hpp")
725 (build-system cmake-build-system)
727 `(#:test-target "libfive-test"
729 (modify-phases %standard-phases
730 (add-after 'unpack 'remove-native-compilation
732 (substitute* "CMakeLists.txt" (("-march=native") ""))
735 `(("pkg-config" ,pkg-config)))
738 ("catch" ,catch-framework)
742 ("guile" ,guile-2.2)))
743 (home-page "https://libfive.com")
744 (synopsis "Tool for programmatic computer-aided design")
746 "Libfive is a tool for programmatic computer-aided design (CAD). In
747 libfive, solid models are defined as Scheme scripts, and there are no opaque
748 function calls into the geometry kernel: everything is visible to the user.
749 Even fundamental, primitive shapes are represented as code in the user-level
751 (license (list license:lgpl2.1+ ;library
752 license:gpl2+))))) ;Guile bindings and GUI
755 (deprecated-package "ao-cad" libfive))
764 (file-name (string-append name "-" version ".tar.xz"))
766 "https://launchpad.net/kicad/" (version-major+minor version)
767 "/" version "/+download/kicad-" version ".tar.xz"))
769 (base32 "10605rr10x0353n6yk2z095ydnkd1i6j1ncbq64pfxdn5vkhcd1g"))))
770 (build-system cmake-build-system)
772 `(#:out-of-source? #t
773 #:tests? #f ; no tests
774 #:build-type "Release"
776 (list "-DKICAD_STABLE_VERSION=ON"
777 "-DKICAD_REPO_NAME=stable"
778 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
779 "-DKICAD_SCRIPTING=ON"
780 "-DKICAD_SCRIPTING_MODULES=ON"
781 "-DKICAD_SCRIPTING_WXPYTHON=ON"
782 ;; Has to be set explicitly, as we don't have the wxPython
783 ;; headers in the wxwidgets store item, but in wxPython.
784 (string-append "-DCMAKE_CXX_FLAGS=-I"
785 (assoc-ref %build-inputs "wxpython")
787 ,(version-major+minor
788 (package-version python2-wxpython)))
789 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
791 ;; TODO: Enable this when CA certs are working with curl.
792 "-DBUILD_GITHUB_PLUGIN=OFF")
794 (modify-phases %standard-phases
795 (add-after 'unpack 'adjust-boost-include
797 ;; The location of this header changed in Boost 1.66.
798 (substitute* "3d-viewer/3d_cache/3d_cache.cpp"
799 (("boost/uuid/sha1\\.hpp")
800 "boost/uuid/detail/sha1.hpp"))
802 (add-after 'install 'wrap-program
803 ;; Ensure correct Python at runtime.
804 (lambda* (#:key inputs outputs #:allow-other-keys)
805 (let* ((out (assoc-ref outputs "out"))
806 (python (assoc-ref inputs "python"))
807 (file (string-append out "/bin/kicad"))
811 ,(version-major+minor
812 (package-version python))
814 (getenv "PYTHONPATH"))))
816 `("PYTHONPATH" ":" prefix (,path))
818 (,(string-append python "/bin:")))))
822 ("gettext" ,gnu-gettext)
823 ("pkg-config" ,pkg-config)
829 ("desktop-file-utils" ,desktop-file-utils)
832 ("hicolor-icon-theme" ,hicolor-icon-theme)
833 ("libngspice" ,libngspice)
836 ("opencascade-oce" ,opencascade-oce)
839 ("wxwidgets" ,wxwidgets-gtk2)
840 ("wxpython" ,python2-wxpython)))
841 (home-page "http://kicad-pcb.org/")
842 (synopsis "Electronics Design Automation Suite")
843 (description "Kicad is a program for the formation of printed circuit
844 boards and electrical circuits. The software has a number of programs that
845 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
846 electrical diagrams), gerbview (viewing Gerber files) and others.")
847 (license license:gpl3+)))
849 (define-public kicad-library
850 (let ((version "4.0.7"))
852 (name "kicad-library")
858 "https://kicad-downloads.s3.cern.ch/libraries/kicad-library-"
861 (base32 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
862 (build-system cmake-build-system)
864 `(#:out-of-source? #t
865 #:tests? #f ; no tests
867 (modify-phases %standard-phases
868 (add-after 'install 'install-footprints ; from footprints tarball
869 (lambda* (#:key inputs outputs #:allow-other-keys)
871 (assoc-ref inputs "kicad-footprints")
872 "-C" (string-append (assoc-ref outputs "out")
873 "/share/kicad/modules")
874 "--strip-components=1")))
875 ;; We change the default global footprint file, which is generated if
876 ;; it doesn't exist in user's home directory, from the one using the
877 ;; github plugin, to the one using the KISYSMOD environment path.
878 (add-after 'install-footprints 'use-pretty-footprint-table
879 (lambda* (#:key outputs #:allow-other-keys)
880 (let* ((out (assoc-ref outputs "out"))
881 (template-dir (string-append out "/share/kicad/template"))
882 (fp-lib-table (string-append template-dir "/fp-lib-table")))
883 (delete-file fp-lib-table)
884 (copy-file (string-append fp-lib-table ".for-pretty")
888 (list (search-path-specification
889 (variable "KISYSMOD") ; footprint path
890 (files '("share/kicad/modules")))
891 (search-path-specification
892 (variable "KISYS3DMOD") ; 3D model path
893 (files '("share/kicad/modules/packages3d")))))
894 ;; Kicad distributes footprints in a separate tarball.
896 `(("kicad-footprints"
900 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
904 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
905 (home-page "http://kicad-pcb.org/")
906 (synopsis "Libraries for kicad")
907 (description "This package provides Kicad component, footprint and 3D
908 render model libraries.")
909 (license license:lgpl2.0+))))
911 (define-public kicad-symbols
913 (name "kicad-symbols")
918 (url "https://github.com/KiCad/kicad-symbols.git")
920 (file-name (git-file-name name version))
923 "1rjh2pjcrc3bhcgyyskj5pssm7vffrjk0ymwr70fb7sjpmk96yjk"))))
924 (build-system cmake-build-system)
926 `(#:tests? #f)) ; No tests exist
927 (home-page "http://kicad-pcb.org/")
928 (synopsis "Official KiCad schematic symbol libraries for KiCad 5")
929 (description "This package contains the official KiCad schematic symbol
930 libraries for KiCad 5.")
931 ;; 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'."
932 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
933 (license license:cc-by-sa4.0)))
935 (define-public linsmith
942 "mirror://sourceforge/linsmith/linsmith/linsmith-"
943 version "/linsmith-" version ".tar.gz"))
946 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
947 (build-system gnu-build-system)
949 `(("pkg-config" ,pkg-config)
951 ("libgnome" ,libgnomeui)))
952 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
953 (synopsis "Smith Charting program")
954 (description "LinSmith is a Smith Charting program, mainly designed for
955 educational use. As such, there is an emphasis on capabilities that improve
956 the 'showing the effect of'-style of operation.")
957 (license license:gpl2+)))
966 (uri (string-append "http://libvolk.org/releases/volk-"
970 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
971 (build-system cmake-build-system)
975 `(("python-2" ,python-2)
976 ("python2-cheetah" ,python2-cheetah)))
977 (home-page "http://libvolk.org/")
978 (synopsis "Vector-Optimized Library of Kernels")
980 "@code{volk} contains procedures with machine-specific optimizations
981 for mathematical functions. It also provides an machine-independent
982 interface to select the best such procedures to use on a given system.")
983 (license license:gpl3+)))
985 (define-public minicom
992 (uri (string-append "https://alioth.debian.org/frs/download.php/"
993 "file/4215/" name "-" version ".tar.gz"))
996 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
997 (build-system gnu-build-system)
999 `(#:configure-flags '("--enable-lock-dir=/var/lock")
1001 (modify-phases %standard-phases
1002 (add-after 'unpack 'patch-lock-check
1004 (substitute* "configure"
1005 (("test -d [$]UUCPLOCK") "true"))
1008 `(("ncurses" ,ncurses)))
1009 (home-page "https://alioth.debian.org/projects/minicom/")
1010 (synopsis "Serial terminal emulator")
1011 (description "@code{minicom} is a serial terminal emulator.")
1012 (license license:gpl2+)))
1014 (define-public harminv
1021 (string-append "https://github.com/stevengj/harminv/"
1022 "releases/download/v" version "/"
1023 name "-" version ".tar.gz"))
1026 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
1027 (build-system gnu-build-system)
1029 `(#:configure-flags '("--enable-shared")
1031 (modify-phases %standard-phases
1032 (add-before 'configure 'fix-tests
1034 (substitute* "./sines-test.sh"
1035 ; change test frequency range - default fails
1036 (("0\\.15") "0.16"))
1039 `(("fortran" ,gfortran)))
1041 `(("lapack" ,lapack)))
1042 (home-page "https://github.com/stevengj/harminv")
1043 (synopsis "Harmonic inversion solver")
1045 "Harminv is a free program (and accompanying library) to solve the problem of
1046 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
1047 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
1048 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
1049 (license license:gpl2+)))
1051 (define-public guile-libctl
1053 (name "guile-libctl")
1059 "https://github.com/NanoComp/libctl/releases/download/v"
1060 version "/libctl-" version ".tar.gz"))
1063 "0x8r56lpfq83kfbq28vr25icl19xpfd6fjrxzcpdmv30l9pash83"))))
1064 (build-system gnu-build-system)
1066 `(#:configure-flags '("--enable-shared")))
1068 `(("fortran" ,gfortran)))
1070 `(("guile" ,guile-2.2)))
1071 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
1072 (synopsis "Flexible control files implementation for scientific simulations")
1074 "Libctl is a Guile-based library implementing flexible control files
1075 for scientific simulations.")
1076 (license license:gpl2+)))
1086 "https://github.com/NanoComp/mpb/releases/download/v"
1087 version "/mpb-" version ".tar.gz"))
1090 "1jgrb7dd6qs6j6y1gnxmdgrh79l2bvqa6nk60a4pw1annsks4brd"))))
1091 (build-system gnu-build-system)
1094 (list (string-append "--with-libctl="
1095 (assoc-ref %build-inputs "libctl")
1097 "--enable-shared")))
1099 `(("fortran" ,gfortran)
1100 ("pkg-config" ,pkg-config)
1105 ("guile" ,guile-2.2)
1108 ("libctl" ,guile-libctl)
1109 ("readline" ,readline)
1111 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1112 (synopsis "Computes band structures and electromagnetic modes of dielectric
1115 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1116 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1117 fully-vectorial and three-dimensional methods.")
1118 (license license:gpl2+)))
1128 "https://github.com/NanoComp/meep/releases/download/v"
1129 version "/meep-" version ".tar.gz"))
1132 "14zyxmm3p80j5fz5b89sl7hgkgcisqjny5hjh4pi274ziqjqz8bm"))))
1133 (build-system gnu-build-system)
1136 (list (string-append "--with-libctl="
1137 (assoc-ref %build-inputs "libctl")
1140 `(("fortran" ,gfortran)
1141 ("pkg-config" ,pkg-config)
1146 ("guile" ,guile-2.2)
1147 ("harminv" ,harminv)
1150 ("libctl" ,guile-libctl)
1153 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1154 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1156 "Meep is a finite-difference time-domain (FDTD) simulation software package
1157 developed at MIT to model electromagnetic systems.")
1158 (license license:gpl2+)))
1168 "mirror://sourceforge/mot-adms/adms-source/"
1169 (version-major+minor version) "/adms-" version ".tar.gz"))
1172 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1173 (build-system gnu-build-system)
1177 (home-page "https://sourceforge.net/projects/mot-adms")
1178 (synopsis "Automatic device model synthesizer")
1180 "ADMS is a code generator that converts electrical compact device models
1181 specified in high-level description language into ready-to-compile C code for
1182 the API of spice simulators. Based on transformations specified in XML
1183 language, ADMS transforms Verilog-AMS code into other target languages.")
1184 (license license:gpl3)))
1186 (define-public capstone
1192 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1194 (file-name (string-append name "-" version ".tar.gz"))
1197 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
1198 (build-system gnu-build-system)
1201 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1204 (modify-phases %standard-phases
1205 (delete 'configure) ; no configure script
1206 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1207 (add-before 'build 'fix-cstool-ldflags
1208 (lambda* (#:key outputs #:allow-other-keys)
1209 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1210 (assoc-ref outputs "out") "/lib"))
1212 (home-page "https://www.capstone-engine.org")
1213 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1215 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1216 framework. Capstone can disassemble machine code for many supported architectures
1217 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1218 bindings for Python, Java, OCaml and more.")
1219 (license license:bsd-3)))
1221 ;; FIXME: This package has a timestamp embedded in
1222 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1223 (define-public python-capstone
1226 (name "python-capstone")
1228 `(("capstone" ,capstone)))
1229 (build-system python-build-system)
1232 (modify-phases %standard-phases
1233 (add-after 'unpack 'chdir-and-fix-setup-py
1235 (chdir "bindings/python")
1236 ;; Do not build the library again, because we already have it.
1237 (substitute* "setup.py" ((".* build_libraries.*") ""))
1238 ;; This substitution tells python-capstone where to find the
1240 (substitute* "capstone/__init__.py"
1241 (("pkg_resources.resource_filename.*")
1242 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1245 (define-public python2-capstone
1246 (package-with-python2 python-capstone))
1248 (define-public radare2
1254 (uri (string-append "https://radare.mikelloc.com/get/" version "/"
1255 "radare2-" version ".tar.gz"))
1258 "174x5545fw2nyf000gd46hi7rx2bn3bw5bsnvizn9yi99pn7m4mw"))
1259 (modules '((guix build utils)))
1262 (substitute* "libr/asm/p/Makefile"
1263 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1264 (substitute* "libr/parse/p/Makefile"
1265 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1266 (substitute* "libr/bin/p/Makefile"
1267 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1269 (build-system gnu-build-system)
1271 '(#:tests? #f ; tests require git and network access
1273 (modify-phases %standard-phases
1274 (add-before 'configure 'mklibdir
1275 (lambda* (#:key inputs #:allow-other-keys)
1276 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1279 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1280 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1284 `(("openssl" ,openssl)
1287 ("capstone" ,capstone)))
1289 `(("pkg-config" ,pkg-config)))
1290 (home-page "https://radare.org/")
1291 (synopsis "Portable reversing framework")
1293 "Radare project started as a forensics tool, a scriptable commandline
1294 hexadecimal editor able to open disk files, but later support for analyzing
1295 binaries, disassembling code, debugging programs, attaching to remote gdb
1297 (license license:lgpl3)))
1305 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1309 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1310 (build-system gnu-build-system)
1312 `(#:tests? #f ; no tests
1313 #:make-flags '("all" "asco-mpi")
1315 (modify-phases %standard-phases
1317 (add-before 'build 'fix-paths
1318 (lambda* (#:key inputs #:allow-other-keys)
1319 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1320 (substitute* '("errfunc.c" "asco.c")
1322 (string-append coreutils "/bin/cp "))
1324 (string-append coreutils "/bin/nice")))
1325 (substitute* "Makefile"
1326 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1328 (replace 'install ; no install target
1329 (lambda* (#:key outputs #:allow-other-keys)
1330 (for-each (lambda (file)
1331 (install-file file (string-append
1332 (assoc-ref outputs "out")
1334 '("asco" "asco-mpi" "asco-test"
1335 "tools/alter/alter" "tools/log/log"))
1338 `(("mpi" ,openmpi)))
1340 `(("coreutils-minimal" ,coreutils-minimal)))
1341 (home-page "http://asco.sourceforge.net/")
1342 (synopsis "SPICE circuit optimizer")
1344 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1345 high-performance parallel differential evolution (DE) optimization algorithm.")
1346 (license license:gpl2+)))
1348 (define-public libngspice
1349 ;; Note: The ngspice's build system does not allow us to build both the
1350 ;; library and the executables in one go. Thus, we have two packages.
1351 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1357 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1358 version "/ngspice-" version ".tar.gz"))
1361 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1362 (modules '((guix build utils)))
1363 ;; We remove the non-free cider and build without it.
1366 (delete-file-recursively "src/ciderlib")
1367 (delete-file "src/ciderinit")
1368 (substitute* "configure"
1369 (("src/ciderlib/Makefile") "")
1370 (("src/ciderlib/input/Makefile") "")
1371 (("src/ciderlib/support/Makefile") "")
1372 (("src/ciderlib/oned/Makefile") "")
1373 (("src/ciderlib/twod/Makefile") ""))
1375 (build-system gnu-build-system)
1377 `(;; No tests for libngspice exist.
1378 ;; The transient tests for ngspice fail.
1381 (modify-phases %standard-phases
1382 (add-after 'unpack 'patch-timestamps
1384 (substitute* "configure"
1385 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1387 (add-after 'unpack 'delete-program-manuals
1389 (substitute* "man/man1/Makefile.in"
1390 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1393 (add-after 'install 'delete-script-files
1394 (lambda* (#:key outputs #:allow-other-keys)
1395 (delete-file-recursively
1396 (string-append (assoc-ref outputs "out")
1397 "/share/ngspice/scripts")))))
1399 (list "--enable-openmp"
1402 "--with-readline=yes")))
1407 `(("libxaw" ,libxaw)
1409 ("readline" ,readline)))
1410 (home-page "http://ngspice.sourceforge.net/")
1411 (synopsis "Mixed-level/mixed-signal circuit simulator")
1413 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1414 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1415 provides code modeling support and simulation of digital components through
1416 an embedded event driven algorithm.")
1417 (license (list license:lgpl2.0+ ; code in frontend/numparam
1418 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1419 license:public-domain)))) ; xspice
1421 (define-public ngspice
1422 ;; The ngspice executables (see libngpsice above.)
1423 (package (inherit libngspice)
1426 (substitute-keyword-arguments (package-arguments libngspice)
1427 ((#:configure-flags flags)
1428 `(delete "--with-ngshared" ,flags))
1430 `(modify-phases ,phases
1431 (add-after 'unpack 'delete-include-files
1433 (substitute* "src/Makefile.in"
1434 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1435 "SUBDIRS = misc maths frontend spicelib"))
1437 (add-after 'install 'delete-cmpp-dlmain
1438 (lambda* (#:key outputs #:allow-other-keys)
1439 (for-each (lambda (file)
1441 (string-append (assoc-ref outputs "out")
1443 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1445 (delete 'delete-program-manuals)
1446 (delete 'delete-script-files)))))
1448 `(("libngspice" ,libngspice)
1449 ("readline" ,readline)))))
1451 (define trilinos-serial-xyce
1452 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1453 ;; keep it private. See
1454 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1455 ;; TODO: Remove when we have modular Trilinos packages?
1457 (name "trilinos-serial-xyce")
1460 (origin (method url-fetch)
1461 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1462 version "-Source.tar.gz"))
1465 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1466 (build-system cmake-build-system)
1468 `(#:out-of-source? #t
1470 (modify-phases %standard-phases
1471 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1473 (add-before 'validate-runpath 'delete-tribits
1474 (lambda* (#:key outputs #:allow-other-keys)
1475 (delete-file-recursively
1476 (string-append (assoc-ref outputs "out")
1477 "/lib/cmake/tribits"))
1480 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1481 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1482 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1483 "-DTrilinos_ENABLE_NOX=ON"
1484 "-DNOX_ENABLE_LOCA=ON"
1485 "-DTrilinos_ENABLE_EpetraExt=ON"
1486 "-DEpetraExt_BUILD_BTF=ON"
1487 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1488 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1489 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1490 "-DTrilinos_ENABLE_Ifpack=ON"
1491 "-DTrilinos_ENABLE_Isorropia=ON"
1492 "-DTrilinos_ENABLE_AztecOO=ON"
1493 "-DTrilinos_ENABLE_Belos=ON"
1494 "-DTrilinos_ENABLE_Teuchos=ON"
1495 "-DTeuchos_ENABLE_COMPLEX=ON"
1496 "-DTrilinos_ENABLE_Amesos=ON"
1497 "-DAmesos_ENABLE_KLU=ON"
1498 "-DAmesos_ENABLE_UMFPACK=ON"
1499 "-DTrilinos_ENABLE_Sacado=ON"
1500 "-DTrilinos_ENABLE_Kokkos=OFF"
1501 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1502 "-DTPL_ENABLE_AMD=ON"
1503 "-DTPL_ENABLE_UMFPACK=ON"
1504 "-DTPL_ENABLE_BLAS=ON"
1505 "-DTPL_ENABLE_LAPACK=ON")))
1507 `(("fortran" ,gfortran)
1512 ("suitesparse" ,suitesparse)))
1513 (home-page "https://trilinos.org")
1514 (synopsis "Engineering and scientific problems algorithms")
1516 "The Trilinos Project is an effort to develop algorithms and enabling
1517 technologies within an object-oriented software framework for the solution of
1518 large-scale, complex multi-physics engineering and scientific problems. A
1519 unique design feature of Trilinos is its focus on packages.")
1520 (license (list license:lgpl2.1+
1523 (define-public xyce-serial
1525 (name "xyce-serial")
1528 (origin (method url-fetch)
1529 (uri (string-append "https://archive.org/download/Xyce-"
1530 version "/Xyce-" version ".tar.gz"))
1533 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1534 (build-system gnu-build-system)
1539 "CXXFLAGS=-O3 -std=c++11"
1540 (string-append "ARCHDIR="
1541 (assoc-ref %build-inputs "trilinos")))))
1545 ("fortran" ,gfortran)))
1548 ("suitesparse" ,suitesparse)
1550 ("trilinos" ,trilinos-serial-xyce)))
1551 (home-page "https://xyce.sandia.gov/")
1552 (synopsis "High-performance analog circuit simulator")
1554 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1555 capable of solving extremely large circuit problems by supporting large-scale
1556 parallel computing platforms. It also supports serial execution.")
1557 (license license:gpl3+)))
1559 (define trilinos-parallel-xyce
1560 (package (inherit trilinos-serial-xyce)
1561 (name "trilinos-parallel-xyce")
1563 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1564 ((#:configure-flags flags)
1565 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1566 "-DTrilinos_ENABLE_Zoltan=ON"
1567 "-DTPL_ENABLE_MPI=ON")
1571 ,@(package-inputs trilinos-serial-xyce)))))
1573 (define-public xyce-parallel
1574 (package (inherit xyce-serial)
1575 (name "xyce-parallel")
1577 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1578 ((#:configure-flags flags)
1579 `(list "CXXFLAGS=-O3 -std=c++11"
1586 (assoc-ref %build-inputs "trilinos")))))))
1588 `(("mpi" ,openmpi)))
1590 `(("trilinos" ,trilinos-parallel-xyce)
1591 ,@(alist-delete "trilinos"
1592 (package-inputs xyce-serial))))))
1594 (define-public freehdl
1600 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1604 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1605 (build-system gnu-build-system)
1608 (modify-phases %standard-phases
1609 (add-before 'configure 'patch-pkg-config
1610 (lambda* (#:key inputs #:allow-other-keys)
1611 (substitute* "freehdl/freehdl-config"
1613 (string-append (assoc-ref inputs "pkg-config")
1616 (string-append (assoc-ref inputs "coreutils")
1619 (add-after 'patch-pkg-config 'setenv
1620 (lambda* (#:key inputs #:allow-other-keys)
1621 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1623 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1626 (add-after 'setenv 'patch-gvhdl
1628 (substitute* "v2cc/gvhdl.in"
1629 (("--mode=link") "--mode=link --tag=CXX")
1630 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1632 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1633 (lambda* (#:key inputs #:allow-other-keys)
1634 (substitute* "freehdl/freehdl-gennodes.in"
1636 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1637 (("\\(debug") ";(debug")
1638 (("\\(@ ") "(apply-emit")
1639 (("\\(@@ ") "(apply-mini-format"))
1641 (add-after 'configure 'patch-freehdl-pc
1642 (lambda* (#:key inputs #:allow-other-keys)
1643 (substitute* "freehdl.pc"
1645 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1648 (string-append "=" (assoc-ref inputs "libtool")
1651 (add-after 'install-scripts 'make-wrapper
1652 (lambda* (#:key inputs outputs #:allow-other-keys)
1653 (let ((out (assoc-ref outputs "out")))
1654 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1656 (wrap-program (string-append out "/bin/gvhdl")
1657 `("CPLUS_INCLUDE_PATH" ":" prefix
1658 (,(string-append (assoc-ref inputs "gcc-toolchain")
1660 `("LIBRARY_PATH" ":" prefix
1661 (,(string-append (assoc-ref inputs "gcc-toolchain")
1664 (,(string-append (assoc-ref inputs "gcc-toolchain")
1666 ,(string-append (assoc-ref inputs "coreutils")
1668 (wrap-program (string-append out "/bin/freehdl-config")
1669 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1672 `(("coreutils" ,coreutils)
1673 ("gcc-toolchain" ,gcc-toolchain)
1674 ("guile" ,guile-2.2)
1676 ("pkg-config" ,pkg-config)
1677 ("libtool" ,libtool)))
1679 `(("pkg-config-native" ,pkg-config)
1680 ("libtool-native" ,libtool)))
1681 (home-page "http://www.freehdl.seul.org/")
1682 (synopsis "VHDL simulator")
1684 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1685 VHDL'93 as well as VHDL'87 standards are supported.")
1686 (license (list license:gpl2+
1687 license:lgpl2.0+)))) ; freehdl's libraries
1690 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1691 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1692 ;; comment and update the package.
1693 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1697 (version (git-version "0.0.19" revision commit))
1701 (url "https://github.com/Qucs/qucs")
1704 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1705 (file-name (string-append name "-" version "-checkout"))))
1706 (build-system gnu-build-system)
1709 (modify-phases %standard-phases
1710 (add-before 'bootstrap 'patch-bootstrap
1712 (for-each patch-shebang
1715 "qucs-doc/bootstrap"
1716 "qucs-core/bootstrap"))
1718 (add-before 'configure 'patch-configure
1719 (lambda* (#:key inputs #:allow-other-keys)
1720 (substitute* "qucs/configure"
1721 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1723 (add-after 'patch-configure 'patch-scripts
1724 (lambda* (#:key inputs outputs #:allow-other-keys)
1725 (substitute* '("qucs/qucs/qucsdigi"
1726 "qucs/qucs/qucsdigilib"
1727 "qucs/qucs/qucsveri")
1729 (string-append (assoc-ref outputs "out") "/bin"))
1731 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1733 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1735 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1737 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1739 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1741 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1743 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1745 (add-before 'check 'pre-check
1747 ;; The test suite requires a running X server.
1748 (system "Xvfb :1 &")
1749 (setenv "DISPLAY" ":1")
1751 (add-after 'install 'make-wrapper
1752 (lambda* (#:key inputs outputs #:allow-other-keys)
1753 (let ((out (assoc-ref outputs "out")))
1754 ;; 'qucs' directly invokes gcc, hence this wrapping.
1755 (wrap-program (string-append out "/bin/qucs")
1756 `("CPLUS_INCLUDE_PATH" ":" prefix
1757 (,(string-append (assoc-ref inputs "gcc-toolchain")
1760 (,(string-append (assoc-ref inputs "gcc-toolchain")
1762 `("LIBRARY_PATH" ":" prefix
1763 (,(string-append (assoc-ref inputs "gcc-toolchain")
1765 `("ADMSXMLBINDIR" ":" prefix
1766 (,(string-append (assoc-ref inputs "adms") "/bin")))
1767 `("ASCOBINDIR" ":" prefix
1768 (,(string-append (assoc-ref inputs "asco") "/bin")))
1769 `("QUCS_OCTAVE" ":" prefix
1770 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1772 #:parallel-build? #f ; race condition
1773 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1775 `(("autoconf" ,autoconf)
1776 ("automake" ,automake)
1780 ("libtool-native" ,libtool)
1781 ("pkg-config" ,pkg-config)
1782 ("python" ,python-2) ; for tests
1783 ("matplotlib" ,python2-matplotlib) ; for tests
1784 ("numpy" ,python2-numpy) ; for tests
1785 ("xorg-server" ,xorg-server))) ; for tests
1789 ("coreutils" ,coreutils)
1790 ("freehdl" ,freehdl)
1791 ("gcc-toolchain" ,gcc-toolchain)
1792 ("iverilog" ,iverilog)
1793 ("libtool" ,libtool)
1794 ("octave" ,octave-cli)
1797 (home-page "http://qucs.sourceforge.net/")
1798 (synopsis "Circuit simulator with graphical user interface")
1800 "Qucs is a circuit simulator with graphical user interface. The software
1801 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1802 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1803 simulations are also supported.")
1804 (license license:gpl2+))))
1806 (define-public qucs-s
1812 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1814 (file-name (string-append name "-" version ".tar.gz"))
1817 "01dizf4rjciqc8x7bmv3kbhdlz90bm6n9m9fz7dbzqcwvszcs1hx"))))
1818 (build-system cmake-build-system)
1820 `(#:tests? #f ; no tests
1822 (modify-phases %standard-phases
1823 (add-before 'configure 'patch-scripts
1824 (lambda* (#:key inputs #:allow-other-keys)
1825 (substitute* '("qucs/qucsdigi"
1829 (string-append (assoc-ref inputs "qucs") "/bin"))
1831 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1833 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1835 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1837 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1839 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1841 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1843 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1845 (add-after 'patch-scripts 'patch-paths
1846 (lambda* (#:key inputs #:allow-other-keys)
1847 (substitute* "qucs/main.cpp"
1848 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1849 "\\+ \"qucsator\" \\+ executableSuffix"))
1850 (string-append "}{ QucsSettings.Qucsator = \""
1851 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1852 (((string-append "QucsSettings\\.XyceExecutable = "
1853 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1854 (string-append "}{ QucsSettings.XyceExecutable = \""
1855 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1856 (((string-append "else QucsSettings\\.XyceParExecutable = "
1857 "\"mpirun -np %p /usr/local"
1858 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1859 (string-append "QucsSettings.XyceParExecutable = \""
1860 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1861 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1862 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1863 (string-append "QucsSettings.NgspiceExecutable = " "\""
1864 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1865 (substitute* "qucs/extsimkernels/ngspice.cpp"
1866 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1867 (substitute* "qucs/qucs_actions.cpp"
1869 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1871 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1873 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1875 (add-after 'install 'install-scripts
1876 (lambda* (#:key inputs outputs #:allow-other-keys)
1879 (let ((file (string-append "../qucs_s-" ,version
1881 (out (assoc-ref outputs "out")))
1882 (install-file file (string-append out "/bin"))
1883 (chmod (string-append out "/bin/" script) #o555)))
1884 '("qucsdigi" "qucsdigilib" "qucsveri"))
1886 (add-after 'install-scripts 'make-wrapper
1887 (lambda* (#:key inputs outputs #:allow-other-keys)
1888 (let* ((out (assoc-ref outputs "out"))
1889 (file (string-append out "/bin/qucs-s"))
1890 (qucs (assoc-ref inputs "qucs"))
1891 (qucsator (string-append qucs "/bin/qucsator")))
1893 `("CPLUS_INCLUDE_PATH" ":" prefix
1894 (,(string-append (assoc-ref inputs "gcc-toolchain")
1897 (,(string-append (assoc-ref inputs "gcc-toolchain")
1899 `("LIBRARY_PATH" ":" prefix
1900 (,(string-append (assoc-ref inputs "gcc-toolchain")
1902 `("QUCSATOR" ":" prefix (,qucsator))
1903 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1904 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1906 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1908 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1910 (symlink qucsator (string-append out "/bin/qucsator"))
1913 `(("libtool-native" ,libtool)))
1917 ("coreutils" ,coreutils)
1918 ("freehdl" ,freehdl)
1919 ("gcc-toolchain" ,gcc-toolchain)
1920 ("iverilog" ,iverilog)
1921 ("libtool" ,libtool)
1923 ("ngspice" ,ngspice)
1924 ("octave" ,octave-cli)
1928 ("xyce-serial" ,xyce-serial)
1929 ("xyce-parallel" ,xyce-parallel)))
1930 (home-page "https://ra3xdh.github.io/")
1931 (synopsis "Circuit simulator with graphical user interface")
1933 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1934 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1935 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1936 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1937 (license license:gpl2+)))
1939 (define-public librepcb
1946 (uri (string-append "https://download.librepcb.org/releases/"
1947 version "/librepcb-" version "-source.zip"))
1950 "08lm95kr5gqyqyy4hcii0micqa6ryhbv0harvdndmpvi4ix1ggi8"))))
1951 (build-system gnu-build-system)
1953 `(("qtbase" ,qtbase)
1956 `(("qttools" ,qttools) ; for lrelease
1960 (modify-phases %standard-phases
1962 (lambda* (#:key inputs outputs #:allow-other-keys)
1965 (let ((lrelease (string-append (assoc-ref inputs "qttools")
1967 (out (assoc-ref outputs "out")))
1969 (string-append "QMAKE_LRELEASE=" lrelease)
1970 (string-append "PREFIX=" out)
1971 "../librepcb.pro")))))))
1972 (home-page "https://librepcb.org/")
1973 (synopsis "Electronic Design Automation tool")
1974 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
1975 software to develop printed circuit boards. It features human readable file
1976 formats and complete project management with library, schematic and board
1978 (license (list license:gpl3+
1979 license:boost1.0 ; libs/clipper,
1980 ; libs/optional/tests/catch.hpp,
1981 ; libs/sexpresso/tests/catch.hpp
1982 license:expat ; libs/delaunay-triangulation,
1983 ; libs/parseagle, libs/type_safe
1984 license:asl2.0 ; libs/fontobene, libs/googletest,
1986 license:isc ; libs/hoedown
1987 license:cc0 ; libs/optional, libs/sexpresso
1988 license:bsd-2 ; libs/optional/tests/catch.hpp
1989 license:lgpl2.1+)))) ; libs/quazip
1998 (url "https://github.com/markwal/GPX.git")
2002 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
2003 (build-system gnu-build-system)
2004 (home-page "https://github.com/markwal/GPX")
2005 (synopsis "Converting gcode to x3g files for 3D printing")
2007 "GPX is a post processing utility for converting gcode output from 3D
2008 slicing software to x3g files for standalone 3D printing on common 3D
2010 (license license:gpl2+)))
2012 (define-public gnucap
2015 (version "20171003")
2019 (uri (string-append "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/gnucap-"
2023 "16m09xa685qhj5fqq3bcgakrwnb74xhf5f7rpqkkf9fg8plzbb1g"))))
2024 (build-system gnu-build-system)
2026 `(("readline" ,readline)))
2029 (modify-phases %standard-phases
2031 (lambda* (#:key outputs #:allow-other-keys)
2032 (let ((out (assoc-ref outputs "out")))
2033 ;; Set correct rpath so that gnucap finds libgnucap.so.
2034 (substitute* (list "apps/configure" "lib/configure"
2035 "main/configure" "modelgen/configure")
2037 (string-append "LDFLAGS = -Wl,-rpath=" out "/lib")))
2038 ;; gnucap uses a hand-written configure script that expects the
2039 ;; --prefix argument to be the first argument passed to it.
2040 (invoke "./configure" (string-append "--prefix=" out)))))
2042 (lambda* (#:key outputs #:allow-other-keys)
2043 (let ((out (assoc-ref outputs "out"))
2044 (libpath "../lib/O:../apps/O"))
2045 (with-directory-excursion "tests"
2046 ;; Make test return non-zero exit code when a test fails.
2048 (("/bin/sh") "/bin/sh -e")
2049 (("\\|\\| echo \"\\*\\*\\*\\* \\$ii fails \\*\\*\\*\\*\"") ""))
2050 ;; Fix expected plugin search path for test c_attach.1.gc
2051 (substitute* "==out/c_attach.1.gc.out"
2052 (("/usr/local/lib/gnucap")
2053 (string-append libpath ":" out "/lib/gnucap")))
2054 ;; Set library path so that gnucap can find libgnucap.so
2055 ;; while running the tests.
2056 (setenv "LD_LIBRARY_PATH" libpath)
2057 (invoke "./test" "../main/O/gnucap" "" "test-output" "==out"))))))))
2058 (home-page "https://www.gnu.org/software/gnucap/")
2059 (synopsis "Mixed analog and digital circuit simulator")
2060 (description "GNUcap is a circuit analysis package. It offers a general
2061 purpose circuit simulator and can perform DC and transient analyses, fourier
2062 analysis and AC analysis. The engine is designed to do true mixed-mode
2064 (license license:gpl3+)))