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 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 wxwidgets)
89 #:use-module (gnu packages xorg))
91 (define-public librecad
98 "https://github.com/LibreCAD/LibreCAD/archive/"
100 (file-name (string-append name "-" version ".tar.gz"))
103 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
104 (build-system gnu-build-system)
107 (modify-phases %standard-phases
108 ;; Without this patch boost complains that "make_array" is not a
109 ;; member of "boost::serialization".
110 (add-after 'unpack 'patch-boost-error
112 (substitute* "librecad/src/lib/math/lc_quadratic.h"
113 (("#include \"rs_vector.h\"" line)
115 "\n#include <boost/serialization/array_wrapper.hpp>")))
116 (substitute* "librecad/src/lib/math/rs_math.cpp"
117 (("#include <boost/numeric/ublas/matrix.hpp>" line)
118 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
121 ;; Fix build against Qt 5.11.
122 (add-after 'unpack 'add-missing-headers
124 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
125 (("#include <QPushButton>") "#include <QPushButton>
126 #include <QActionGroup>"))
128 (add-after 'unpack 'patch-paths
129 (lambda* (#:key outputs #:allow-other-keys)
130 (let ((out (assoc-ref outputs "out")))
131 (substitute* "librecad/src/lib/engine/rs_system.cpp"
132 (("/usr/share") (string-append out "/share"))))))
134 (lambda* (#:key inputs #:allow-other-keys)
135 (system* "qmake" (string-append "BOOST_DIR="
136 (assoc-ref inputs "boost")))))
138 (lambda* (#:key outputs #:allow-other-keys)
139 (let* ((out (assoc-ref outputs "out"))
140 (bin (string-append out "/bin"))
141 (share (string-append out "/share/librecad")))
143 (install-file "unix/librecad" bin)
145 (copy-recursively "unix/resources" share))
147 ;; Ensure that icons are found at runtime
148 (add-after 'install 'wrap-executable
149 (lambda* (#:key inputs outputs #:allow-other-keys)
150 (let* ((out (assoc-ref outputs "out"))
151 (qt '("qtbase" "qtsvg")))
152 (wrap-program (string-append out "/bin/librecad")
153 `("QT_PLUGIN_PATH" ":" prefix
154 ,(map (lambda (label)
155 (string-append (assoc-ref inputs label)
156 "/lib/qt5/plugins/"))
161 ("muparser" ,muparser)
162 ("freetype" ,freetype)
166 `(("pkg-config" ,pkg-config)
168 (home-page "http://librecad.org/")
169 (synopsis "Computer-aided design (CAD) application")
171 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
173 (license license:gpl2)))
175 (define-public geda-gaf
182 "http://ftp.geda-project.org/geda-gaf/unstable/v"
183 (version-major+minor version) "/"
184 version "/geda-gaf-" version ".tar.gz"))
187 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
188 (build-system gnu-build-system)
191 (modify-phases %standard-phases
192 ;; tests require a writable HOME
193 (add-before 'check 'set-home
195 (setenv "HOME" (getenv "TMPDIR"))
197 ;; FIXME: These two tests fail for unknown reasons. They return "2"
198 ;; when they should return "1".
199 (add-after 'unpack 'disable-failing-tests
201 (substitute* "utils/tests/gxyrs/tests.list"
202 (("^do_nothing.*") ""))
205 (let ((pcb (assoc-ref %build-inputs "pcb")))
206 (list (string-append "--with-pcb-datadir=" pcb "/share")
207 (string-append "--with-pcb-lib-path="
208 pcb "/share/pcb/pcblib-newlib:"
209 pcb "/share/pcb/newlib")))))
214 ("desktop-file-utils" ,desktop-file-utils)
215 ("shared-mime-info" ,shared-mime-info)
219 `(("pkg-config" ,pkg-config)
220 ("perl" ,perl))) ; for tests
221 (home-page "http://geda-project.org/")
222 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
224 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
225 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
226 which currently includes: gschem, a schematic capture program; gnetlist, a
227 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
228 gattrib, a spreadsheet programm that manipulates the properties of symbols of
229 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
230 tool to forward annotation from your schematic to layout using PCB; some minor
232 (license license:gpl2+)))
234 (define-public lepton-eda
235 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
236 ;; keep and to extend Guile support.
240 (version "1.9.5-20180820")
241 (home-page "https://github.com/lepton-eda/lepton-eda")
244 (uri (git-reference (url home-page) (commit version)))
247 "1ayaccvw18zh4g7a4x5jf6yxkphi5xafb0hpc732g59qkgwfcmlr"))
248 (file-name (git-file-name name version))))
250 `(("autoconf" ,autoconf)
251 ("automake" ,automake)
253 ("gettext" ,gnu-gettext)
257 ,@(package-native-inputs geda-gaf)))
258 ;; For now it's Guile 2.0, not 2.2.
260 (substitute-keyword-arguments (package-arguments geda-gaf)
261 ((#:configure-flags flags ''())
262 ;; When running "make", the POT files are built with the build time as
263 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
264 ;; files were updated and goes on to run "msgmerge"; as a result, the
265 ;; non-deterministic POT-Creation-Date finds its way into .po files,
266 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
267 ;; never runs. See <https://bugs.debian.org/792687>.
268 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
269 ((#:phases phases '%standard-phases)
270 `(modify-phases ,phases
271 (add-before 'bootstrap 'prepare
273 ;; Some of the scripts there are invoked by autogen.sh.
274 (for-each patch-shebang (find-files "build-tools"))
276 ;; Make sure 'msgmerge' can modify the PO files.
277 (for-each (lambda (po)
279 (find-files "." "\\.po$"))
281 ;; This would normally be created by invoking 'git', but it
282 ;; doesn't work here.
283 (call-with-output-file "version.h"
285 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
286 ,(string-drop version
287 (+ 1 (string-index version #\-))))
288 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
289 ,(string-take version
290 (string-index version #\-)))
291 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
294 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
295 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
296 design, schematic capture, simulation, prototyping, and production. Lepton
297 EDA includes tools for schematic capture, attribute management, bill of
298 materials (BOM) generation, netlisting into over 20 netlist formats, analog
299 and digital simulation, and printed circuit board (PCB) layout, and many other
308 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
309 "/pcb-" version ".tar.gz"))
312 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
313 (build-system gnu-build-system)
316 (modify-phases %standard-phases
317 (add-after 'unpack 'use-wish8.6
319 (substitute* "configure"
320 (("wish85") "wish8.6"))
322 ;; It checks for "xhost", which we don't have. This shouldn't
323 ;; matter, because the test is supposed to be skipped, but it causes
324 ;; "run_tests.sh" (and thus the "check" phase) to fail.
325 (add-after 'unpack 'fix-check-for-display
327 (substitute* "tests/run_tests.sh"
328 (("have_display=no") "have_display=yes"))
330 (add-after 'install 'wrap
331 (lambda* (#:key inputs outputs #:allow-other-keys)
332 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
333 ;; fix of the mesa package we wrap the pcb executable such that
334 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
335 (let* ((out (assoc-ref outputs "out"))
336 (path (string-append (assoc-ref inputs "udev") "/lib")))
337 (wrap-program (string-append out "/bin/pcb")
338 `("LD_LIBRARY_PATH" ":" prefix (,path))))
340 (add-before 'check 'pre-check
343 (setenv "DISPLAY" ":1")
348 ("udev" ,eudev) ;FIXME: required by mesa
352 ("gtkglext" ,gtkglext)
353 ("desktop-file-utils" ,desktop-file-utils)
354 ("shared-mime-info" ,shared-mime-info)
357 `(("pkg-config" ,pkg-config)
358 ("intltool" ,intltool)
362 ("imagemagick" ,imagemagick)
364 ("ghostscript" ,ghostscript)
365 ("xvfb" ,xorg-server)))
366 (home-page "http://pcb.geda-project.org/")
367 (synopsis "Design printed circuit board layouts")
369 "GNU PCB is an interactive tool for editing printed circuit board
370 layouts. It features a rats-nest implementation, schematic/netlist import,
371 and design rule checking. It also includes an autorouter and a trace
372 optimizer; and it can produce photorealistic and design review images.")
373 (license license:gpl2+)))
375 (define-public pcb-rnd
376 (package (inherit pcb)
381 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
382 "pcb-rnd-" version ".tar.gz"))
385 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
387 `(#:tests? #f ; no check target
389 (modify-phases %standard-phases
390 (add-after 'unpack 'cc-is-gcc
391 (lambda _ (setenv "CC" "gcc") #t))
393 ;; The configure script doesn't tolerate most of our configure flags.
394 (lambda* (#:key outputs #:allow-other-keys)
395 (invoke "sh" "configure"
396 (string-append "--prefix="
397 (assoc-ref outputs "out"))))))))
398 (home-page "http://repo.hu/projects/pcb-rnd/")
399 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
400 featuring various improvements and bug fixes.")))
402 (define-public fastcap
405 (version "2.0-18Sep92")
407 (method url-fetch/tarbomb)
408 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
409 name "-" version ".tgz"))
412 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
414 ;; Remove a non-free file.
416 (delete-file "doc/psfig.sty")
418 (patches (search-patches "fastcap-mulSetup.patch"
419 "fastcap-mulGlobal.patch"))))
420 (build-system gnu-build-system)
422 ;; FIXME: with texlive-tiny citation references are rendered as question
423 ;; marks. During the build warnings like these are printed:
424 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
425 `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts)))
426 ("ghostscript" ,ghostscript)))
428 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
430 #:tests? #f ;; no tests-suite
431 #:modules ((srfi srfi-1)
432 ,@%gnu-build-system-modules)
434 (modify-phases %standard-phases
435 (add-after 'build 'make-doc
437 (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
438 (add-before 'make-doc 'fix-doc
440 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
441 (substitute* (find-files "doc" "\\.tex")
442 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
444 (string-append "\\includegraphics[scale=" scale "]{"
446 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
448 (string-append "\\includegraphics[width=" width "]{"
450 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
452 (string-append "\\includegraphics[height=" height "]{"
454 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
455 (string-append "\\includegraphics{" file "}")))
456 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
457 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
459 (string-append "\\documentclass[" options "]{"
461 "\\usepackage{graphicx}\n"
462 "\\usepackage{robinspace}"))
463 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
464 (string-append "%" all))
465 (("\\\\setstretch\\{.*\\}" all)
466 (string-append "%" all)))
469 (add-before 'install 'clean-bin
471 (delete-file (string-append (getcwd) "/bin/README"))
473 (add-before 'install 'make-pdf
475 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
476 (with-directory-excursion "doc"
478 (for-each (lambda (file)
479 (invoke "dvips" file "-o"))
480 (find-files "." "\\.dvi"))
481 (for-each (lambda (file)
482 (invoke "ps2pdf" file))
483 '("mtt.ps" "ug.ps" "tcad.ps"))
484 (invoke "make" "clean")))))
486 (lambda* (#:key outputs #:allow-other-keys)
487 (let* ((out (assoc-ref outputs "out"))
488 (data (string-append out "/share"))
489 (bin (string-append out "/bin"))
490 (doc (string-append data "/doc/" ,name "-" ,version))
491 (examples (string-append doc "/examples")))
492 (with-directory-excursion "bin"
493 (for-each (lambda (f)
494 (install-file f bin))
495 (find-files "." ".*")))
496 (copy-recursively "doc" doc)
497 (copy-recursively "examples" examples)
499 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
500 (synopsis "Multipole-accelerated capacitance extraction program")
502 "Fastcap is a capacitance extraction program based on a
503 multipole-accelerated algorithm.")
504 (license (license:non-copyleft #f "See fastcap.c."))))
506 (define-public fasthenry
509 (version "3.0-12Nov96")
512 (file-name (string-append name "-" version ".tar.gz"))
514 "http://www.rle.mit.edu/cpg/codes/" name
515 "-" version ".tar.z"))
517 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
518 (patches (search-patches "fasthenry-spAllocate.patch"
519 "fasthenry-spBuild.patch"
520 "fasthenry-spUtils.patch"
521 "fasthenry-spSolve.patch"
522 "fasthenry-spFactor.patch"))))
523 (build-system gnu-build-system)
525 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
527 #:tests? #f ;; no tests-suite
528 #:modules ((srfi srfi-1)
529 ,@%gnu-build-system-modules)
531 (modify-phases %standard-phases
534 (lambda* (#:key outputs #:allow-other-keys)
535 (let* ((out (assoc-ref outputs "out"))
536 (data (string-append out "/share"))
537 (bin (string-append out "/bin"))
538 (doc (string-append data "/doc/" ,name "-" ,version))
539 (examples (string-append doc "/examples")))
540 (with-directory-excursion "bin"
541 (for-each (lambda (f)
542 (install-file f bin))
543 (find-files "." ".*")))
544 (copy-recursively "doc" doc)
545 (copy-recursively "examples" examples)
547 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
548 (synopsis "Multipole-accelerated inductance analysis program")
550 "Fasthenry is an inductance extraction program based on a
551 multipole-accelerated algorithm.")
552 (license (license:non-copyleft #f "See induct.c."))))
554 (define-public fritzing
560 (uri (string-append "https://github.com/fritzing/"
561 "fritzing-app/archive/" version ".tar.gz"))
562 (file-name (string-append name "-" version ".tar.gz"))
565 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
566 (build-system gnu-build-system)
569 (modify-phases %standard-phases
571 (lambda* (#:key inputs outputs #:allow-other-keys)
572 (and (zero? (system* "tar"
573 "-xvf" (assoc-ref inputs "fritzing-parts-db")
575 (zero? (system* "qmake"
576 (string-append "PREFIX="
577 (assoc-ref outputs "out"))
578 "phoenix.pro"))))))))
581 ("qtserialport" ,qtserialport)
588 (uri (string-append "https://github.com/fritzing/"
589 "fritzing-parts/archive/" version ".tar.gz"))
590 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
593 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
594 (home-page "http://fritzing.org")
595 (synopsis "Electronic circuit design")
597 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
598 software with a low entry barrier, suited for the needs of makers and
599 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
600 library with many commonly used high-level components. Fritzing makes it very
601 easy to communicate about circuits, as well as to turn them into PCB layouts
602 ready for production.")
603 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
604 ;; released under GPLv3+.
605 (license (list license:gpl3+ license:cc-by-sa3.0))))
613 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
614 version "/gerbv-" version ".tar.gz"))
617 "1d2k43k7i4yvbpi4sw1263a8d0q98z2n7aqhmpinpkih8a681vn5"))))
618 (build-system gnu-build-system)
620 `(("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
621 ("pkg-config" ,pkg-config)))
625 ("desktop-file-utils" ,desktop-file-utils)))
626 (home-page "http://gerbv.geda-project.org/")
627 (synopsis "Gerber file viewer")
629 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
630 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
631 you load several files on top of each other, do measurements on the displayed
632 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
633 as well as pick-place files.")
634 (license license:gpl2+)))
636 (define-public translate2geda
637 ;; There has been no formal release yet.
638 (let ((commit "4c19e7eefa338cea8f1ee999ea8b37f8d0698169")
641 (name "translate2geda")
642 (version (git-version "0" revision commit))
646 (url "https://github.com/erichVK5/translate2geda.git")
648 (file-name (git-file-name name version))
651 "1h062bbpw8nk0jamkya1k4lsgaia796jyviiz2gkdi6k1bxhwgpa"))))
652 (build-system ant-build-system)
654 `(#:tests? #f ; there are no tests
655 #:jar-name "translate2geda.jar"
657 #:main-class "translate2geda"
659 (modify-phases %standard-phases
660 (add-after 'install 'install-bin
661 (lambda* (#:key inputs outputs #:allow-other-keys)
662 (let* ((out (assoc-ref outputs "out"))
663 (bin (string-append out "/bin"))
664 (wrapper (string-append bin "/translate2geda")))
666 (with-output-to-file wrapper
668 (format #t "#!/bin/sh~%exec ~a -jar ~a/share/java/translate2geda.jar"
669 (which "java") out)))
670 (chmod wrapper #o555))
672 (home-page "https://github.com/erichVK5/translate2geda")
673 (synopsis "Utility for converting symbol and footprint formats to gEDA")
675 "This package provides a utility for converting Kicad (@file{.mod},
676 @file{.lib}), Eagle (@file{.lbr}), gerber (@file{.gbr}, etc..),
677 BXL (@file{.bxl}), IBIS (@file{.ibs}), symdef, LT-Spice (@file{.asc}),
678 QUCS (@file{.sch}), and BSDL (@file{.bsd}) symbols and footprints and EggBot
680 (license license:gpl2+))))
682 (define-public libfive
683 (let ((commit "9d857d1923abecb0e5935b9287d22661f6efaac5")
687 (version (git-version "0" revision commit))
691 (url "https://github.com/libfive/libfive")
695 "1r40kyx30wz31cwwlfvfh7fgqkxq3n8dxhswpi9qpf4r5h3l8wsn"))
696 (file-name (git-file-name name version))
698 ;; Remove bundled catch since we provide our own.
700 (delete-file "libfive/test/catch.hpp")
702 (build-system cmake-build-system)
704 `(#:test-target "libfive-test"
706 (modify-phases %standard-phases
707 (add-after 'unpack 'remove-native-compilation
709 (substitute* "CMakeLists.txt" (("-march=native") ""))
712 `(("pkg-config" ,pkg-config)))
715 ("catch" ,catch-framework)
719 ("guile" ,guile-2.2)))
720 (home-page "https://libfive.com")
721 (synopsis "Tool for programmatic computer-aided design")
723 "Libfive is a tool for programmatic computer-aided design (CAD). In
724 libfive, solid models are defined as Scheme scripts, and there are no opaque
725 function calls into the geometry kernel: everything is visible to the user.
726 Even fundamental, primitive shapes are represented as code in the user-level
728 (license (list license:lgpl2.1+ ;library
729 license:gpl2+))))) ;Guile bindings and GUI
732 (deprecated-package "ao-cad" libfive))
741 (file-name (string-append name "-" version ".tar.xz"))
743 "https://launchpad.net/kicad/" (version-major+minor version)
744 "/" version "/+download/kicad-" version ".tar.xz"))
746 (base32 "10605rr10x0353n6yk2z095ydnkd1i6j1ncbq64pfxdn5vkhcd1g"))))
747 (build-system cmake-build-system)
749 `(#:out-of-source? #t
750 #:tests? #f ; no tests
751 #:build-type "Release"
753 (list "-DKICAD_STABLE_VERSION=ON"
754 "-DKICAD_REPO_NAME=stable"
755 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
756 "-DKICAD_SCRIPTING=ON"
757 "-DKICAD_SCRIPTING_MODULES=ON"
758 "-DKICAD_SCRIPTING_WXPYTHON=ON"
759 ;; Has to be set explicitely, as we don't have the wxPython
760 ;; headers in the wxwidgets store item, but in wxPython.
761 (string-append "-DCMAKE_CXX_FLAGS=-I"
762 (assoc-ref %build-inputs "wxpython")
764 ,(version-major+minor
765 (package-version python2-wxpython)))
766 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
768 ;; TODO: Enable this when CA certs are working with curl.
769 "-DBUILD_GITHUB_PLUGIN=OFF")
771 (modify-phases %standard-phases
772 (add-after 'unpack 'adjust-boost-include
774 ;; The location of this header changed in Boost 1.66.
775 (substitute* "3d-viewer/3d_cache/3d_cache.cpp"
776 (("boost/uuid/sha1\\.hpp")
777 "boost/uuid/detail/sha1.hpp"))
779 (add-after 'install 'wrap-program
780 ;; Ensure correct Python at runtime.
781 (lambda* (#:key inputs outputs #:allow-other-keys)
782 (let* ((out (assoc-ref outputs "out"))
783 (python (assoc-ref inputs "python"))
784 (file (string-append out "/bin/kicad"))
788 ,(version-major+minor
789 (package-version python))
791 (getenv "PYTHONPATH"))))
793 `("PYTHONPATH" ":" prefix (,path))
795 (,(string-append python "/bin:")))))
799 ("gettext" ,gnu-gettext)
800 ("pkg-config" ,pkg-config)
806 ("desktop-file-utils" ,desktop-file-utils)
809 ("hicolor-icon-theme" ,hicolor-icon-theme)
810 ("libngspice" ,libngspice)
813 ("opencascade-oce" ,opencascade-oce)
816 ("wxwidgets" ,wxwidgets-gtk2)
817 ("wxpython" ,python2-wxpython)))
818 (home-page "http://kicad-pcb.org/")
819 (synopsis "Electronics Design Automation Suite")
820 (description "Kicad is a program for the formation of printed circuit
821 boards and electrical circuits. The software has a number of programs that
822 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
823 electrical diagrams), gerbview (viewing Gerber files) and others.")
824 (license license:gpl3+)))
826 (define-public kicad-library
827 (let ((version "4.0.7"))
829 (name "kicad-library")
834 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
838 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
839 (build-system cmake-build-system)
841 `(#:out-of-source? #t
842 #:tests? #f ; no tests
844 (modify-phases %standard-phases
845 (add-after 'install 'install-footprints ; from footprints tarball
846 (lambda* (#:key inputs outputs #:allow-other-keys)
848 (assoc-ref inputs "kicad-footprints")
849 "-C" (string-append (assoc-ref outputs "out")
850 "/share/kicad/modules")
851 "--strip-components=1")))
852 ;; We change the default global footprint file, which is generated if
853 ;; it doesn't exist in user's home directory, from the one using the
854 ;; github plugin, to the one using the KISYSMOD environment path.
855 (add-after 'install-footprints 'use-pretty-footprint-table
856 (lambda* (#:key outputs #:allow-other-keys)
857 (let* ((out (assoc-ref outputs "out"))
858 (template-dir (string-append out "/share/kicad/template"))
859 (fp-lib-table (string-append template-dir "/fp-lib-table")))
860 (delete-file fp-lib-table)
861 (copy-file (string-append fp-lib-table ".for-pretty")
865 (list (search-path-specification
866 (variable "KISYSMOD") ; footprint path
867 (files '("share/kicad/modules")))
868 (search-path-specification
869 (variable "KISYS3DMOD") ; 3D model path
870 (files '("share/kicad/modules/packages3d")))))
871 ;; Kicad distributes footprints in a separate tarball.
873 `(("kicad-footprints"
877 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
881 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
882 (home-page "http://kicad-pcb.org/")
883 (synopsis "Libraries for kicad")
884 (description "This package provides Kicad component, footprint and 3D
885 render model libraries.")
886 (license license:lgpl2.0+))))
888 (define-public kicad-symbols
890 (name "kicad-symbols")
895 (url "https://github.com/KiCad/kicad-symbols.git")
897 (file-name (git-file-name name version))
900 "1rjh2pjcrc3bhcgyyskj5pssm7vffrjk0ymwr70fb7sjpmk96yjk"))))
901 (build-system cmake-build-system)
903 `(#:tests? #f)) ; No tests exist
904 (home-page "http://kicad-pcb.org/")
905 (synopsis "Official KiCad schematic symbol libraries for KiCad 5")
906 (description "This package contains the official KiCad schematic symbol
907 libraries for KiCad 5.")
908 ;; 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'."
909 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
910 (license license:cc-by-sa4.0)))
912 (define-public linsmith
919 "mirror://sourceforge/linsmith/linsmith/linsmith-"
920 version "/linsmith-" version ".tar.gz"))
923 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
924 (build-system gnu-build-system)
926 `(("pkg-config" ,pkg-config)
928 ("libgnome" ,libgnomeui)))
929 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
930 (synopsis "Smith Charting program")
931 (description "LinSmith is a Smith Charting program, mainly designed for
932 educational use. As such, there is an emphasis on capabilities that improve
933 the 'showing the effect of'-style of operation.")
934 (license license:gpl2+)))
943 (uri (string-append "http://libvolk.org/releases/volk-"
947 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
948 (build-system cmake-build-system)
952 `(("python-2" ,python-2)
953 ("python2-cheetah" ,python2-cheetah)))
954 (home-page "http://libvolk.org/")
955 (synopsis "Vector-Optimized Library of Kernels")
957 "@code{volk} contains procedures with machine-specific optimizations
958 for mathematical functions. It also provides an machine-independent
959 interface to select the best such procedures to use on a given system.")
960 (license license:gpl3+)))
962 (define-public minicom
969 (uri (string-append "https://alioth.debian.org/frs/download.php/"
970 "file/4215/" name "-" version ".tar.gz"))
973 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
974 (build-system gnu-build-system)
976 `(#:configure-flags '("--enable-lock-dir=/var/lock")
978 (modify-phases %standard-phases
979 (add-after 'unpack 'patch-lock-check
981 (substitute* "configure"
982 (("test -d [$]UUCPLOCK") "true"))
985 `(("ncurses" ,ncurses)))
986 (home-page "https://alioth.debian.org/projects/minicom/")
987 (synopsis "Serial terminal emulator")
988 (description "@code{minicom} is a serial terminal emulator.")
989 (license license:gpl2+)))
991 (define-public harminv
998 (string-append "https://github.com/stevengj/harminv/"
999 "releases/download/v" version "/"
1000 name "-" version ".tar.gz"))
1003 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
1004 (build-system gnu-build-system)
1006 `(#:configure-flags '("--enable-shared")
1008 (modify-phases %standard-phases
1009 (add-before 'configure 'fix-tests
1011 (substitute* "./sines-test.sh"
1012 ; change test frequency range - default fails
1013 (("0\\.15") "0.16"))
1016 `(("fortran" ,gfortran)))
1018 `(("lapack" ,lapack)))
1019 (home-page "https://github.com/stevengj/harminv")
1020 (synopsis "Harmonic inversion solver")
1022 "Harminv is a free program (and accompanying library) to solve the problem of
1023 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
1024 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
1025 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
1026 (license license:gpl2+)))
1028 (define-public guile-libctl
1030 (name "guile-libctl")
1036 "https://github.com/NanoComp/libctl/releases/download/v"
1037 version "/libctl-" version ".tar.gz"))
1040 "0x8r56lpfq83kfbq28vr25icl19xpfd6fjrxzcpdmv30l9pash83"))))
1041 (build-system gnu-build-system)
1043 `(#:configure-flags '("--enable-shared")))
1045 `(("fortran" ,gfortran)))
1047 `(("guile" ,guile-2.2)))
1048 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
1049 (synopsis "Flexible control files implementation for scientific simulations")
1051 "Libctl is a Guile-based library implementing flexible control files
1052 for scientific simulations.")
1053 (license license:gpl2+)))
1063 "https://github.com/NanoComp/mpb/releases/download/v"
1064 version "/mpb-" version ".tar.gz"))
1067 "1jgrb7dd6qs6j6y1gnxmdgrh79l2bvqa6nk60a4pw1annsks4brd"))))
1068 (build-system gnu-build-system)
1071 (list (string-append "--with-libctl="
1072 (assoc-ref %build-inputs "libctl")
1074 "--enable-shared")))
1076 `(("fortran" ,gfortran)
1077 ("pkg-config" ,pkg-config)
1082 ("guile" ,guile-2.2)
1085 ("libctl" ,guile-libctl)
1086 ("readline" ,readline)
1088 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1089 (synopsis "Computes band structures and electromagnetic modes of dielectric
1092 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1093 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1094 fully-vectorial and three-dimensional methods.")
1095 (license license:gpl2+)))
1105 "http://ab-initio.mit.edu/meep/meep-"
1109 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
1110 (build-system gnu-build-system)
1113 (list (string-append "--with-libctl="
1114 (assoc-ref %build-inputs "libctl")
1117 `(("fortran" ,gfortran)
1118 ("pkg-config" ,pkg-config)
1123 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
1124 ("harminv" ,harminv)
1127 ("libctl" ,guile-libctl)
1130 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1131 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1133 "Meep is a finite-difference time-domain (FDTD) simulation software package
1134 developed at MIT to model electromagnetic systems.")
1135 (license license:gpl2+)))
1145 "mirror://sourceforge/mot-adms/adms-source/"
1146 (version-major+minor version) "/adms-" version ".tar.gz"))
1149 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1150 (build-system gnu-build-system)
1154 (home-page "https://sourceforge.net/projects/mot-adms")
1155 (synopsis "Automatic device model synthesizer")
1157 "ADMS is a code generator that converts electrical compact device models
1158 specified in high-level description language into ready-to-compile C code for
1159 the API of spice simulators. Based on transformations specified in XML
1160 language, ADMS transforms Verilog-AMS code into other target languages.")
1161 (license license:gpl3)))
1163 (define-public capstone
1169 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1171 (file-name (string-append name "-" version ".tar.gz"))
1174 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
1175 (build-system gnu-build-system)
1178 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1181 (modify-phases %standard-phases
1182 (delete 'configure) ; no configure script
1183 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1184 (add-before 'build 'fix-cstool-ldflags
1185 (lambda* (#:key outputs #:allow-other-keys)
1186 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1187 (assoc-ref outputs "out") "/lib"))
1189 (home-page "https://www.capstone-engine.org")
1190 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1192 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1193 framework. Capstone can disassemble machine code for many supported architectures
1194 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1195 bindings for Python, Java, OCaml and more.")
1196 (license license:bsd-3)))
1198 ;; FIXME: This package has a timestamp embedded in
1199 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1200 (define-public python-capstone
1203 (name "python-capstone")
1205 `(("capstone" ,capstone)))
1206 (build-system python-build-system)
1209 (modify-phases %standard-phases
1210 (add-after 'unpack 'chdir-and-fix-setup-py
1212 (chdir "bindings/python")
1213 ;; Do not build the library again, because we already have it.
1214 (substitute* "setup.py" ((".* build_libraries.*") ""))
1215 ;; This substitution tells python-capstone where to find the
1217 (substitute* "capstone/__init__.py"
1218 (("pkg_resources.resource_filename.*")
1219 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1222 (define-public python2-capstone
1223 (package-with-python2 python-capstone))
1225 (define-public radare2
1231 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1232 name "-" version ".tar.gz"))
1235 "17h4ba5qqahfi8mi4x2dcvq87cqpir5v2dlaqbvmay6vby4zh4v7"))
1236 (modules '((guix build utils)))
1239 (substitute* "libr/asm/p/Makefile"
1240 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1241 (substitute* "libr/parse/p/Makefile"
1242 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1243 (substitute* "libr/bin/p/Makefile"
1244 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1246 (build-system gnu-build-system)
1248 '(#:tests? #f; tests require git and network access
1250 (modify-phases %standard-phases
1251 (add-before 'configure 'mklibdir
1252 (lambda* (#:key inputs #:allow-other-keys)
1253 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1256 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1257 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1261 `(("openssl" ,openssl)
1264 ("capstone" ,capstone)))
1266 `(("pkg-config" ,pkg-config)))
1267 (home-page "https://radare.org/")
1268 (synopsis "Portable reversing framework")
1270 "Radare project started as a forensics tool, a scriptable commandline
1271 hexadecimal editor able to open disk files, but later support for analyzing
1272 binaries, disassembling code, debugging programs, attaching to remote gdb
1274 (license license:lgpl3)))
1282 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1286 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1287 (build-system gnu-build-system)
1289 `(#:tests? #f ; no tests
1290 #:make-flags '("all" "asco-mpi")
1292 (modify-phases %standard-phases
1294 (add-before 'build 'fix-paths
1295 (lambda* (#:key inputs #:allow-other-keys)
1296 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1297 (substitute* '("errfunc.c" "asco.c")
1299 (string-append coreutils "/bin/cp "))
1301 (string-append coreutils "/bin/nice")))
1302 (substitute* "Makefile"
1303 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1305 (replace 'install ; no install target
1306 (lambda* (#:key outputs #:allow-other-keys)
1307 (for-each (lambda (file)
1308 (install-file file (string-append
1309 (assoc-ref outputs "out")
1311 '("asco" "asco-mpi" "asco-test"
1312 "tools/alter/alter" "tools/log/log"))
1315 `(("mpi" ,openmpi)))
1317 `(("coreutils-minimal" ,coreutils-minimal)))
1318 (home-page "http://asco.sourceforge.net/")
1319 (synopsis "SPICE circuit optimizer")
1321 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1322 high-performance parallel differential evolution (DE) optimization algorithm.")
1323 (license license:gpl2+)))
1325 (define-public libngspice
1326 ;; Note: The ngspice's build system does not allow us to build both the
1327 ;; library and the executables in one go. Thus, we have two packages.
1328 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1334 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1335 version "/ngspice-" version ".tar.gz"))
1338 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1339 (modules '((guix build utils)))
1340 ;; We remove the non-free cider and build without it.
1343 (delete-file-recursively "src/ciderlib")
1344 (delete-file "src/ciderinit")
1345 (substitute* "configure"
1346 (("src/ciderlib/Makefile") "")
1347 (("src/ciderlib/input/Makefile") "")
1348 (("src/ciderlib/support/Makefile") "")
1349 (("src/ciderlib/oned/Makefile") "")
1350 (("src/ciderlib/twod/Makefile") ""))
1352 (build-system gnu-build-system)
1354 `(;; No tests for libngspice exist.
1355 ;; The transient tests for ngspice fail.
1358 (modify-phases %standard-phases
1359 (add-after 'unpack 'patch-timestamps
1361 (substitute* "configure"
1362 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1364 (add-after 'unpack 'delete-program-manuals
1366 (substitute* "man/man1/Makefile.in"
1367 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1370 (add-after 'install 'delete-script-files
1371 (lambda* (#:key outputs #:allow-other-keys)
1372 (delete-file-recursively
1373 (string-append (assoc-ref outputs "out")
1374 "/share/ngspice/scripts")))))
1376 (list "--enable-openmp"
1379 "--with-readline=yes")))
1384 `(("libxaw" ,libxaw)
1386 ("readline" ,readline)))
1387 (home-page "http://ngspice.sourceforge.net/")
1388 (synopsis "Mixed-level/mixed-signal circuit simulator")
1390 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1391 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1392 provides code modeling support and simulation of digital components through
1393 an embedded event driven algorithm.")
1394 (license (list license:lgpl2.0+ ; code in frontend/numparam
1395 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1396 license:public-domain)))) ; xspice
1398 (define-public ngspice
1399 ;; The ngspice executables (see libngpsice above.)
1400 (package (inherit libngspice)
1403 (substitute-keyword-arguments (package-arguments libngspice)
1404 ((#:configure-flags flags)
1405 `(delete "--with-ngshared" ,flags))
1407 `(modify-phases ,phases
1408 (add-after 'unpack 'delete-include-files
1410 (substitute* "src/Makefile.in"
1411 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1412 "SUBDIRS = misc maths frontend spicelib"))
1414 (add-after 'install 'delete-cmpp-dlmain
1415 (lambda* (#:key outputs #:allow-other-keys)
1416 (for-each (lambda (file)
1418 (string-append (assoc-ref outputs "out")
1420 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1422 (delete 'delete-program-manuals)
1423 (delete 'delete-script-files)))))
1425 `(("libngspice" ,libngspice)
1426 ("readline" ,readline)))))
1428 (define trilinos-serial-xyce
1429 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1430 ;; keep it private. See
1431 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1432 ;; TODO: Remove when we have modular Trilinos packages?
1434 (name "trilinos-serial-xyce")
1437 (origin (method url-fetch)
1438 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1439 version "-Source.tar.gz"))
1442 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1443 (build-system cmake-build-system)
1445 `(#:out-of-source? #t
1447 (modify-phases %standard-phases
1448 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1450 (add-before 'validate-runpath 'delete-tribits
1451 (lambda* (#:key outputs #:allow-other-keys)
1452 (delete-file-recursively
1453 (string-append (assoc-ref outputs "out")
1454 "/lib/cmake/tribits"))
1457 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1458 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1459 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1460 "-DTrilinos_ENABLE_NOX=ON"
1461 "-DNOX_ENABLE_LOCA=ON"
1462 "-DTrilinos_ENABLE_EpetraExt=ON"
1463 "-DEpetraExt_BUILD_BTF=ON"
1464 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1465 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1466 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1467 "-DTrilinos_ENABLE_Ifpack=ON"
1468 "-DTrilinos_ENABLE_Isorropia=ON"
1469 "-DTrilinos_ENABLE_AztecOO=ON"
1470 "-DTrilinos_ENABLE_Belos=ON"
1471 "-DTrilinos_ENABLE_Teuchos=ON"
1472 "-DTeuchos_ENABLE_COMPLEX=ON"
1473 "-DTrilinos_ENABLE_Amesos=ON"
1474 "-DAmesos_ENABLE_KLU=ON"
1475 "-DAmesos_ENABLE_UMFPACK=ON"
1476 "-DTrilinos_ENABLE_Sacado=ON"
1477 "-DTrilinos_ENABLE_Kokkos=OFF"
1478 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1479 "-DTPL_ENABLE_AMD=ON"
1480 "-DTPL_ENABLE_UMFPACK=ON"
1481 "-DTPL_ENABLE_BLAS=ON"
1482 "-DTPL_ENABLE_LAPACK=ON")))
1484 `(("fortran" ,gfortran)
1489 ("suitesparse" ,suitesparse)))
1490 (home-page "https://trilinos.org")
1491 (synopsis "Engineering and scientific problems algorithms")
1493 "The Trilinos Project is an effort to develop algorithms and enabling
1494 technologies within an object-oriented software framework for the solution of
1495 large-scale, complex multi-physics engineering and scientific problems. A
1496 unique design feature of Trilinos is its focus on packages.")
1497 (license (list license:lgpl2.1+
1500 (define-public xyce-serial
1502 (name "xyce-serial")
1505 (origin (method url-fetch)
1506 (uri (string-append "https://archive.org/download/Xyce-"
1507 version "/Xyce-" version ".tar.gz"))
1510 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1511 (build-system gnu-build-system)
1516 "CXXFLAGS=-O3 -std=c++11"
1517 (string-append "ARCHDIR="
1518 (assoc-ref %build-inputs "trilinos")))))
1522 ("fortran" ,gfortran)))
1525 ("suitesparse" ,suitesparse)
1527 ("trilinos" ,trilinos-serial-xyce)))
1528 (home-page "https://xyce.sandia.gov/")
1529 (synopsis "High-performance analog circuit simulator")
1531 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1532 capable of solving extremely large circuit problems by supporting large-scale
1533 parallel computing platforms. It also supports serial execution.")
1534 (license license:gpl3+)))
1536 (define trilinos-parallel-xyce
1537 (package (inherit trilinos-serial-xyce)
1538 (name "trilinos-parallel-xyce")
1540 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1541 ((#:configure-flags flags)
1542 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1543 "-DTrilinos_ENABLE_Zoltan=ON"
1544 "-DTPL_ENABLE_MPI=ON")
1548 ,@(package-inputs trilinos-serial-xyce)))))
1550 (define-public xyce-parallel
1551 (package (inherit xyce-serial)
1552 (name "xyce-parallel")
1554 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1555 ((#:configure-flags flags)
1556 `(list "CXXFLAGS=-O3 -std=c++11"
1563 (assoc-ref %build-inputs "trilinos")))))))
1565 `(("mpi" ,openmpi)))
1567 `(("trilinos" ,trilinos-parallel-xyce)
1568 ,@(alist-delete "trilinos"
1569 (package-inputs xyce-serial))))))
1571 (define-public freehdl
1577 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1581 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1582 (build-system gnu-build-system)
1585 (modify-phases %standard-phases
1586 (add-before 'configure 'patch-pkg-config
1587 (lambda* (#:key inputs #:allow-other-keys)
1588 (substitute* "freehdl/freehdl-config"
1590 (string-append (assoc-ref inputs "pkg-config")
1593 (string-append (assoc-ref inputs "coreutils")
1596 (add-after 'patch-pkg-config 'setenv
1597 (lambda* (#:key inputs #:allow-other-keys)
1598 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1600 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1603 (add-after 'setenv 'patch-gvhdl
1605 (substitute* "v2cc/gvhdl.in"
1606 (("--mode=link") "--mode=link --tag=CXX")
1607 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1609 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1610 (lambda* (#:key inputs #:allow-other-keys)
1611 (substitute* "freehdl/freehdl-gennodes.in"
1613 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1614 (("\\(debug") ";(debug")
1615 (("\\(@ ") "(apply-emit")
1616 (("\\(@@ ") "(apply-mini-format"))
1618 (add-after 'configure 'patch-freehdl-pc
1619 (lambda* (#:key inputs #:allow-other-keys)
1620 (substitute* "freehdl.pc"
1622 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1625 (string-append "=" (assoc-ref inputs "libtool")
1628 (add-after 'install-scripts 'make-wrapper
1629 (lambda* (#:key inputs outputs #:allow-other-keys)
1630 (let ((out (assoc-ref outputs "out")))
1631 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1633 (wrap-program (string-append out "/bin/gvhdl")
1634 `("CPLUS_INCLUDE_PATH" ":" prefix
1635 (,(string-append (assoc-ref inputs "gcc-toolchain")
1637 `("LIBRARY_PATH" ":" prefix
1638 (,(string-append (assoc-ref inputs "gcc-toolchain")
1641 (,(string-append (assoc-ref inputs "gcc-toolchain")
1643 ,(string-append (assoc-ref inputs "coreutils")
1645 (wrap-program (string-append out "/bin/freehdl-config")
1646 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1649 `(("coreutils" ,coreutils)
1650 ("gcc-toolchain" ,gcc-toolchain)
1651 ("guile" ,guile-2.2)
1653 ("pkg-config" ,pkg-config)
1654 ("libtool" ,libtool)))
1656 `(("pkg-config-native" ,pkg-config)
1657 ("libtool-native" ,libtool)))
1658 (home-page "http://www.freehdl.seul.org/")
1659 (synopsis "VHDL simulator")
1661 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1662 VHDL'93 as well as VHDL'87 standards are supported.")
1663 (license (list license:gpl2+
1664 license:lgpl2.0+)))) ; freehdl's libraries
1667 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1668 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1669 ;; comment and update the package.
1670 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1674 (version (git-version "0.0.19" revision commit))
1678 (url "https://github.com/Qucs/qucs")
1681 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1682 (file-name (string-append name "-" version "-checkout"))))
1683 (build-system gnu-build-system)
1686 (modify-phases %standard-phases
1687 (add-before 'bootstrap 'patch-bootstrap
1689 (for-each patch-shebang
1692 "qucs-doc/bootstrap"
1693 "qucs-core/bootstrap"))
1695 (add-before 'configure 'patch-configure
1696 (lambda* (#:key inputs #:allow-other-keys)
1697 (substitute* "qucs/configure"
1698 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1700 (add-after 'patch-configure 'patch-scripts
1701 (lambda* (#:key inputs outputs #:allow-other-keys)
1702 (substitute* '("qucs/qucs/qucsdigi"
1703 "qucs/qucs/qucsdigilib"
1704 "qucs/qucs/qucsveri")
1706 (string-append (assoc-ref outputs "out") "/bin"))
1708 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1710 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1712 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1714 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1716 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1718 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1720 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1722 (add-before 'check 'pre-check
1724 ;; The test suite requires a running X server.
1725 (system "Xvfb :1 &")
1726 (setenv "DISPLAY" ":1")
1728 (add-after 'install 'make-wrapper
1729 (lambda* (#:key inputs outputs #:allow-other-keys)
1730 (let ((out (assoc-ref outputs "out")))
1731 ;; 'qucs' directly invokes gcc, hence this wrapping.
1732 (wrap-program (string-append out "/bin/qucs")
1733 `("CPLUS_INCLUDE_PATH" ":" prefix
1734 (,(string-append (assoc-ref inputs "gcc-toolchain")
1737 (,(string-append (assoc-ref inputs "gcc-toolchain")
1739 `("LIBRARY_PATH" ":" prefix
1740 (,(string-append (assoc-ref inputs "gcc-toolchain")
1742 `("ADMSXMLBINDIR" ":" prefix
1743 (,(string-append (assoc-ref inputs "adms") "/bin")))
1744 `("ASCOBINDIR" ":" prefix
1745 (,(string-append (assoc-ref inputs "asco") "/bin")))
1746 `("QUCS_OCTAVE" ":" prefix
1747 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1749 #:parallel-build? #f ; race condition
1750 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1752 `(("autoconf" ,autoconf)
1753 ("automake" ,automake)
1757 ("libtool-native" ,libtool)
1758 ("pkg-config" ,pkg-config)
1759 ("python" ,python-2) ; for tests
1760 ("matplotlib" ,python2-matplotlib) ; for tests
1761 ("numpy" ,python2-numpy) ; for tests
1762 ("xorg-server" ,xorg-server))) ; for tests
1766 ("coreutils" ,coreutils)
1767 ("freehdl" ,freehdl)
1768 ("gcc-toolchain" ,gcc-toolchain)
1769 ("iverilog" ,iverilog)
1770 ("libtool" ,libtool)
1771 ("octave" ,octave-cli)
1774 (home-page "http://qucs.sourceforge.net/")
1775 (synopsis "Circuit simulator with graphical user interface")
1777 "Qucs is a circuit simulator with graphical user interface. The software
1778 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1779 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1780 simulations are also supported.")
1781 (license license:gpl2+))))
1783 (define-public qucs-s
1789 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1791 (file-name (string-append name "-" version ".tar.gz"))
1794 "01dizf4rjciqc8x7bmv3kbhdlz90bm6n9m9fz7dbzqcwvszcs1hx"))))
1795 (build-system cmake-build-system)
1797 `(#:tests? #f ; no tests
1799 (modify-phases %standard-phases
1800 (add-before 'configure 'patch-scripts
1801 (lambda* (#:key inputs #:allow-other-keys)
1802 (substitute* '("qucs/qucsdigi"
1806 (string-append (assoc-ref inputs "qucs") "/bin"))
1808 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1810 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1812 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1814 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1816 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1818 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1820 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1822 (add-after 'patch-scripts 'patch-paths
1823 (lambda* (#:key inputs #:allow-other-keys)
1824 (substitute* "qucs/main.cpp"
1825 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1826 "\\+ \"qucsator\" \\+ executableSuffix"))
1827 (string-append "}{ QucsSettings.Qucsator = \""
1828 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1829 (((string-append "QucsSettings\\.XyceExecutable = "
1830 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1831 (string-append "}{ QucsSettings.XyceExecutable = \""
1832 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1833 (((string-append "else QucsSettings\\.XyceParExecutable = "
1834 "\"mpirun -np %p /usr/local"
1835 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1836 (string-append "QucsSettings.XyceParExecutable = \""
1837 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1838 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1839 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1840 (string-append "QucsSettings.NgspiceExecutable = " "\""
1841 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1842 (substitute* "qucs/extsimkernels/ngspice.cpp"
1843 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1844 (substitute* "qucs/qucs_actions.cpp"
1846 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1848 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1850 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1852 (add-after 'install 'install-scripts
1853 (lambda* (#:key inputs outputs #:allow-other-keys)
1856 (let ((file (string-append "../qucs_s-" ,version
1858 (out (assoc-ref outputs "out")))
1859 (install-file file (string-append out "/bin"))
1860 (chmod (string-append out "/bin/" script) #o555)))
1861 '("qucsdigi" "qucsdigilib" "qucsveri"))
1863 (add-after 'install-scripts 'make-wrapper
1864 (lambda* (#:key inputs outputs #:allow-other-keys)
1865 (let* ((out (assoc-ref outputs "out"))
1866 (file (string-append out "/bin/qucs-s"))
1867 (qucs (assoc-ref inputs "qucs"))
1868 (qucsator (string-append qucs "/bin/qucsator")))
1870 `("CPLUS_INCLUDE_PATH" ":" prefix
1871 (,(string-append (assoc-ref inputs "gcc-toolchain")
1874 (,(string-append (assoc-ref inputs "gcc-toolchain")
1876 `("LIBRARY_PATH" ":" prefix
1877 (,(string-append (assoc-ref inputs "gcc-toolchain")
1879 `("QUCSATOR" ":" prefix (,qucsator))
1880 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1881 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1883 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1885 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1887 (symlink qucsator (string-append out "/bin/qucsator"))
1890 `(("libtool-native" ,libtool)))
1894 ("coreutils" ,coreutils)
1895 ("freehdl" ,freehdl)
1896 ("gcc-toolchain" ,gcc-toolchain)
1897 ("iverilog" ,iverilog)
1898 ("libtool" ,libtool)
1900 ("ngspice" ,ngspice)
1901 ("octave" ,octave-cli)
1905 ("xyce-serial" ,xyce-serial)
1906 ("xyce-parallel" ,xyce-parallel)))
1907 (home-page "https://ra3xdh.github.io/")
1908 (synopsis "Circuit simulator with graphical user interface")
1910 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1911 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1912 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1913 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1914 (license license:gpl2+)))
1916 (define-public librepcb
1923 (uri (string-append "https://download.librepcb.org/releases/0.1.0/librepcb-"
1924 version "-source.zip"))
1927 "0affvwwgs1j2wx6bb3zfa2jbfxpckklr8cka2nkswca0p82wd3dv"))))
1928 (build-system gnu-build-system)
1930 `(("qtbase" ,qtbase)
1933 `(("qttools" ,qttools) ; for lrelease
1937 (modify-phases %standard-phases
1939 (lambda* (#:key inputs outputs #:allow-other-keys)
1942 (let ((lrelease (string-append (assoc-ref inputs "qttools")
1944 (out (assoc-ref outputs "out")))
1946 (string-append "QMAKE_LRELEASE=" lrelease)
1947 (string-append "PREFIX=" out)
1948 "../librepcb.pro")))))))
1949 (home-page "https://librepcb.org/")
1950 (synopsis "Electronic Design Automation tool")
1951 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
1952 software to develop printed circuit boards. It features human readable file
1953 formats and complete project management with library, schematic and board
1955 (license (list license:gpl3+
1956 license:boost1.0 ; libs/clipper,
1957 ; libs/optional/tests/catch.hpp,
1958 ; libs/sexpresso/tests/catch.hpp
1959 license:expat ; libs/delaunay-triangulation,
1960 ; libs/parseagle, libs/type_safe
1961 license:asl2.0 ; libs/fontobene, libs/googletest,
1963 license:isc ; libs/hoedown
1964 license:cc0 ; libs/optional, libs/sexpresso
1965 license:bsd-2 ; libs/optional/tests/catch.hpp
1966 license:lgpl2.1+)))) ; libs/quazip
1975 (url "https://github.com/markwal/GPX.git")
1979 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
1980 (build-system gnu-build-system)
1981 (home-page "https://github.com/markwal/GPX")
1982 (synopsis "Converting gcode to x3g files for 3D printing")
1984 "GPX is a post processing utility for converting gcode output from 3D
1985 slicing software to x3g files for standalone 3D printing on common 3D
1987 (license license:gpl2+)))