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, 2019 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, 2020 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>
14 ;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
15 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
16 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages engineering)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix gexp)
37 #:use-module (guix git-download)
38 #:use-module (guix monads)
39 #:use-module (guix store)
40 #:use-module (guix utils)
41 #:use-module ((srfi srfi-1) #:hide (zip))
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix build-system ant)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system gnu)
46 #:use-module (guix build-system python)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages algebra)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages boost)
53 #:use-module (gnu packages check)
54 #:use-module (gnu packages cmake)
55 #:use-module (gnu packages commencement)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages curl)
58 #:use-module (gnu packages documentation)
59 #:use-module (gnu packages flex)
60 #:use-module (gnu packages fontutils)
61 #:use-module (gnu packages fpga)
62 #:use-module (gnu packages freedesktop)
63 #:use-module (gnu packages gcc)
64 #:use-module (gnu packages gd)
65 #:use-module (gnu packages gettext)
66 #:use-module (gnu packages ghostscript)
67 #:use-module (gnu packages gl)
68 #:use-module (gnu packages glib)
69 #:use-module (gnu packages gnome)
70 #:use-module (gnu packages gperf)
71 #:use-module (gnu packages graphics)
72 #:use-module (gnu packages graphviz)
73 #:use-module (gnu packages groff)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages guile)
76 #:use-module (gnu packages image)
77 #:use-module (gnu packages image-processing)
78 #:use-module (gnu packages imagemagick)
79 #:use-module (gnu packages linux) ;FIXME: for pcb
80 #:use-module (gnu packages m4)
81 #:use-module (gnu packages maths)
82 #:use-module (gnu packages multiprecision)
83 #:use-module (gnu packages mpi)
84 #:use-module (gnu packages ncurses)
85 #:use-module (gnu packages perl)
86 #:use-module (gnu packages pkg-config)
87 #:use-module (gnu packages python)
88 #:use-module (gnu packages python-xyz)
89 #:use-module (gnu packages qt)
90 #:use-module (gnu packages readline)
91 #:use-module (gnu packages swig)
92 #:use-module (gnu packages tbb)
93 #:use-module (gnu packages tcl)
94 #:use-module (gnu packages texinfo)
95 #:use-module (gnu packages tls)
96 #:use-module (gnu packages tex)
97 #:use-module (gnu packages version-control)
98 #:use-module (gnu packages wxwidgets)
99 #:use-module (gnu packages xml)
100 #:use-module (gnu packages xorg))
102 (define-public librecad
109 "https://github.com/LibreCAD/LibreCAD/archive/"
111 (file-name (string-append name "-" version ".tar.gz"))
114 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
115 (build-system gnu-build-system)
118 (modify-phases %standard-phases
119 ;; Without this patch boost complains that "make_array" is not a
120 ;; member of "boost::serialization".
121 (add-after 'unpack 'patch-boost-error
123 (substitute* "librecad/src/lib/math/lc_quadratic.h"
124 (("#include \"rs_vector.h\"" line)
126 "\n#include <boost/serialization/array_wrapper.hpp>")))
127 (substitute* "librecad/src/lib/math/rs_math.cpp"
128 (("#include <boost/numeric/ublas/matrix.hpp>" line)
129 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
132 ;; Fix build against Qt 5.11.
133 (add-after 'unpack 'add-missing-headers
135 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
136 (("#include <QPushButton>") "#include <QPushButton>
137 #include <QActionGroup>"))
139 (add-after 'unpack 'patch-paths
140 (lambda* (#:key outputs #:allow-other-keys)
141 (let ((out (assoc-ref outputs "out")))
142 (substitute* "librecad/src/lib/engine/rs_system.cpp"
143 (("/usr/share") (string-append out "/share"))))))
145 (lambda* (#:key inputs #:allow-other-keys)
146 (system* "qmake" (string-append "BOOST_DIR="
147 (assoc-ref inputs "boost")))))
149 (lambda* (#:key outputs #:allow-other-keys)
150 (let* ((out (assoc-ref outputs "out"))
151 (bin (string-append out "/bin"))
152 (share (string-append out "/share/librecad")))
154 (install-file "unix/librecad" bin)
156 (copy-recursively "unix/resources" share))
158 ;; Ensure that icons are found at runtime
159 (add-after 'install 'wrap-executable
160 (lambda* (#:key inputs outputs #:allow-other-keys)
161 (let* ((out (assoc-ref outputs "out"))
162 (qt '("qtbase" "qtsvg")))
163 (wrap-program (string-append out "/bin/librecad")
164 `("QT_PLUGIN_PATH" ":" prefix
165 ,(map (lambda (label)
166 (string-append (assoc-ref inputs label)
167 "/lib/qt5/plugins/"))
172 ("muparser" ,muparser)
173 ("freetype" ,freetype)
177 `(("pkg-config" ,pkg-config)
179 (home-page "http://librecad.org/")
180 (synopsis "Computer-aided design (CAD) application")
182 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
184 (license license:gpl2)))
186 (define-public geda-gaf
193 "http://ftp.geda-project.org/geda-gaf/stable/v"
194 (version-major+minor version) "/"
195 version "/geda-gaf-" version ".tar.gz"))
198 "06ivgarvwbzjz2wigxzzkm8iszldi2p6x3a6jnlczjyrz4csddsy"))))
199 (build-system gnu-build-system)
202 (modify-phases %standard-phases
203 ;; tests require a writable HOME
204 (add-before 'check 'set-home
206 (setenv "HOME" (getenv "TMPDIR"))
208 (add-after 'unpack 'disable-failing-tests
210 (substitute* "xorn/tests/Makefile.in"
212 ;; This test returns its correct result in an unexpected order.
213 (substitute* "libgeda/scheme/unit-tests/t0402-config.scm"
214 (("\\(begin-config-test 'config-keys" m)
215 (string-append "#;" m)))
218 (let ((pcb (assoc-ref %build-inputs "pcb")))
219 (list (string-append "--with-pcb-datadir=" pcb "/share")
220 (string-append "--with-pcb-lib-path="
221 pcb "/share/pcb/pcblib-newlib:"
222 pcb "/share/pcb/newlib")))))
228 ("desktop-file-utils" ,desktop-file-utils)
229 ("shared-mime-info" ,shared-mime-info)
232 ("python" ,python-2))) ; for xorn
234 `(("pkg-config" ,pkg-config)
235 ("perl" ,perl))) ; for tests
236 (home-page "http://geda-project.org/")
237 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
239 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
240 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
241 which currently includes: gschem, a schematic capture program; gnetlist, a
242 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
243 gattrib, a spreadsheet programm that manipulates the properties of symbols of
244 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
245 tool to forward annotation from your schematic to layout using PCB; some minor
247 (license license:gpl2+)))
249 (define-public lepton-eda
250 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
251 ;; keep and to extend Guile support.
255 (version "1.9.9-20191003")
256 (home-page "https://github.com/lepton-eda/lepton-eda")
259 (uri (git-reference (url home-page) (commit version)))
262 "08cc3zfk84qq9mrkc9pp4r9jlavvm01wwy0yd9frql68w2zw6mip"))
263 (file-name (git-file-name name version))))
265 `(("autoconf" ,autoconf)
266 ("automake" ,automake)
268 ("gettext" ,gnu-gettext)
272 ,@(package-native-inputs geda-gaf)))
277 ("desktop-file-utils" ,desktop-file-utils)
278 ("shared-mime-info" ,shared-mime-info)
282 (substitute-keyword-arguments (package-arguments geda-gaf)
283 ((#:configure-flags flags ''())
284 ;; When running "make", the POT files are built with the build time as
285 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
286 ;; files were updated and goes on to run "msgmerge"; as a result, the
287 ;; non-deterministic POT-Creation-Date finds its way into .po files,
288 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
289 ;; never runs. See <https://bugs.debian.org/792687>.
290 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
291 ((#:phases phases '%standard-phases)
292 `(modify-phases ,phases
293 (add-before 'bootstrap 'prepare
295 ;; Some of the scripts there are invoked by autogen.sh.
296 (for-each patch-shebang (find-files "build-tools"))
298 ;; Make sure 'msgmerge' can modify the PO files.
299 (for-each (lambda (po)
301 (find-files "." "\\.po$"))
303 ;; This would normally be created by invoking 'git', but it
304 ;; doesn't work here.
305 (call-with-output-file "version.h"
307 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
308 ,(string-drop version
309 (+ 1 (string-index version #\-))))
310 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
311 ,(string-take version
312 (string-index version #\-)))
313 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
315 (add-after 'install 'compile-scheme-files
316 (lambda* (#:key outputs #:allow-other-keys)
317 (invoke "make" "precompile")
318 (for-each (lambda (program)
319 (wrap-program program
320 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
321 (,(string-append (assoc-ref outputs "out")
322 "/share/lepton-eda/ccache/")))))
323 (find-files (string-append (assoc-ref outputs "out") "/bin")
327 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
328 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
329 design, schematic capture, simulation, prototyping, and production. Lepton
330 EDA includes tools for schematic capture, attribute management, bill of
331 materials (BOM) generation, netlisting into over 20 netlist formats, analog
332 and digital simulation, and printed circuit board (PCB) layout, and many other
341 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
342 "/pcb-" version ".tar.gz"))
345 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
346 (build-system gnu-build-system)
349 (modify-phases %standard-phases
350 (add-after 'unpack 'use-wish8.6
352 (substitute* "configure"
353 (("wish85") "wish8.6"))
355 ;; It checks for "xhost", which we don't have. This shouldn't
356 ;; matter, because the test is supposed to be skipped, but it causes
357 ;; "run_tests.sh" (and thus the "check" phase) to fail.
358 (add-after 'unpack 'fix-check-for-display
360 (substitute* "tests/run_tests.sh"
361 (("have_display=no") "have_display=yes"))
363 (add-after 'install 'wrap
364 (lambda* (#:key inputs outputs #:allow-other-keys)
365 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
366 ;; fix of the mesa package we wrap the pcb executable such that
367 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
368 (let* ((out (assoc-ref outputs "out"))
369 (path (string-append (assoc-ref inputs "udev") "/lib")))
370 (wrap-program (string-append out "/bin/pcb")
371 `("LD_LIBRARY_PATH" ":" prefix (,path))))
373 (add-before 'check 'pre-check
376 (setenv "DISPLAY" ":1")
381 ("udev" ,eudev) ;FIXME: required by mesa
385 ("gtkglext" ,gtkglext)
386 ("desktop-file-utils" ,desktop-file-utils)
387 ("shared-mime-info" ,shared-mime-info)
390 `(("pkg-config" ,pkg-config)
391 ("intltool" ,intltool)
395 ("imagemagick" ,imagemagick)
397 ("ghostscript" ,ghostscript)
398 ("xvfb" ,xorg-server-for-tests)))
399 (home-page "http://pcb.geda-project.org/")
400 (synopsis "Design printed circuit board layouts")
402 "GNU PCB is an interactive tool for editing printed circuit board
403 layouts. It features a rats-nest implementation, schematic/netlist import,
404 and design rule checking. It also includes an autorouter and a trace
405 optimizer; and it can produce photorealistic and design review images.")
406 (license license:gpl2+)))
408 (define-public pcb-rnd
409 (package (inherit pcb)
414 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
415 "pcb-rnd-" version ".tar.gz"))
418 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
420 `(#:tests? #f ; no check target
422 (modify-phases %standard-phases
423 (add-after 'unpack 'cc-is-gcc
424 (lambda _ (setenv "CC" "gcc") #t))
426 ;; The configure script doesn't tolerate most of our configure flags.
427 (lambda* (#:key outputs #:allow-other-keys)
428 (invoke "sh" "configure"
429 (string-append "--prefix="
430 (assoc-ref outputs "out"))))))))
431 (home-page "http://repo.hu/projects/pcb-rnd/")
432 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
433 featuring various improvements and bug fixes.")))
435 (define-public fastcap
438 (version "2.0-18Sep92")
440 (method url-fetch/tarbomb)
441 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
442 name "-" version ".tgz"))
445 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
447 ;; Remove a non-free file.
449 (delete-file "doc/psfig.sty")
451 (patches (search-patches "fastcap-mulSetup.patch"
452 "fastcap-mulGlobal.patch"))))
453 (build-system gnu-build-system)
455 ;; FIXME: with texlive-tiny citation references are rendered as question
456 ;; marks. During the build warnings like these are printed:
457 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
458 `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts)))
459 ("ghostscript" ,ghostscript)))
461 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
463 #:tests? #f ;; no tests-suite
464 #:modules ((srfi srfi-1)
465 ,@%gnu-build-system-modules)
467 (modify-phases %standard-phases
468 (add-after 'build 'make-doc
470 (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
471 (add-before 'make-doc 'fix-doc
473 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
474 (substitute* (find-files "doc" "\\.tex")
475 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
477 (string-append "\\includegraphics[scale=" scale "]{"
479 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
481 (string-append "\\includegraphics[width=" width "]{"
483 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
485 (string-append "\\includegraphics[height=" height "]{"
487 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
488 (string-append "\\includegraphics{" file "}")))
489 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
490 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
492 (string-append "\\documentclass[" options "]{"
494 "\\usepackage{graphicx}\n"
495 "\\usepackage{robinspace}"))
496 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
497 (string-append "%" all))
498 (("\\\\setstretch\\{.*\\}" all)
499 (string-append "%" all)))
502 (add-before 'install 'clean-bin
504 (delete-file (string-append (getcwd) "/bin/README"))
506 (add-before 'install 'make-pdf
508 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
509 (with-directory-excursion "doc"
511 (for-each (lambda (file)
512 (invoke "dvips" file "-o"))
513 (find-files "." "\\.dvi"))
514 (for-each (lambda (file)
515 (invoke "ps2pdf" file))
516 '("mtt.ps" "ug.ps" "tcad.ps"))
517 (invoke "make" "clean")))))
519 (lambda* (#:key outputs #:allow-other-keys)
520 (let* ((out (assoc-ref outputs "out"))
521 (data (string-append out "/share"))
522 (bin (string-append out "/bin"))
523 (doc (string-append data "/doc/" ,name "-" ,version))
524 (examples (string-append doc "/examples")))
525 (with-directory-excursion "bin"
526 (for-each (lambda (f)
527 (install-file f bin))
528 (find-files "." ".*")))
529 (copy-recursively "doc" doc)
530 (copy-recursively "examples" examples)
532 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
533 (synopsis "Multipole-accelerated capacitance extraction program")
535 "Fastcap is a capacitance extraction program based on a
536 multipole-accelerated algorithm.")
537 (license (license:non-copyleft #f "See fastcap.c."))))
539 (define-public fasthenry
542 (version "3.0-12Nov96")
545 (file-name (string-append name "-" version ".tar.gz"))
547 "http://www.rle.mit.edu/cpg/codes/" name
548 "-" version ".tar.z"))
550 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
551 (patches (search-patches "fasthenry-spAllocate.patch"
552 "fasthenry-spBuild.patch"
553 "fasthenry-spUtils.patch"
554 "fasthenry-spSolve.patch"
555 "fasthenry-spFactor.patch"))))
556 (build-system gnu-build-system)
558 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
560 #:tests? #f ;; no tests-suite
561 #:modules ((srfi srfi-1)
562 ,@%gnu-build-system-modules)
564 (modify-phases %standard-phases
567 (lambda* (#:key outputs #:allow-other-keys)
568 (let* ((out (assoc-ref outputs "out"))
569 (data (string-append out "/share"))
570 (bin (string-append out "/bin"))
571 (doc (string-append data "/doc/" ,name "-" ,version))
572 (examples (string-append doc "/examples")))
573 (with-directory-excursion "bin"
574 (for-each (lambda (f)
575 (install-file f bin))
576 (find-files "." ".*")))
577 (copy-recursively "doc" doc)
578 (copy-recursively "examples" examples)
580 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
581 (synopsis "Multipole-accelerated inductance analysis program")
583 "Fasthenry is an inductance extraction program based on a
584 multipole-accelerated algorithm.")
585 (license (license:non-copyleft #f "See induct.c."))))
587 (define-public fritzing
594 (url "https://github.com/fritzing/fritzing-app.git")
596 (file-name (git-file-name name version))
599 "0hpyc550xfhr6gmnc85nq60w00rm0ljm0y744dp0z88ikl04f4s3"))))
600 (build-system gnu-build-system)
603 (modify-phases %standard-phases
605 (lambda* (#:key inputs outputs #:allow-other-keys)
606 (copy-recursively (assoc-ref inputs "fritzing-parts-db")
608 ;; Make compatible with libgit2 > 0.24
609 (substitute* "src/version/partschecker.cpp"
610 (("error = git_remote_connect\\(remote, GIT_DIRECTION_FETCH, &callbacks\\)")
611 "error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks, NULL, NULL)"))
613 ;; Use system libgit2 and boost.
614 (substitute* "phoenix.pro"
615 (("^LIBGIT2INCLUDE =.*")
616 (string-append "LIBGIT2INCLUDE="
617 (assoc-ref inputs "libgit2") "/include\n"))
618 (("^ LIBGIT2LIB =.*")
619 (string-append " LIBGIT2LIB="
620 (assoc-ref inputs "libgit2") "/lib\n")))
621 ;; This file checks for old versions of Boost, insisting on
622 ;; having us download the boost sources and placing them in the
624 (substitute* "pri/utils.pri"
625 (("error\\(") "message("))
627 (let ((out (assoc-ref outputs "out")))
629 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib")
630 (string-append "PREFIX=" out)
634 ("qtserialport" ,qtserialport)
643 (url "https://github.com/fritzing/fritzing-parts.git")
645 (file-name (git-file-name "fritzing-parts" version))
648 "1d2v8k7p176j0lczx4vx9n9gbg3vw09n2c4b6w0wj5wqmifywhc1"))))))
649 (home-page "http://fritzing.org")
650 (synopsis "Electronic circuit design")
652 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
653 software with a low entry barrier, suited for the needs of makers and
654 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
655 library with many commonly used high-level components. Fritzing makes it very
656 easy to communicate about circuits, as well as to turn them into PCB layouts
657 ready for production.")
658 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
659 ;; released under GPLv3+.
660 (license (list license:gpl3+ license:cc-by-sa3.0))))
668 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
669 version "/gerbv-" version ".tar.gz"))
672 "1d2k43k7i4yvbpi4sw1263a8d0q98z2n7aqhmpinpkih8a681vn5"))))
673 (build-system gnu-build-system)
675 `(("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
676 ("pkg-config" ,pkg-config)))
680 ("desktop-file-utils" ,desktop-file-utils)))
681 (home-page "http://gerbv.geda-project.org/")
682 (synopsis "Gerber file viewer")
684 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
685 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
686 you load several files on top of each other, do measurements on the displayed
687 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
688 as well as pick-place files.")
689 (license license:gpl2+)))
691 (define-public translate2geda
692 ;; There has been no formal release yet.
693 (let ((commit "4c19e7eefa338cea8f1ee999ea8b37f8d0698169")
696 (name "translate2geda")
697 (version (git-version "0" revision commit))
701 (url "https://github.com/erichVK5/translate2geda.git")
703 (file-name (git-file-name name version))
706 "1h062bbpw8nk0jamkya1k4lsgaia796jyviiz2gkdi6k1bxhwgpa"))))
707 (build-system ant-build-system)
709 `(#:tests? #f ; there are no tests
710 #:jar-name "translate2geda.jar"
712 #:main-class "translate2geda"
714 (modify-phases %standard-phases
715 (add-after 'install 'install-bin
716 (lambda* (#:key inputs outputs #:allow-other-keys)
717 (let* ((out (assoc-ref outputs "out"))
718 (bin (string-append out "/bin"))
719 (wrapper (string-append bin "/translate2geda")))
721 (with-output-to-file wrapper
723 (format #t "#!/bin/sh~%exec ~a -jar ~a/share/java/translate2geda.jar"
724 (which "java") out)))
725 (chmod wrapper #o555))
727 (home-page "https://github.com/erichVK5/translate2geda")
728 (synopsis "Utility for converting symbol and footprint formats to gEDA")
730 "This package provides a utility for converting Kicad (@file{.mod},
731 @file{.lib}), Eagle (@file{.lbr}), gerber (@file{.gbr}, etc..),
732 BXL (@file{.bxl}), IBIS (@file{.ibs}), symdef, LT-Spice (@file{.asc}),
733 QUCS (@file{.sch}), and BSDL (@file{.bsd}) symbols and footprints and EggBot
735 (license license:gpl2+))))
737 (define-public libfive
738 (let ((commit "6e39254e57c179459bb929df49ae96a6017a0ed6")
742 (version (git-version "0" revision commit))
746 (url "https://github.com/libfive/libfive")
750 "0ryv2hcbrwqc087w7rrs4a2irkcpmqync00g4dh8n7jn10w2jkim"))
751 (file-name (git-file-name name version))
753 ;; Remove bundled catch since we provide our own.
755 (delete-file "libfive/test/catch.hpp")
757 (build-system cmake-build-system)
759 `(#:test-target "libfive-test"
761 (modify-phases %standard-phases
762 (add-after 'unpack 'remove-native-compilation
764 (substitute* "CMakeLists.txt" (("-march=native") ""))
766 (add-after 'unpack 'find-catch
767 (lambda* (#:key inputs #:allow-other-keys)
768 (setenv "CPLUS_INCLUDE_PATH"
769 (string-append (assoc-ref inputs "catch")
773 `(("pkg-config" ,pkg-config)))
776 ("catch" ,catch-framework2)
780 ("guile" ,guile-2.2)))
781 (home-page "https://libfive.com")
782 (synopsis "Tool for programmatic computer-aided design")
784 "Libfive is a tool for programmatic computer-aided design (CAD). In
785 libfive, solid models are defined as Scheme scripts, and there are no opaque
786 function calls into the geometry kernel: everything is visible to the user.
787 Even fundamental, primitive shapes are represented as code in the user-level
789 (license (list license:mpl2.0 ;library
790 license:gpl2+))))) ;Guile bindings and GUI
793 (deprecated-package "ao-cad" libfive))
802 (file-name (string-append name "-" version ".tar.xz"))
804 "https://launchpad.net/kicad/" (version-major version)
805 ".0/" version "/+download/kicad-" version ".tar.xz"))
807 (base32 "0x3417f2pa7p65s9f7l49rqbnrzy8gz6i0n07mlbxqbnm0fmlql0"))))
808 (build-system cmake-build-system)
810 `(#:out-of-source? #t
811 #:tests? #f ; no tests
812 #:build-type "Release"
814 (list "-DKICAD_SCRIPTING_PYTHON3=ON"
815 "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
816 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
818 (modify-phases %standard-phases
819 (add-after 'install 'wrap-program
820 ;; Ensure correct Python at runtime.
821 (lambda* (#:key inputs outputs #:allow-other-keys)
822 (let* ((out (assoc-ref outputs "out"))
823 (python (assoc-ref inputs "python"))
824 (file (string-append out "/bin/kicad"))
828 ,(version-major+minor
829 (package-version python))
831 (getenv "PYTHONPATH"))))
833 `("PYTHONPATH" ":" prefix (,path))
835 (,(string-append python "/bin:")))))
839 ("gettext" ,gnu-gettext)
840 ("pkg-config" ,pkg-config)
846 ("desktop-file-utils" ,desktop-file-utils)
849 ("hicolor-icon-theme" ,hicolor-icon-theme)
850 ("libngspice" ,libngspice)
853 ("opencascade-oce" ,opencascade-oce)
856 ("wxwidgets" ,wxwidgets)
857 ("wxpython" ,python-wxpython)))
858 (home-page "https://kicad-pcb.org/")
859 (synopsis "Electronics Design Automation Suite")
860 (description "Kicad is a program for the formation of printed circuit
861 boards and electrical circuits. The software has a number of programs that
862 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
863 electrical diagrams), gerbview (viewing Gerber files) and others.")
864 (license license:gpl3+)))
866 (define-public kicad-library
867 (let ((version "4.0.7"))
869 (name "kicad-library")
875 "https://kicad-downloads.s3.cern.ch/libraries/kicad-library-"
878 (base32 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
879 (build-system cmake-build-system)
881 `(#:out-of-source? #t
882 #:tests? #f ; no tests
884 (modify-phases %standard-phases
885 (add-after 'install 'install-footprints ; from footprints tarball
886 (lambda* (#:key inputs outputs #:allow-other-keys)
888 (assoc-ref inputs "kicad-footprints")
889 "-C" (string-append (assoc-ref outputs "out")
890 "/share/kicad/modules")
891 "--strip-components=1")))
892 ;; We change the default global footprint file, which is generated if
893 ;; it doesn't exist in user's home directory, from the one using the
894 ;; github plugin, to the one using the KISYSMOD environment path.
895 (add-after 'install-footprints 'use-pretty-footprint-table
896 (lambda* (#:key outputs #:allow-other-keys)
897 (let* ((out (assoc-ref outputs "out"))
898 (template-dir (string-append out "/share/kicad/template"))
899 (fp-lib-table (string-append template-dir "/fp-lib-table")))
900 (delete-file fp-lib-table)
901 (copy-file (string-append fp-lib-table ".for-pretty")
905 (list (search-path-specification
906 (variable "KISYSMOD") ; footprint path
907 (files '("share/kicad/modules")))
908 (search-path-specification
909 (variable "KISYS3DMOD") ; 3D model path
910 (files '("share/kicad/modules/packages3d")))))
911 ;; Kicad distributes footprints in a separate tarball.
913 `(("kicad-footprints"
917 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
921 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
922 (home-page "https://kicad-pcb.org/")
923 (synopsis "Libraries for kicad")
924 (description "This package provides Kicad component, footprint and 3D
925 render model libraries.")
926 (license license:lgpl2.0+))))
928 (define-public kicad-symbols
930 (name "kicad-symbols")
935 (url "https://github.com/KiCad/kicad-symbols.git")
937 (file-name (git-file-name name version))
940 "048b07ffsaav1ssrchw2p870lvb4rsyb5vnniy670k7q9p16qq6h"))))
941 (build-system cmake-build-system)
943 `(#:tests? #f)) ; no tests exist
944 (home-page "https://kicad-pcb.org/")
945 (synopsis "Official KiCad schematic symbol libraries for KiCad 5")
946 (description "This package contains the official KiCad schematic symbol
947 libraries for KiCad 5.")
948 ;; TODO: Exception: "To the extent that the creation of electronic designs
949 ;; that use 'Licensed Material' can be considered to be 'Adapted Material',
950 ;; then the copyright holder waives article 3 of the license with respect to
951 ;; these designs and any generated files which use data provided as part of
952 ;; the 'Licensed Material'."
953 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
954 (license license:cc-by-sa4.0)))
956 (define-public linsmith
963 "mirror://sourceforge/linsmith/linsmith/linsmith-"
964 version "/linsmith-" version ".tar.gz"))
967 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
968 (build-system gnu-build-system)
970 `(("pkg-config" ,pkg-config)
972 ("libgnome" ,libgnomeui)))
973 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
974 (synopsis "Smith Charting program")
975 (description "LinSmith is a Smith Charting program, mainly designed for
976 educational use. As such, there is an emphasis on capabilities that improve
977 the 'showing the effect of'-style of operation.")
978 (license license:gpl2+)))
987 (uri (string-append "http://libvolk.org/releases/volk-"
991 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
992 (build-system cmake-build-system)
996 `(("python-2" ,python-2)
997 ("python2-cheetah" ,python2-cheetah)))
998 (home-page "http://libvolk.org/")
999 (synopsis "Vector-Optimized Library of Kernels")
1001 "@code{volk} contains procedures with machine-specific optimizations
1002 for mathematical functions. It also provides an machine-independent
1003 interface to select the best such procedures to use on a given system.")
1004 (license license:gpl3+)))
1006 (define-public minicom
1013 (uri (string-append "https://alioth.debian.org/frs/download.php/"
1014 "file/4215/" name "-" version ".tar.gz"))
1017 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
1018 (build-system gnu-build-system)
1020 `(#:configure-flags '("--enable-lock-dir=/var/lock")
1022 (modify-phases %standard-phases
1023 (add-after 'unpack 'patch-lock-check
1025 (substitute* "configure"
1026 (("test -d [$]UUCPLOCK") "true"))
1029 `(("ncurses" ,ncurses)))
1030 (home-page "https://alioth.debian.org/projects/minicom/")
1031 (synopsis "Serial terminal emulator")
1032 (description "@code{minicom} is a serial terminal emulator.")
1033 (license license:gpl2+)))
1035 (define-public harminv
1042 (string-append "https://github.com/stevengj/harminv/"
1043 "releases/download/v" version "/"
1044 name "-" version ".tar.gz"))
1047 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
1048 (build-system gnu-build-system)
1050 `(#:configure-flags '("--enable-shared")
1052 (modify-phases %standard-phases
1053 (add-before 'configure 'fix-tests
1055 (substitute* "./sines-test.sh"
1056 ; change test frequency range - default fails
1057 (("0\\.15") "0.16"))
1060 `(("fortran" ,gfortran)))
1062 `(("lapack" ,lapack)))
1063 (home-page "https://github.com/stevengj/harminv")
1064 (synopsis "Harmonic inversion solver")
1066 "Harminv is a free program (and accompanying library) to solve the problem of
1067 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
1068 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
1069 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
1070 (license license:gpl2+)))
1072 (define-public guile-libctl
1074 (name "guile-libctl")
1080 "https://github.com/NanoComp/libctl/releases/download/v"
1081 version "/libctl-" version ".tar.gz"))
1084 "0x8r56lpfq83kfbq28vr25icl19xpfd6fjrxzcpdmv30l9pash83"))))
1085 (build-system gnu-build-system)
1087 `(#:configure-flags '("--enable-shared")))
1089 `(("fortran" ,gfortran)))
1091 `(("guile" ,guile-2.2)))
1092 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
1093 (synopsis "Flexible control files implementation for scientific simulations")
1095 "Libctl is a Guile-based library implementing flexible control files
1096 for scientific simulations.")
1097 (license license:gpl2+)))
1107 "https://github.com/NanoComp/mpb/releases/download/v"
1108 version "/mpb-" version ".tar.gz"))
1111 "1jgrb7dd6qs6j6y1gnxmdgrh79l2bvqa6nk60a4pw1annsks4brd"))))
1112 (build-system gnu-build-system)
1115 (list (string-append "--with-libctl="
1116 (assoc-ref %build-inputs "libctl")
1118 "--enable-shared")))
1120 `(("fortran" ,gfortran)
1121 ("pkg-config" ,pkg-config)
1126 ("guile" ,guile-2.2)
1129 ("libctl" ,guile-libctl)
1130 ("readline" ,readline)
1132 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1133 (synopsis "Computes band structures and electromagnetic modes of dielectric
1136 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1137 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1138 fully-vectorial and three-dimensional methods.")
1139 (license license:gpl2+)))
1149 "https://github.com/NanoComp/meep/releases/download/v"
1150 version "/meep-" version ".tar.gz"))
1153 "14zyxmm3p80j5fz5b89sl7hgkgcisqjny5hjh4pi274ziqjqz8bm"))))
1154 (build-system gnu-build-system)
1157 (list (string-append "--with-libctl="
1158 (assoc-ref %build-inputs "libctl")
1161 `(("fortran" ,gfortran)
1162 ("pkg-config" ,pkg-config)
1167 ("guile" ,guile-2.2)
1168 ("harminv" ,harminv)
1171 ("libctl" ,guile-libctl)
1174 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1175 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1177 "Meep is a finite-difference time-domain (FDTD) simulation software package
1178 developed at MIT to model electromagnetic systems.")
1179 (license license:gpl2+)))
1189 "mirror://sourceforge/mot-adms/adms-source/"
1190 (version-major+minor version) "/adms-" version ".tar.gz"))
1193 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1194 (build-system gnu-build-system)
1198 (home-page "https://sourceforge.net/projects/mot-adms")
1199 (synopsis "Automatic device model synthesizer")
1201 "ADMS is a code generator that converts electrical compact device models
1202 specified in high-level description language into ready-to-compile C code for
1203 the API of spice simulators. Based on transformations specified in XML
1204 language, ADMS transforms Verilog-AMS code into other target languages.")
1205 (license license:gpl3)))
1207 (define-public capstone
1213 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1215 (file-name (string-append name "-" version ".tar.gz"))
1218 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
1219 (build-system gnu-build-system)
1222 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1225 (modify-phases %standard-phases
1226 (delete 'configure) ; no configure script
1227 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1228 (add-before 'build 'fix-cstool-ldflags
1229 (lambda* (#:key outputs #:allow-other-keys)
1230 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1231 (assoc-ref outputs "out") "/lib"))
1233 (home-page "https://www.capstone-engine.org")
1234 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1236 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1237 framework. Capstone can disassemble machine code for many supported architectures
1238 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1239 bindings for Python, Java, OCaml and more.")
1240 (license license:bsd-3)))
1242 ;; FIXME: This package has a timestamp embedded in
1243 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1244 (define-public python-capstone
1247 (name "python-capstone")
1249 `(("capstone" ,capstone)))
1250 (build-system python-build-system)
1253 (modify-phases %standard-phases
1254 (add-after 'unpack 'chdir-and-fix-setup-py
1256 (chdir "bindings/python")
1257 ;; Do not build the library again, because we already have it.
1258 (substitute* "setup.py" ((".* build_libraries.*") ""))
1259 ;; This substitution tells python-capstone where to find the
1261 (substitute* "capstone/__init__.py"
1262 (("pkg_resources.resource_filename.*")
1263 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1266 (define-public python2-capstone
1267 (package-with-python2 python-capstone))
1269 (define-public radare2
1275 (uri (string-append "https://radare.mikelloc.com/get/" version "/"
1276 "radare2-" version ".tar.gz"))
1279 "174x5545fw2nyf000gd46hi7rx2bn3bw5bsnvizn9yi99pn7m4mw"))
1280 (modules '((guix build utils)))
1283 (substitute* "libr/asm/p/Makefile"
1284 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1285 (substitute* "libr/parse/p/Makefile"
1286 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1287 (substitute* "libr/bin/p/Makefile"
1288 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1290 (build-system gnu-build-system)
1292 '(#:tests? #f ; tests require git and network access
1294 (modify-phases %standard-phases
1295 (add-before 'configure 'mklibdir
1296 (lambda* (#:key inputs #:allow-other-keys)
1297 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1300 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1301 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1305 `(("openssl" ,openssl)
1308 ("capstone" ,capstone)))
1310 `(("pkg-config" ,pkg-config)))
1311 (home-page "https://radare.org/")
1312 (synopsis "Portable reversing framework")
1314 "Radare project started as a forensics tool, a scriptable commandline
1315 hexadecimal editor able to open disk files, but later support for analyzing
1316 binaries, disassembling code, debugging programs, attaching to remote gdb
1318 (license license:lgpl3)))
1326 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1330 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1331 (build-system gnu-build-system)
1333 `(#:tests? #f ; no tests
1334 #:make-flags '("all" "asco-mpi")
1336 (modify-phases %standard-phases
1338 (add-before 'build 'fix-paths
1339 (lambda* (#:key inputs #:allow-other-keys)
1340 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1341 (substitute* '("errfunc.c" "asco.c")
1343 (string-append coreutils "/bin/cp "))
1345 (string-append coreutils "/bin/nice")))
1346 (substitute* "Makefile"
1347 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1349 (replace 'install ; no install target
1350 (lambda* (#:key outputs #:allow-other-keys)
1351 (for-each (lambda (file)
1352 (install-file file (string-append
1353 (assoc-ref outputs "out")
1355 '("asco" "asco-mpi" "asco-test"
1356 "tools/alter/alter" "tools/log/log"))
1359 `(("mpi" ,openmpi)))
1361 `(("coreutils-minimal" ,coreutils-minimal)))
1362 (home-page "http://asco.sourceforge.net/")
1363 (synopsis "SPICE circuit optimizer")
1365 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1366 high-performance parallel differential evolution (DE) optimization algorithm.")
1367 (license license:gpl2+)))
1369 (define-public libngspice
1370 ;; Note: The ngspice's build system does not allow us to build both the
1371 ;; library and the executables in one go. Thus, we have two packages.
1372 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1378 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1379 version "/ngspice-" version ".tar.gz"))
1382 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1383 (modules '((guix build utils)))
1384 ;; We remove the non-free cider and build without it.
1387 (delete-file-recursively "src/ciderlib")
1388 (delete-file "src/ciderinit")
1389 (substitute* "configure"
1390 (("src/ciderlib/Makefile") "")
1391 (("src/ciderlib/input/Makefile") "")
1392 (("src/ciderlib/support/Makefile") "")
1393 (("src/ciderlib/oned/Makefile") "")
1394 (("src/ciderlib/twod/Makefile") ""))
1396 (build-system gnu-build-system)
1398 `(;; No tests for libngspice exist.
1399 ;; The transient tests for ngspice fail.
1402 (modify-phases %standard-phases
1403 (add-after 'unpack 'patch-timestamps
1405 (substitute* "configure"
1406 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1408 (add-after 'unpack 'delete-program-manuals
1410 (substitute* "man/man1/Makefile.in"
1411 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1414 (add-after 'install 'delete-script-files
1415 (lambda* (#:key outputs #:allow-other-keys)
1416 (delete-file-recursively
1417 (string-append (assoc-ref outputs "out")
1418 "/share/ngspice/scripts")))))
1420 (list "--enable-openmp"
1423 "--with-readline=yes")))
1428 `(("libxaw" ,libxaw)
1430 ("readline" ,readline)))
1431 (home-page "http://ngspice.sourceforge.net/")
1432 (synopsis "Mixed-level/mixed-signal circuit simulator")
1434 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1435 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1436 provides code modeling support and simulation of digital components through
1437 an embedded event driven algorithm.")
1438 (license (list license:lgpl2.0+ ; code in frontend/numparam
1439 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1440 license:public-domain)))) ; xspice
1442 (define-public ngspice
1443 ;; The ngspice executables (see libngpsice above.)
1444 (package (inherit libngspice)
1447 (substitute-keyword-arguments (package-arguments libngspice)
1448 ((#:configure-flags flags)
1449 `(delete "--with-ngshared" ,flags))
1451 `(modify-phases ,phases
1452 (add-after 'unpack 'delete-include-files
1454 (substitute* "src/Makefile.in"
1455 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1456 "SUBDIRS = misc maths frontend spicelib"))
1458 (add-after 'install 'delete-cmpp-dlmain
1459 (lambda* (#:key outputs #:allow-other-keys)
1460 (for-each (lambda (file)
1462 (string-append (assoc-ref outputs "out")
1464 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1466 (delete 'delete-program-manuals)
1467 (delete 'delete-script-files)))))
1469 `(("libngspice" ,libngspice)
1470 ("readline" ,readline)))))
1472 (define trilinos-serial-xyce
1473 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1474 ;; keep it private. See
1475 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1476 ;; TODO: Remove when we have modular Trilinos packages?
1478 (name "trilinos-serial-xyce")
1481 (origin (method url-fetch)
1482 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1483 version "-Source.tar.gz"))
1486 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1487 (build-system cmake-build-system)
1489 `(#:out-of-source? #t
1491 (modify-phases %standard-phases
1492 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1494 (add-before 'validate-runpath 'delete-tribits
1495 (lambda* (#:key outputs #:allow-other-keys)
1496 (delete-file-recursively
1497 (string-append (assoc-ref outputs "out")
1498 "/lib/cmake/tribits"))
1501 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1502 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1503 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1504 "-DTrilinos_ENABLE_NOX=ON"
1505 "-DNOX_ENABLE_LOCA=ON"
1506 "-DTrilinos_ENABLE_EpetraExt=ON"
1507 "-DEpetraExt_BUILD_BTF=ON"
1508 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1509 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1510 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1511 "-DTrilinos_ENABLE_Ifpack=ON"
1512 "-DTrilinos_ENABLE_Isorropia=ON"
1513 "-DTrilinos_ENABLE_AztecOO=ON"
1514 "-DTrilinos_ENABLE_Belos=ON"
1515 "-DTrilinos_ENABLE_Teuchos=ON"
1516 "-DTeuchos_ENABLE_COMPLEX=ON"
1517 "-DTrilinos_ENABLE_Amesos=ON"
1518 "-DAmesos_ENABLE_KLU=ON"
1519 "-DAmesos_ENABLE_UMFPACK=ON"
1520 "-DTrilinos_ENABLE_Sacado=ON"
1521 "-DTrilinos_ENABLE_Kokkos=OFF"
1522 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1523 "-DTPL_ENABLE_AMD=ON"
1524 "-DTPL_ENABLE_UMFPACK=ON"
1525 "-DTPL_ENABLE_BLAS=ON"
1526 "-DTPL_ENABLE_LAPACK=ON")))
1528 `(("fortran" ,gfortran)
1533 ("suitesparse" ,suitesparse)))
1534 (home-page "https://trilinos.org")
1535 (synopsis "Engineering and scientific problems algorithms")
1537 "The Trilinos Project is an effort to develop algorithms and enabling
1538 technologies within an object-oriented software framework for the solution of
1539 large-scale, complex multi-physics engineering and scientific problems. A
1540 unique design feature of Trilinos is its focus on packages.")
1541 (license (list license:lgpl2.1+
1544 (define-public xyce-serial
1546 (name "xyce-serial")
1549 (origin (method url-fetch)
1550 (uri (string-append "https://archive.org/download/Xyce-"
1551 version "/Xyce-" version ".tar.gz"))
1554 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1555 (build-system gnu-build-system)
1561 (string-append "ARCHDIR="
1562 (assoc-ref %build-inputs "trilinos")))))
1564 `(("bison" ,bison-3.0) ;'configure' fails with Bison 3.4
1566 ("fortran" ,gfortran)))
1569 ("suitesparse" ,suitesparse)
1571 ("trilinos" ,trilinos-serial-xyce)))
1572 (home-page "https://xyce.sandia.gov/")
1573 (synopsis "High-performance analog circuit simulator")
1575 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1576 capable of solving extremely large circuit problems by supporting large-scale
1577 parallel computing platforms. It also supports serial execution.")
1578 (license license:gpl3+)))
1580 (define trilinos-parallel-xyce
1581 (package (inherit trilinos-serial-xyce)
1582 (name "trilinos-parallel-xyce")
1584 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1585 ((#:configure-flags flags)
1586 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1587 "-DTrilinos_ENABLE_Zoltan=ON"
1588 "-DTPL_ENABLE_MPI=ON")
1592 ,@(package-inputs trilinos-serial-xyce)))))
1594 (define-public xyce-parallel
1595 (package (inherit xyce-serial)
1596 (name "xyce-parallel")
1598 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1599 ((#:configure-flags flags)
1600 `(list "CXXFLAGS=-O3"
1607 (assoc-ref %build-inputs "trilinos")))))))
1609 `(("mpi" ,openmpi)))
1611 `(("trilinos" ,trilinos-parallel-xyce)
1612 ,@(alist-delete "trilinos"
1613 (package-inputs xyce-serial))))))
1615 (define-public freehdl
1621 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1625 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1626 (build-system gnu-build-system)
1629 (modify-phases %standard-phases
1630 (add-before 'configure 'patch-pkg-config
1631 (lambda* (#:key inputs #:allow-other-keys)
1632 (substitute* "freehdl/freehdl-config"
1634 (string-append (assoc-ref inputs "pkg-config")
1637 (string-append (assoc-ref inputs "coreutils")
1640 (add-after 'patch-pkg-config 'setenv
1641 (lambda* (#:key inputs #:allow-other-keys)
1642 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1644 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1647 (add-after 'setenv 'patch-gvhdl
1649 (substitute* "v2cc/gvhdl.in"
1650 (("--mode=link") "--mode=link --tag=CXX")
1651 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1653 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1654 (lambda* (#:key inputs #:allow-other-keys)
1655 (substitute* "freehdl/freehdl-gennodes.in"
1657 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1658 (("\\(debug") ";(debug")
1659 (("\\(@ ") "(apply-emit")
1660 (("\\(@@ ") "(apply-mini-format"))
1662 (add-after 'configure 'patch-freehdl-pc
1663 (lambda* (#:key inputs #:allow-other-keys)
1664 (substitute* "freehdl.pc"
1666 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1669 (string-append "=" (assoc-ref inputs "libtool")
1672 (add-after 'install-scripts 'make-wrapper
1673 (lambda* (#:key inputs outputs #:allow-other-keys)
1674 (let ((out (assoc-ref outputs "out")))
1675 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1677 (wrap-program (string-append out "/bin/gvhdl")
1678 `("CPLUS_INCLUDE_PATH" ":" prefix
1679 (,(string-append (assoc-ref inputs "gcc-toolchain")
1681 `("LIBRARY_PATH" ":" prefix
1682 (,(string-append (assoc-ref inputs "gcc-toolchain")
1685 (,(string-append (assoc-ref inputs "gcc-toolchain")
1687 ,(string-append (assoc-ref inputs "coreutils")
1689 (wrap-program (string-append out "/bin/freehdl-config")
1690 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1693 `(("coreutils" ,coreutils)
1694 ("gcc-toolchain" ,gcc-toolchain)
1695 ("guile" ,guile-2.2)
1697 ("pkg-config" ,pkg-config)
1698 ("libtool" ,libtool)))
1700 `(("pkg-config-native" ,pkg-config)
1701 ("libtool-native" ,libtool)))
1702 (home-page "http://www.freehdl.seul.org/")
1703 (synopsis "VHDL simulator")
1705 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1706 VHDL'93 as well as VHDL'87 standards are supported.")
1707 (license (list license:gpl2+
1708 license:lgpl2.0+)))) ; freehdl's libraries
1711 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1712 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1713 ;; comment and update the package.
1714 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1718 (version (git-version "0.0.19" revision commit))
1722 (url "https://github.com/Qucs/qucs")
1725 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1726 (file-name (string-append name "-" version "-checkout"))))
1727 (build-system gnu-build-system)
1730 (modify-phases %standard-phases
1731 (add-before 'bootstrap 'patch-bootstrap
1733 (for-each patch-shebang
1736 "qucs-doc/bootstrap"
1737 "qucs-core/bootstrap"))
1739 (add-before 'configure 'patch-configure
1740 (lambda* (#:key inputs #:allow-other-keys)
1741 (substitute* "qucs/configure"
1742 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1744 (add-after 'patch-configure 'patch-scripts
1745 (lambda* (#:key inputs outputs #:allow-other-keys)
1746 (substitute* '("qucs/qucs/qucsdigi"
1747 "qucs/qucs/qucsdigilib"
1748 "qucs/qucs/qucsveri")
1750 (string-append (assoc-ref outputs "out") "/bin"))
1752 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1754 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1756 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1758 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1760 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1762 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1764 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1766 (add-before 'check 'pre-check
1768 ;; The test suite requires a running X server.
1769 (system "Xvfb :1 &")
1770 (setenv "DISPLAY" ":1")
1772 (add-after 'install 'make-wrapper
1773 (lambda* (#:key inputs outputs #:allow-other-keys)
1774 (let ((out (assoc-ref outputs "out")))
1775 ;; 'qucs' directly invokes gcc, hence this wrapping.
1776 (wrap-program (string-append out "/bin/qucs")
1777 `("CPLUS_INCLUDE_PATH" ":" prefix
1778 (,(string-append (assoc-ref inputs "gcc-toolchain")
1781 (,(string-append (assoc-ref inputs "gcc-toolchain")
1783 `("LIBRARY_PATH" ":" prefix
1784 (,(string-append (assoc-ref inputs "gcc-toolchain")
1786 `("ADMSXMLBINDIR" ":" prefix
1787 (,(string-append (assoc-ref inputs "adms") "/bin")))
1788 `("ASCOBINDIR" ":" prefix
1789 (,(string-append (assoc-ref inputs "asco") "/bin")))
1790 `("QUCS_OCTAVE" ":" prefix
1791 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1793 #:parallel-build? #f ; race condition
1794 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1796 `(("autoconf" ,autoconf)
1797 ("automake" ,automake)
1801 ("libtool-native" ,libtool)
1802 ("pkg-config" ,pkg-config)
1803 ("python" ,python-2) ; for tests
1804 ("matplotlib" ,python2-matplotlib) ; for tests
1805 ("numpy" ,python2-numpy) ; for tests
1806 ("xorg-server" ,xorg-server-for-tests))) ; for tests
1810 ("coreutils" ,coreutils)
1811 ("freehdl" ,freehdl)
1812 ("gcc-toolchain" ,gcc-toolchain)
1813 ("iverilog" ,iverilog)
1814 ("libtool" ,libtool)
1815 ("octave" ,octave-cli)
1818 (home-page "http://qucs.sourceforge.net/")
1819 (synopsis "Circuit simulator with graphical user interface")
1821 "Qucs is a circuit simulator with graphical user interface. The software
1822 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1823 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1824 simulations are also supported.")
1825 (license license:gpl2+))))
1827 (define-public qucs-s
1833 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1835 (file-name (string-append name "-" version ".tar.gz"))
1838 "12m1jwhb9qwvb141qzyskbxnw3wn1x22d02z4b4862p7xvccl5h7"))))
1839 (build-system cmake-build-system)
1841 `(#:tests? #f ; no tests
1843 (modify-phases %standard-phases
1844 (add-before 'configure 'patch-scripts
1845 (lambda* (#:key inputs #:allow-other-keys)
1846 (substitute* '("qucs/qucsdigi"
1850 (string-append (assoc-ref inputs "qucs") "/bin"))
1852 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1854 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1856 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1858 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1860 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1862 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1864 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1866 (add-after 'patch-scripts 'patch-paths
1867 (lambda* (#:key inputs #:allow-other-keys)
1868 (substitute* "qucs/main.cpp"
1869 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1870 "\\+ \"qucsator\" \\+ executableSuffix"))
1871 (string-append "}{ QucsSettings.Qucsator = \""
1872 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1873 (((string-append "QucsSettings\\.XyceExecutable = "
1874 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1875 (string-append "}{ QucsSettings.XyceExecutable = \""
1876 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1877 (((string-append "else QucsSettings\\.XyceParExecutable = "
1878 "\"mpirun -np %p /usr/local"
1879 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1880 (string-append "QucsSettings.XyceParExecutable = \""
1881 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1882 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1883 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1884 (string-append "QucsSettings.NgspiceExecutable = " "\""
1885 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1886 (substitute* "qucs/extsimkernels/ngspice.cpp"
1887 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1888 (substitute* "qucs/qucs_actions.cpp"
1890 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1892 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1894 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1896 (add-after 'install 'install-scripts
1897 (lambda* (#:key inputs outputs #:allow-other-keys)
1900 (let ((file (string-append "../qucs_s-" ,version
1902 (out (assoc-ref outputs "out")))
1903 (install-file file (string-append out "/bin"))
1904 (chmod (string-append out "/bin/" script) #o555)))
1905 '("qucsdigi" "qucsdigilib" "qucsveri"))
1907 (add-after 'install-scripts 'make-wrapper
1908 (lambda* (#:key inputs outputs #:allow-other-keys)
1909 (let* ((out (assoc-ref outputs "out"))
1910 (file (string-append out "/bin/qucs-s"))
1911 (qucs (assoc-ref inputs "qucs"))
1912 (qucsator (string-append qucs "/bin/qucsator")))
1914 `("CPLUS_INCLUDE_PATH" ":" prefix
1915 (,(string-append (assoc-ref inputs "gcc-toolchain")
1918 (,(string-append (assoc-ref inputs "gcc-toolchain")
1920 `("LIBRARY_PATH" ":" prefix
1921 (,(string-append (assoc-ref inputs "gcc-toolchain")
1923 `("QUCSATOR" ":" prefix (,qucsator))
1924 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1925 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1927 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1929 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1931 (symlink qucsator (string-append out "/bin/qucsator"))
1934 `(("libtool-native" ,libtool)))
1938 ("coreutils" ,coreutils)
1939 ("freehdl" ,freehdl)
1940 ("gcc-toolchain" ,gcc-toolchain)
1941 ("iverilog" ,iverilog)
1942 ("libtool" ,libtool)
1944 ("ngspice" ,ngspice)
1945 ("octave" ,octave-cli)
1949 ("xyce-serial" ,xyce-serial)
1950 ("xyce-parallel" ,xyce-parallel)))
1951 (home-page "https://ra3xdh.github.io/")
1952 (synopsis "Circuit simulator with graphical user interface")
1954 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1955 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1956 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1957 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1958 (license license:gpl2+)))
1960 (define-public librepcb
1967 (uri (string-append "https://download.librepcb.org/releases/"
1968 version "/librepcb-" version "-source.zip"))
1971 "1xgk0r3nxdd2cy7d1k165d005gsngnz1v2wbwivacw7gis0i8ip7"))))
1972 (build-system gnu-build-system)
1974 `(("qtbase" ,qtbase)
1977 `(("qttools" ,qttools) ; for lrelease
1981 (modify-phases %standard-phases
1983 (lambda* (#:key inputs outputs #:allow-other-keys)
1986 (let ((lrelease (string-append (assoc-ref inputs "qttools")
1988 (out (assoc-ref outputs "out")))
1990 (string-append "QMAKE_LRELEASE=" lrelease)
1991 (string-append "PREFIX=" out)
1992 "../librepcb.pro")))))))
1993 (home-page "https://librepcb.org/")
1994 (synopsis "Electronic Design Automation tool")
1995 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
1996 software to develop printed circuit boards. It features human readable file
1997 formats and complete project management with library, schematic and board
1999 (license (list license:gpl3+
2000 license:boost1.0 ; libs/clipper,
2001 ; libs/optional/tests/catch.hpp,
2002 ; libs/sexpresso/tests/catch.hpp
2003 license:expat ; libs/delaunay-triangulation,
2004 ; libs/parseagle, libs/type_safe
2005 license:asl2.0 ; libs/fontobene, libs/googletest,
2007 license:isc ; libs/hoedown
2008 license:cc0 ; libs/optional, libs/sexpresso
2009 license:bsd-2 ; libs/optional/tests/catch.hpp
2010 license:lgpl2.1+)))) ; libs/quazip
2019 (url "https://github.com/markwal/GPX.git")
2021 (file-name (git-file-name name version))
2024 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
2025 (build-system gnu-build-system)
2026 (home-page "https://github.com/markwal/GPX")
2027 (synopsis "Converting gcode to x3g files for 3D printing")
2029 "GPX is a post processing utility for converting gcode output from 3D
2030 slicing software to x3g files for standalone 3D printing on common 3D
2032 (license license:gpl2+)))
2034 (define-public gnucap
2037 (version "20171003")
2041 (uri (string-append "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/gnucap-"
2045 "16m09xa685qhj5fqq3bcgakrwnb74xhf5f7rpqkkf9fg8plzbb1g"))))
2046 (build-system gnu-build-system)
2048 `(("readline" ,readline)))
2051 (modify-phases %standard-phases
2053 (lambda* (#:key outputs #:allow-other-keys)
2054 (let ((out (assoc-ref outputs "out")))
2055 ;; Set correct rpath so that gnucap finds libgnucap.so.
2056 (substitute* (list "apps/configure" "lib/configure"
2057 "main/configure" "modelgen/configure")
2059 (string-append "LDFLAGS = -Wl,-rpath=" out "/lib")))
2060 ;; gnucap uses a hand-written configure script that expects the
2061 ;; --prefix argument to be the first argument passed to it.
2062 (invoke "./configure" (string-append "--prefix=" out)))))
2064 (lambda* (#:key outputs #:allow-other-keys)
2065 (let ((out (assoc-ref outputs "out"))
2066 (libpath "../lib/O:../apps/O"))
2067 (with-directory-excursion "tests"
2068 ;; Make test return non-zero exit code when a test fails.
2070 (("/bin/sh") "/bin/sh -e")
2071 (("\\|\\| echo \"\\*\\*\\*\\* \\$ii fails \\*\\*\\*\\*\"") ""))
2072 ;; Fix expected plugin search path for test c_attach.1.gc
2073 (substitute* "==out/c_attach.1.gc.out"
2074 (("/usr/local/lib/gnucap")
2075 (string-append libpath ":" out "/lib/gnucap")))
2076 ;; Set library path so that gnucap can find libgnucap.so
2077 ;; while running the tests.
2078 (setenv "LD_LIBRARY_PATH" libpath)
2079 (invoke "./test" "../main/O/gnucap" "" "test-output" "==out"))))))))
2080 (home-page "https://www.gnu.org/software/gnucap/")
2081 (synopsis "Mixed analog and digital circuit simulator")
2082 (description "GNUcap is a circuit analysis package. It offers a general
2083 purpose circuit simulator and can perform DC and transient analyses, fourier
2084 analysis and AC analysis. The engine is designed to do true mixed-mode
2086 (license license:gpl3+)))
2088 (define-public cutter
2096 (url "https://github.com/radareorg/cutter")
2097 (commit (string-append "v" version))))
2098 (file-name (git-file-name name version))
2101 "03f3cdckh51anx9gd1b0ndb2fg7061hqngvygf32ky29mm2m2lyv"))))
2102 (build-system gnu-build-system)
2105 (modify-phases %standard-phases
2107 (lambda* (#:key inputs outputs #:allow-other-keys)
2108 (let ((out (assoc-ref outputs "out"))
2109 (radare2 (assoc-ref inputs "radare2")))
2110 ;; fix pkg-config detection ./src/lib_radare2.pri:PREFIX=/usr/lib
2111 ;; override `qmake PREFIX=`
2112 (substitute* "./src/lib_radare2.pri"
2113 (("PREFIX") "R2PREFIX")
2114 (("R2PREFIX=/usr") (string-append "R2PREFIX=" radare2)))
2116 (string-append "PREFIX=" out)
2117 "./src/Cutter.pro")))))))
2119 `(("pkg-config" ,pkg-config)))
2121 `(("qtbase" ,qtbase)
2123 ("openssl" ,openssl)
2124 ("radare2" ,radare2)))
2125 (home-page "https://github.com/radareorg/cutter")
2126 (synopsis "GUI for radare2 reverse engineering framework")
2127 (description "Cutter is a GUI for radare2 reverse engineering framework.
2128 Its goal is making an advanced andcustomizable reverse-engineering platform
2129 while keeping the user experience at mind. Cutter is created by reverse
2130 engineers for reverse engineers.")
2131 (license (list license:cc-by-sa3.0 ;the "Iconic" icon set
2132 license:gpl3+)))) ;everything else
2134 (define-public lib3mf
2141 (uri (git-reference (url "https://github.com/3MFConsortium/lib3mf.git")
2142 (commit (string-append "v" version))))
2143 (file-name (git-file-name name version))
2146 "11wpk6n9ga2p57h1dcrp37w77mii0r7r6mlrgmykf7rvii1rzgqd"))))
2147 (build-system cmake-build-system)
2149 `(("googletest-source" ,(package-source googletest))))
2151 `(("libuuid" ,util-linux)))
2154 (modify-phases %standard-phases
2155 (add-after 'unpack 'unpack-googletest
2156 (lambda* (#:key inputs #:allow-other-keys)
2157 (copy-recursively (assoc-ref inputs "googletest-source")
2158 "UnitTests/googletest")
2160 (synopsis "Implementation of the 3D Manufacturing Format (3MF) file standard")
2162 "Lib3MF is a C++ implementation of the 3D Manufacturing Format (3MF) file
2163 standard. It offers a way to integrate 3MF reading and writing capabilities, as
2164 well as conversion and validation tools for input and output data. The
2165 specification can be downloaded at @url{http://3mf.io/specification/}.")
2166 (home-page "https://3mf.io/")
2167 (license license:bsd-2)))
2169 (define-public openscad
2176 (uri (string-append "https://files.openscad.org/openscad-" version
2180 "0nbgk5q5pgnw53la0kccdcpz2f4xf6d6076rkn0q08z57hkc85ha"))))
2181 (build-system cmake-build-system)
2185 ("double-conversion" ,double-conversion)
2187 ("fontconfig" ,fontconfig)
2190 ("harfbuzz" ,harfbuzz)
2192 ("libxml2" ,libxml2)
2195 ("opencsg" ,opencsg)
2196 ("qscintilla" ,qscintilla)
2198 ("qtmultimedia" ,qtmultimedia)))
2202 ("gettext" ,gettext-minimal)
2203 ("pkg-config" ,pkg-config)
2205 ;; the following are only needed for tests
2206 ("imagemagick" ,imagemagick)
2209 ("xvfb" ,xorg-server-for-tests)))
2212 (modify-phases %standard-phases
2214 (lambda* (#:key outputs #:allow-other-keys)
2216 (string-append "PREFIX=" (assoc-ref outputs "out")))
2220 (with-directory-excursion "tests"
2221 (invoke "cmake" ".")
2224 ;; strip python test files since lib dir ends up in out/share
2225 (for-each delete-file
2226 (find-files "libraries/MCAD" ".*\\.py"))
2228 (synopsis "Script-based 3D modeling application")
2230 "OpenSCAD is a 3D Computer-aided Design (CAD) application. Unlike an
2231 interactive modeler, OpenSCAD generates 3D models from a script, giving you
2232 full programmatic control over your models.")
2233 (home-page "https://www.openscad.org/")
2234 (license license:gpl2+)))
2236 (define-public freecad
2244 (url "https://github.com/FreeCAD/FreeCAD.git")
2246 (file-name (git-file-name name version))
2249 "170hk1kgrvsddrwykp24wyj0cha78zzmzbf50gn98x7ngqqs395s"))))
2250 (build-system cmake-build-system)
2252 `(("doxygen" ,doxygen)
2253 ("graphviz" ,graphviz)
2254 ("qttools" ,qttools)
2255 ("pkg-config" ,pkg-config)
2261 ("freetype" ,freetype)
2264 ("libarea" ,libarea)
2265 ("libmedfile" ,libmedfile)
2266 ("libspnav" ,libspnav)
2269 ("openmpi" ,openmpi)
2270 ("opencascade-occt" ,opencascade-occt)
2271 ("python-matplotlib" ,python-matplotlib)
2272 ("python-pyside-2" ,python-pyside-2)
2273 ("python-pyside-2-tools" ,python-pyside-2-tools)
2274 ("python-shiboken-2" ,python-shiboken-2)
2275 ("python-wrapper" ,python-wrapper)
2278 ("qtx11extras" ,qtx11extras)
2279 ("qtxmlpatterns" ,qtxmlpatterns)
2280 ;; qtwebkit is optional. We remove it currently, because it takes
2281 ;; much time to compile and substitutes are often unavailable
2282 ;;("qtwebkit" ,qtwebkit)
2285 ("xerces-c" ,xerces-c)
2292 (string-append "-DCMAKE_INSTALL_LIBDIR="
2293 (assoc-ref %outputs "out") "/lib"))
2295 (modify-phases %standard-phases
2296 (add-before 'configure 'restore-pythonpath
2298 (substitute* "src/Main/MainGui.cpp"
2299 (("_?putenv\\(\"PYTHONPATH=\"\\);") ""))
2301 (add-after 'install 'wrap-pythonpath
2302 (lambda* (#:key outputs #:allow-other-keys)
2303 (let ((out (assoc-ref outputs "out")))
2304 (wrap-program (string-append out "/bin/FreeCAD")
2306 'prefix (list (getenv "PYTHONPATH")))))
2308 (home-page "https://www.freecadweb.org/")
2309 (synopsis "Your Own 3D Parametric Modeler")
2311 "FreeCAD is a general purpose feature-based, parametric 3D modeler for
2312 CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering and
2313 product design but also fits a wider range of uses in engineering, such as
2314 architecture or other engineering specialties. It is 100% Open Source (LGPL2+
2315 license) and extremely modular, allowing for very advanced extension and
2324 (define-public libmedfile
2332 "https://files.salome-platform.org/Salome/other/med-"
2336 "017h9p0x533fm4gn6pwc8kmp72rvqmcn6vznx72nkkl2b05yjx54"))))
2337 (build-system cmake-build-system)
2338 (inputs `(("hdf5" ,hdf5-1.10)))
2341 (modify-phases %standard-phases
2342 (add-after 'install 'remove-test-output
2343 (lambda* (#:key outputs #:allow-other-keys)
2344 (let ((out (assoc-ref outputs "out")))
2345 (delete-file-recursively
2346 (string-append out "/bin/testc"))
2348 (home-page "https://www.salome-platform.org")
2349 (synopsis "Library to read and write MED files")
2351 "The purpose of the MED module is to provide a standard for storing and
2352 recovering computer data associated to numerical meshes and fields, and to
2353 facilitate the exchange between codes and solvers.
2355 The persistent data storage is based upon HDF format (like CGNS, a standard
2356 developed by Boeing and NASA in the area of Computational Fluid Dynamic).
2358 MED also provides structures to hold data on meshes and fields. These
2359 structures are exchanged between solvers, hide the communication level (CORBA
2360 or MPI), and offer persistence (read/write in .med files).
2362 The main benefit of a common exchange format is reduced complexity of code
2363 coupling. It also allows sharing such high level functionalities as
2364 computation of nodal connectivity of sub-elements (faces and edges),
2365 arithmetic operations on fields, entity location functionalities, and
2366 interpolation toolkit.")
2367 (license license:gpl3+)))
2369 (define-public libarea
2370 (let ((revision "1")
2371 (commit "8f8bac811c10f1f01fda0d742a18591f61dd76ee"))
2374 (version (git-version "0" revision commit))
2378 (uri (git-reference (url "https://github.com/Heeks/libarea.git")
2380 (file-name (git-file-name name version))
2382 (base32 "0pvqz6cabxqdz5y26wnj6alkn8v5d7gkx0d3h8xmg4lvy9r3kh3g"))))
2383 (build-system gnu-build-system)
2384 (inputs `(("boost" ,boost)
2385 ("python-wrapper" ,python-wrapper)))
2387 `(("cmake" ,cmake)))
2391 (modify-phases %standard-phases
2392 (add-after 'configure 'cmake-configure
2393 (lambda* (#:key inputs outputs #:allow-other-keys)
2394 (let ((out (assoc-ref outputs "out"))
2395 (cmake (assoc-ref inputs "cmake")))
2398 (string-append "-DCMAKE_INSTALL_PREFIX=" out)))))
2399 (delete 'configure))))
2400 (home-page "https://github.com/Heeks/libarea")
2402 "Library and python module for pocketing and profiling operations")
2404 "Area is a CAM-related software for pocketing operation.
2406 This project provides library and associated python-module to compute pocket
2412 (define-public libspnav
2419 (url "https://github.com/FreeSpacenav/libspnav.git")
2420 (commit (string-append "libspnav-" version))))
2423 "098h1jhlj87axpza5zgy58prp0zn94wyrbch6x0s7q4mzh7dc8ba"))
2424 (file-name (git-file-name name version))))
2425 (build-system gnu-build-system)
2427 `(("libx11" ,libx11)))
2428 (arguments `(#:tests? #f))
2429 (home-page "http://spacenav.sourceforge.net/")
2431 "Library for communicating with spacenavd or 3dxsrv")
2433 "The libspnav library is provided as a replacement of the magellan
2434 library. It provides a cleaner, and more orthogonal interface. libspnav
2435 supports both the original X11 protocol for communicating with the driver, and
2436 the new alternative non-X protocol. Programs that choose to use the X11
2437 protocol, are automatically compatible with either the free spacenavd driver
2438 or the official 3dxserv, as if they were using the magellan SDK.
2440 Also, libspnav provides a magellan API wrapper on top of the new API. So, any
2441 applications that were using the magellan library, can switch to libspnav
2442 without any changes. And programmers that are familiar with the magellan API
2443 can continue using it with a free library without the restrictions of the
2445 (license license:bsd-3)))