gnu: Remove more packages deprecated for over almost a year.
[jackhill/guix/guix.git] / gnu / packages / engineering.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
4 ;;; Copyright © 2016, 2018, 2020 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>
17 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages engineering)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix gexp)
38 #:use-module (guix git-download)
39 #:use-module (guix monads)
40 #:use-module (guix store)
41 #:use-module (guix utils)
42 #:use-module ((srfi srfi-1) #:hide (zip))
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix build-system ant)
45 #:use-module (guix build-system cmake)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system python)
48 #:use-module (guix build-system qt)
49 #:use-module (gnu packages)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bison)
54 #:use-module (gnu packages boost)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages cmake)
57 #:use-module (gnu packages commencement)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages curl)
60 #:use-module (gnu packages documentation)
61 #:use-module (gnu packages flex)
62 #:use-module (gnu packages fontutils)
63 #:use-module (gnu packages fpga)
64 #:use-module (gnu packages freedesktop)
65 #:use-module (gnu packages gcc)
66 #:use-module (gnu packages gd)
67 #:use-module (gnu packages gettext)
68 #:use-module (gnu packages ghostscript)
69 #:use-module (gnu packages gl)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages gperf)
73 #:use-module (gnu packages graphics)
74 #:use-module (gnu packages graphviz)
75 #:use-module (gnu packages groff)
76 #:use-module (gnu packages gtk)
77 #:use-module (gnu packages guile)
78 #:use-module (gnu packages image)
79 #:use-module (gnu packages image-processing)
80 #:use-module (gnu packages imagemagick)
81 #:use-module (gnu packages linux) ;FIXME: for pcb
82 #:use-module (gnu packages m4)
83 #:use-module (gnu packages maths)
84 #:use-module (gnu packages multiprecision)
85 #:use-module (gnu packages mpi)
86 #:use-module (gnu packages ncurses)
87 #:use-module (gnu packages perl)
88 #:use-module (gnu packages pkg-config)
89 #:use-module (gnu packages python)
90 #:use-module (gnu packages python-xyz)
91 #:use-module (gnu packages qt)
92 #:use-module (gnu packages readline)
93 #:use-module (gnu packages swig)
94 #:use-module (gnu packages tbb)
95 #:use-module (gnu packages tcl)
96 #:use-module (gnu packages texinfo)
97 #:use-module (gnu packages tls)
98 #:use-module (gnu packages tex)
99 #:use-module (gnu packages version-control)
100 #:use-module (gnu packages wxwidgets)
101 #:use-module (gnu packages xml)
102 #:use-module (gnu packages xorg))
103
104 (define-public librecad
105 (package
106 (name "librecad")
107 (version "2.1.3")
108 (source (origin
109 (method url-fetch)
110 (uri (string-append
111 "https://github.com/LibreCAD/LibreCAD/archive/"
112 version ".tar.gz"))
113 (file-name (string-append name "-" version ".tar.gz"))
114 (sha256
115 (base32
116 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
117 (build-system gnu-build-system)
118 (arguments
119 '(#:phases
120 (modify-phases %standard-phases
121 ;; Without this patch boost complains that "make_array" is not a
122 ;; member of "boost::serialization".
123 (add-after 'unpack 'patch-boost-error
124 (lambda _
125 (substitute* "librecad/src/lib/math/lc_quadratic.h"
126 (("#include \"rs_vector.h\"" line)
127 (string-append line
128 "\n#include <boost/serialization/array_wrapper.hpp>")))
129 (substitute* "librecad/src/lib/math/rs_math.cpp"
130 (("#include <boost/numeric/ublas/matrix.hpp>" line)
131 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
132 line)))
133 #t))
134 ;; Fix build against Qt 5.11.
135 (add-after 'unpack 'add-missing-headers
136 (lambda _
137 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
138 (("#include <QPushButton>") "#include <QPushButton>
139 #include <QActionGroup>"))
140 #t))
141 (add-after 'unpack 'patch-paths
142 (lambda* (#:key outputs #:allow-other-keys)
143 (let ((out (assoc-ref outputs "out")))
144 (substitute* "librecad/src/lib/engine/rs_system.cpp"
145 (("/usr/share") (string-append out "/share"))))))
146 (replace 'configure
147 (lambda* (#:key inputs #:allow-other-keys)
148 (system* "qmake" (string-append "BOOST_DIR="
149 (assoc-ref inputs "boost")))))
150 (replace 'install
151 (lambda* (#:key outputs #:allow-other-keys)
152 (let* ((out (assoc-ref outputs "out"))
153 (bin (string-append out "/bin"))
154 (share (string-append out "/share/librecad")))
155 (mkdir-p bin)
156 (install-file "unix/librecad" bin)
157 (mkdir-p share)
158 (copy-recursively "unix/resources" share))
159 #t))
160 ;; Ensure that icons are found at runtime
161 (add-after 'install 'wrap-executable
162 (lambda* (#:key inputs outputs #:allow-other-keys)
163 (let* ((out (assoc-ref outputs "out"))
164 (qt '("qtbase" "qtsvg")))
165 (wrap-program (string-append out "/bin/librecad")
166 `("QT_PLUGIN_PATH" ":" prefix
167 ,(map (lambda (label)
168 (string-append (assoc-ref inputs label)
169 "/lib/qt5/plugins/"))
170 qt)))
171 #t))))))
172 (inputs
173 `(("boost" ,boost)
174 ("muparser" ,muparser)
175 ("freetype" ,freetype)
176 ("qtbase" ,qtbase)
177 ("qtsvg" ,qtsvg)))
178 (native-inputs
179 `(("pkg-config" ,pkg-config)
180 ("which" ,which)))
181 (home-page "https://librecad.org/")
182 (synopsis "Computer-aided design (CAD) application")
183 (description
184 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
185 plans and designs.")
186 (license license:gpl2)))
187
188 (define-public geda-gaf
189 (package
190 (name "geda-gaf")
191 (version "1.10.0")
192 (source (origin
193 (method url-fetch)
194 (uri (string-append
195 "http://ftp.geda-project.org/geda-gaf/stable/v"
196 (version-major+minor version) "/"
197 version "/geda-gaf-" version ".tar.gz"))
198 (sha256
199 (base32
200 "06ivgarvwbzjz2wigxzzkm8iszldi2p6x3a6jnlczjyrz4csddsy"))))
201 (build-system gnu-build-system)
202 (arguments
203 '(#:phases
204 (modify-phases %standard-phases
205 ;; tests require a writable HOME
206 (add-before 'check 'set-home
207 (lambda _
208 (setenv "HOME" (getenv "TMPDIR"))
209 #t))
210 (add-after 'unpack 'disable-failing-tests
211 (lambda _
212 (substitute* "xorn/tests/Makefile.in"
213 (("-Werror") ""))
214 ;; This test returns its correct result in an unexpected order.
215 (substitute* "libgeda/scheme/unit-tests/t0402-config.scm"
216 (("\\(begin-config-test 'config-keys" m)
217 (string-append "#;" m)))
218 #t)))
219 #:configure-flags
220 (let ((pcb (assoc-ref %build-inputs "pcb")))
221 (list (string-append "--with-pcb-datadir=" pcb "/share")
222 (string-append "--with-pcb-lib-path="
223 pcb "/share/pcb/pcblib-newlib:"
224 pcb "/share/pcb/newlib")))))
225 (inputs
226 `(("gamin" ,gamin)
227 ("glib" ,glib)
228 ("gtk" ,gtk+-2)
229 ("guile" ,guile-2.0)
230 ("desktop-file-utils" ,desktop-file-utils)
231 ("shared-mime-info" ,shared-mime-info)
232 ("m4" ,m4)
233 ("pcb" ,pcb)
234 ("python" ,python-2))) ; for xorn
235 (native-inputs
236 `(("pkg-config" ,pkg-config)
237 ("perl" ,perl))) ; for tests
238 (home-page "http://geda-project.org/")
239 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
240 (description
241 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
242 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
243 which currently includes: gschem, a schematic capture program; gnetlist, a
244 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
245 gattrib, a spreadsheet programm that manipulates the properties of symbols of
246 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
247 tool to forward annotation from your schematic to layout using PCB; some minor
248 utilities.")
249 (license license:gpl2+)))
250
251 (define-public lepton-eda
252 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
253 ;; keep and to extend Guile support.
254 (package
255 (inherit geda-gaf)
256 (name "lepton-eda")
257 (version "1.9.9-20191003")
258 (home-page "https://github.com/lepton-eda/lepton-eda")
259 (source (origin
260 (method git-fetch)
261 (uri (git-reference (url home-page) (commit version)))
262 (sha256
263 (base32
264 "08cc3zfk84qq9mrkc9pp4r9jlavvm01wwy0yd9frql68w2zw6mip"))
265 (file-name (git-file-name name version))))
266 (native-inputs
267 `(("autoconf" ,autoconf)
268 ("automake" ,automake)
269 ("libtool" ,libtool)
270 ("gettext" ,gnu-gettext)
271 ("texinfo" ,texinfo)
272 ("groff" ,groff)
273 ("which" ,which)
274 ,@(package-native-inputs geda-gaf)))
275 (inputs
276 `(("glib" ,glib)
277 ("gtk" ,gtk+-2)
278 ("guile" ,guile-2.2)
279 ("desktop-file-utils" ,desktop-file-utils)
280 ("shared-mime-info" ,shared-mime-info)
281 ("m4" ,m4)
282 ("pcb" ,pcb)))
283 (arguments
284 (substitute-keyword-arguments (package-arguments geda-gaf)
285 ((#:configure-flags flags ''())
286 ;; When running "make", the POT files are built with the build time as
287 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
288 ;; files were updated and goes on to run "msgmerge"; as a result, the
289 ;; non-deterministic POT-Creation-Date finds its way into .po files,
290 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
291 ;; never runs. See <https://bugs.debian.org/792687>.
292 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
293 ((#:phases phases '%standard-phases)
294 `(modify-phases %standard-phases
295 (add-before 'bootstrap 'prepare
296 (lambda _
297 ;; Some of the scripts there are invoked by autogen.sh.
298 (for-each patch-shebang (find-files "build-tools"))
299
300 ;; Make sure 'msgmerge' can modify the PO files.
301 (for-each (lambda (po)
302 (chmod po #o666))
303 (find-files "." "\\.po$"))
304
305 ;; This would normally be created by invoking 'git', but it
306 ;; doesn't work here.
307 (call-with-output-file "version.h"
308 (lambda (port)
309 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
310 ,(string-drop version
311 (+ 1 (string-index version #\-))))
312 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
313 ,(string-take version
314 (string-index version #\-)))
315 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
316 #t))
317 (add-after 'install 'compile-scheme-files
318 (lambda* (#:key outputs #:allow-other-keys)
319 (invoke "make" "precompile")
320 (for-each (lambda (program)
321 (wrap-program program
322 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
323 (,(string-append (assoc-ref outputs "out")
324 "/share/lepton-eda/ccache/")))))
325 (find-files (string-append (assoc-ref outputs "out") "/bin")
326 ".*"))
327 #t))))))
328 (description
329 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
330 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
331 design, schematic capture, simulation, prototyping, and production. Lepton
332 EDA includes tools for schematic capture, attribute management, bill of
333 materials (BOM) generation, netlisting into over 20 netlist formats, analog
334 and digital simulation, and printed circuit board (PCB) layout, and many other
335 features.")))
336
337 (define-public pcb
338 (package
339 (name "pcb")
340 (version "4.0.2")
341 (source (origin
342 (method url-fetch)
343 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
344 "/pcb-" version ".tar.gz"))
345 (sha256
346 (base32
347 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
348 (build-system gnu-build-system)
349 (arguments
350 `(#:phases
351 (modify-phases %standard-phases
352 (add-after 'unpack 'use-wish8.6
353 (lambda _
354 (substitute* "configure"
355 (("wish85") "wish8.6"))
356 #t))
357 ;; It checks for "xhost", which we don't have. This shouldn't
358 ;; matter, because the test is supposed to be skipped, but it causes
359 ;; "run_tests.sh" (and thus the "check" phase) to fail.
360 (add-after 'unpack 'fix-check-for-display
361 (lambda _
362 (substitute* "tests/run_tests.sh"
363 (("have_display=no") "have_display=yes"))
364 #t))
365 (add-after 'install 'wrap
366 (lambda* (#:key inputs outputs #:allow-other-keys)
367 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
368 ;; fix of the mesa package we wrap the pcb executable such that
369 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
370 (let* ((out (assoc-ref outputs "out"))
371 (path (string-append (assoc-ref inputs "udev") "/lib")))
372 (wrap-program (string-append out "/bin/pcb")
373 `("LD_LIBRARY_PATH" ":" prefix (,path))))
374 #t))
375 (add-before 'check 'pre-check
376 (lambda _
377 (system "Xvfb :1 &")
378 (setenv "DISPLAY" ":1")
379 #t)))))
380 (inputs
381 `(("dbus" ,dbus)
382 ("mesa" ,mesa)
383 ("udev" ,eudev) ;FIXME: required by mesa
384 ("glu" ,glu)
385 ("gd" ,gd)
386 ("gtk" ,gtk+-2)
387 ("gtkglext" ,gtkglext)
388 ("desktop-file-utils" ,desktop-file-utils)
389 ("shared-mime-info" ,shared-mime-info)
390 ("tk" ,tk)))
391 (native-inputs
392 `(("pkg-config" ,pkg-config)
393 ("intltool" ,intltool)
394 ("bison" ,bison)
395 ("flex" ,flex)
396 ;; For tests
397 ("imagemagick" ,imagemagick)
398 ("gerbv" ,gerbv)
399 ("ghostscript" ,ghostscript)
400 ("xvfb" ,xorg-server-for-tests)))
401 (home-page "http://pcb.geda-project.org/")
402 (synopsis "Design printed circuit board layouts")
403 (description
404 "GNU PCB is an interactive tool for editing printed circuit board
405 layouts. It features a rats-nest implementation, schematic/netlist import,
406 and design rule checking. It also includes an autorouter and a trace
407 optimizer; and it can produce photorealistic and design review images.")
408 (license license:gpl2+)))
409
410 (define-public pcb-rnd
411 (package (inherit pcb)
412 (name "pcb-rnd")
413 (version "1.1.3")
414 (source (origin
415 (method url-fetch)
416 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
417 "pcb-rnd-" version ".tar.gz"))
418 (sha256
419 (base32
420 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
421 (arguments
422 `(#:tests? #f ; no check target
423 #:phases
424 (modify-phases %standard-phases
425 (add-after 'unpack 'cc-is-gcc
426 (lambda _ (setenv "CC" "gcc") #t))
427 (replace 'configure
428 ;; The configure script doesn't tolerate most of our configure flags.
429 (lambda* (#:key outputs #:allow-other-keys)
430 (invoke "sh" "configure"
431 (string-append "--prefix="
432 (assoc-ref outputs "out"))))))))
433 (home-page "http://repo.hu/projects/pcb-rnd/")
434 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
435 featuring various improvements and bug fixes.")))
436
437 (define-public fastcap
438 (package
439 (name "fastcap")
440 (version "2.0-18Sep92")
441 (source (origin
442 (method url-fetch/tarbomb)
443 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
444 name "-" version ".tgz"))
445 (sha256
446 (base32
447 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
448 (snippet
449 ;; Remove a non-free file.
450 '(begin
451 (delete-file "doc/psfig.sty")
452 #t))
453 (patches (search-patches "fastcap-mulSetup.patch"
454 "fastcap-mulGlobal.patch"))))
455 (build-system gnu-build-system)
456 (native-inputs
457 ;; FIXME: with texlive-tiny citation references are rendered as question
458 ;; marks. During the build warnings like these are printed:
459 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
460 `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts)))
461 ("ghostscript" ,ghostscript)))
462 (arguments
463 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
464 #:parallel-build? #f
465 #:tests? #f ;; no tests-suite
466 #:modules ((srfi srfi-1)
467 ,@%gnu-build-system-modules)
468 #:phases
469 (modify-phases %standard-phases
470 (add-after 'build 'make-doc
471 (lambda _
472 (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
473 (add-before 'make-doc 'fix-doc
474 (lambda _
475 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
476 (substitute* (find-files "doc" "\\.tex")
477 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
478 all file scale)
479 (string-append "\\includegraphics[scale=" scale "]{"
480 file "}"))
481 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
482 all file width)
483 (string-append "\\includegraphics[width=" width "]{"
484 file "}"))
485 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
486 all file height)
487 (string-append "\\includegraphics[height=" height "]{"
488 file "}"))
489 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
490 (string-append "\\includegraphics{" file "}")))
491 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
492 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
493 all options class)
494 (string-append "\\documentclass[" options "]{"
495 class "}\n"
496 "\\usepackage{graphicx}\n"
497 "\\usepackage{robinspace}"))
498 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
499 (string-append "%" all))
500 (("\\\\setstretch\\{.*\\}" all)
501 (string-append "%" all)))
502 #t))
503 (delete 'configure)
504 (add-before 'install 'clean-bin
505 (lambda _
506 (delete-file (string-append (getcwd) "/bin/README"))
507 #t))
508 (add-before 'install 'make-pdf
509 (lambda _
510 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
511 (with-directory-excursion "doc"
512 (and
513 (for-each (lambda (file)
514 (invoke "dvips" file "-o"))
515 (find-files "." "\\.dvi"))
516 (for-each (lambda (file)
517 (invoke "ps2pdf" file))
518 '("mtt.ps" "ug.ps" "tcad.ps"))
519 (invoke "make" "clean")))))
520 (replace 'install
521 (lambda* (#:key outputs #:allow-other-keys)
522 (let* ((out (assoc-ref outputs "out"))
523 (data (string-append out "/share"))
524 (bin (string-append out "/bin"))
525 (doc (string-append data "/doc/" ,name "-" ,version))
526 (examples (string-append doc "/examples")))
527 (with-directory-excursion "bin"
528 (for-each (lambda (f)
529 (install-file f bin))
530 (find-files "." ".*")))
531 (copy-recursively "doc" doc)
532 (copy-recursively "examples" examples)
533 #t))))))
534 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
535 (synopsis "Multipole-accelerated capacitance extraction program")
536 (description
537 "Fastcap is a capacitance extraction program based on a
538 multipole-accelerated algorithm.")
539 (license (license:non-copyleft #f "See fastcap.c."))))
540
541 (define-public fasthenry
542 (package
543 (name "fasthenry")
544 (version "3.0-12Nov96")
545 (source (origin
546 (method url-fetch)
547 (file-name (string-append name "-" version ".tar.gz"))
548 (uri (string-append
549 "http://www.rle.mit.edu/cpg/codes/" name
550 "-" version ".tar.z"))
551 (sha256
552 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
553 (patches (search-patches "fasthenry-spAllocate.patch"
554 "fasthenry-spBuild.patch"
555 "fasthenry-spUtils.patch"
556 "fasthenry-spSolve.patch"
557 "fasthenry-spFactor.patch"))))
558 (build-system gnu-build-system)
559 (arguments
560 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
561 #:parallel-build? #f
562 #:tests? #f ;; no tests-suite
563 #:modules ((srfi srfi-1)
564 ,@%gnu-build-system-modules)
565 #:phases
566 (modify-phases %standard-phases
567 (delete 'configure)
568 (replace 'install
569 (lambda* (#:key outputs #:allow-other-keys)
570 (let* ((out (assoc-ref outputs "out"))
571 (data (string-append out "/share"))
572 (bin (string-append out "/bin"))
573 (doc (string-append data "/doc/" ,name "-" ,version))
574 (examples (string-append doc "/examples")))
575 (with-directory-excursion "bin"
576 (for-each (lambda (f)
577 (install-file f bin))
578 (find-files "." ".*")))
579 (copy-recursively "doc" doc)
580 (copy-recursively "examples" examples)
581 #t))))))
582 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
583 (synopsis "Multipole-accelerated inductance analysis program")
584 (description
585 "Fasthenry is an inductance extraction program based on a
586 multipole-accelerated algorithm.")
587 (license (license:non-copyleft #f "See induct.c."))))
588
589 (define-public fritzing
590 (package
591 (name "fritzing")
592 (version "0.9.3b")
593 (source (origin
594 (method git-fetch)
595 (uri (git-reference
596 (url "https://github.com/fritzing/fritzing-app.git")
597 (commit version)))
598 (file-name (git-file-name name version))
599 (sha256
600 (base32
601 "0hpyc550xfhr6gmnc85nq60w00rm0ljm0y744dp0z88ikl04f4s3"))))
602 (build-system gnu-build-system)
603 (arguments
604 `(#:phases
605 (modify-phases %standard-phases
606 (replace 'configure
607 (lambda* (#:key inputs outputs #:allow-other-keys)
608 (copy-recursively (assoc-ref inputs "fritzing-parts-db")
609 "parts")
610 ;; Make compatible with libgit2 > 0.24
611 (substitute* "src/version/partschecker.cpp"
612 (("error = git_remote_connect\\(remote, GIT_DIRECTION_FETCH, &callbacks\\)")
613 "error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks, NULL, NULL)"))
614
615 ;; Use system libgit2 and boost.
616 (substitute* "phoenix.pro"
617 (("^LIBGIT2INCLUDE =.*")
618 (string-append "LIBGIT2INCLUDE="
619 (assoc-ref inputs "libgit2") "/include\n"))
620 (("^ LIBGIT2LIB =.*")
621 (string-append " LIBGIT2LIB="
622 (assoc-ref inputs "libgit2") "/lib\n")))
623 ;; This file checks for old versions of Boost, insisting on
624 ;; having us download the boost sources and placing them in the
625 ;; build directory.
626 (substitute* "pri/utils.pri"
627 (("error\\(") "message("))
628
629 (let ((out (assoc-ref outputs "out")))
630 (invoke "qmake"
631 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib")
632 (string-append "PREFIX=" out)
633 "phoenix.pro")))))))
634 (inputs
635 `(("qtbase" ,qtbase)
636 ("qtserialport" ,qtserialport)
637 ("qtsvg" ,qtsvg)
638 ("libgit2" ,libgit2)
639 ("boost" ,boost)
640 ("zlib" ,zlib)
641 ("fritzing-parts-db"
642 ,(origin
643 (method git-fetch)
644 (uri (git-reference
645 (url "https://github.com/fritzing/fritzing-parts.git")
646 (commit version)))
647 (file-name (git-file-name "fritzing-parts" version))
648 (sha256
649 (base32
650 "1d2v8k7p176j0lczx4vx9n9gbg3vw09n2c4b6w0wj5wqmifywhc1"))))))
651 (home-page "https://fritzing.org")
652 (synopsis "Electronic circuit design")
653 (description
654 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
655 software with a low entry barrier, suited for the needs of makers and
656 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
657 library with many commonly used high-level components. Fritzing makes it very
658 easy to communicate about circuits, as well as to turn them into PCB layouts
659 ready for production.")
660 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
661 ;; released under GPLv3+.
662 (license (list license:gpl3+ license:cc-by-sa3.0))))
663
664 (define-public gerbv
665 (package
666 (name "gerbv")
667 (version "2.7.0")
668 (source (origin
669 (method url-fetch)
670 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
671 version "/gerbv-" version ".tar.gz"))
672 (sha256
673 (base32
674 "1d2k43k7i4yvbpi4sw1263a8d0q98z2n7aqhmpinpkih8a681vn5"))))
675 (build-system gnu-build-system)
676 (native-inputs
677 `(("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
678 ("pkg-config" ,pkg-config)))
679 (inputs
680 `(("cairo" ,cairo)
681 ("gtk" ,gtk+-2)
682 ("desktop-file-utils" ,desktop-file-utils)))
683 (home-page "http://gerbv.geda-project.org/")
684 (synopsis "Gerber file viewer")
685 (description
686 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
687 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
688 you load several files on top of each other, do measurements on the displayed
689 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
690 as well as pick-place files.")
691 (license license:gpl2+)))
692
693 (define-public translate2geda
694 ;; There has been no formal release yet.
695 (let ((commit "4c19e7eefa338cea8f1ee999ea8b37f8d0698169")
696 (revision "1"))
697 (package
698 (name "translate2geda")
699 (version (git-version "0" revision commit))
700 (source (origin
701 (method git-fetch)
702 (uri (git-reference
703 (url "https://github.com/erichVK5/translate2geda.git")
704 (commit commit)))
705 (file-name (git-file-name name version))
706 (sha256
707 (base32
708 "1h062bbpw8nk0jamkya1k4lsgaia796jyviiz2gkdi6k1bxhwgpa"))))
709 (build-system ant-build-system)
710 (arguments
711 `(#:tests? #f ; there are no tests
712 #:jar-name "translate2geda.jar"
713 #:source-dir "."
714 #:main-class "translate2geda"
715 #:phases
716 (modify-phases %standard-phases
717 (add-after 'install 'install-bin
718 (lambda* (#:key inputs outputs #:allow-other-keys)
719 (let* ((out (assoc-ref outputs "out"))
720 (bin (string-append out "/bin"))
721 (wrapper (string-append bin "/translate2geda")))
722 (mkdir-p bin)
723 (with-output-to-file wrapper
724 (lambda _
725 (format #t "#!/bin/sh~%exec ~a -jar ~a/share/java/translate2geda.jar"
726 (which "java") out)))
727 (chmod wrapper #o555))
728 #t)))))
729 (home-page "https://github.com/erichVK5/translate2geda")
730 (synopsis "Utility for converting symbol and footprint formats to gEDA")
731 (description
732 "This package provides a utility for converting Kicad (@file{.mod},
733 @file{.lib}), Eagle (@file{.lbr}), gerber (@file{.gbr}, etc..),
734 BXL (@file{.bxl}), IBIS (@file{.ibs}), symdef, LT-Spice (@file{.asc}),
735 QUCS (@file{.sch}), and BSDL (@file{.bsd}) symbols and footprints and EggBot
736 fonts to gEDA.")
737 (license license:gpl2+))))
738
739 (define-public libfive
740 (let ((commit "6e39254e57c179459bb929df49ae96a6017a0ed6")
741 (revision "3"))
742 (package
743 (name "libfive")
744 (version (git-version "0" revision commit))
745 (source (origin
746 (method git-fetch)
747 (uri (git-reference
748 (url "https://github.com/libfive/libfive")
749 (commit commit)))
750 (sha256
751 (base32
752 "0ryv2hcbrwqc087w7rrs4a2irkcpmqync00g4dh8n7jn10w2jkim"))
753 (file-name (git-file-name name version))
754 (snippet
755 ;; Remove bundled catch since we provide our own.
756 '(begin
757 (delete-file "libfive/test/catch.hpp")
758 #t))))
759 (build-system cmake-build-system)
760 (arguments
761 `(#:test-target "libfive-test"
762 #:phases
763 (modify-phases %standard-phases
764 (add-after 'unpack 'remove-native-compilation
765 (lambda _
766 (substitute* "CMakeLists.txt" (("-march=native") ""))
767 #t))
768 (add-after 'unpack 'find-catch
769 (lambda* (#:key inputs #:allow-other-keys)
770 (setenv "CPLUS_INCLUDE_PATH"
771 (string-append (assoc-ref inputs "catch")
772 "/include/catch"))
773 #t)))))
774 (native-inputs
775 `(("pkg-config" ,pkg-config)))
776 (inputs
777 `(("boost" ,boost)
778 ("catch" ,catch-framework2)
779 ("libpng" ,libpng)
780 ("qtbase" ,qtbase)
781 ("eigen" ,eigen)
782 ("guile" ,guile-2.2)))
783 (home-page "https://libfive.com")
784 (synopsis "Tool for programmatic computer-aided design")
785 (description
786 "Libfive is a tool for programmatic computer-aided design (CAD). In
787 libfive, solid models are defined as Scheme scripts, and there are no opaque
788 function calls into the geometry kernel: everything is visible to the user.
789 Even fundamental, primitive shapes are represented as code in the user-level
790 language.")
791 (license (list license:mpl2.0 ;library
792 license:gpl2+))))) ;Guile bindings and GUI
793
794 ;; TODO Add doc https://gitlab.com/kicad/services/kicad-doc/-/tree/master
795 (define-public kicad
796 (package
797 (name "kicad")
798 (version "5.1.5")
799 (source
800 (origin
801 (method url-fetch)
802 (file-name (string-append name "-" version ".tar.xz"))
803 (uri (string-append
804 "https://launchpad.net/kicad/" (version-major version)
805 ".0/" version "/+download/kicad-" version ".tar.xz"))
806 (sha256
807 (base32 "0x3417f2pa7p65s9f7l49rqbnrzy8gz6i0n07mlbxqbnm0fmlql0"))))
808 (build-system cmake-build-system)
809 (arguments
810 `(#:out-of-source? #t
811 #:tests? #f ; no tests
812 #:build-type "Release"
813 #:configure-flags
814 (list "-DKICAD_SCRIPTING_PYTHON3=ON"
815 "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
816 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
817 #:phases
818 (modify-phases %standard-phases
819 (add-after 'install 'install-translations
820 (lambda* (#:key inputs outputs #:allow-other-keys)
821 (copy-recursively (assoc-ref inputs "kicad-i18l")
822 (assoc-ref outputs "out"))
823 #t))
824 (add-after 'install 'wrap-program
825 ;; Ensure correct Python at runtime.
826 (lambda* (#:key inputs outputs #:allow-other-keys)
827 (let* ((out (assoc-ref outputs "out"))
828 (python (assoc-ref inputs "python"))
829 (file (string-append out "/bin/kicad"))
830 (path (string-append
831 out
832 "/lib/python"
833 ,(version-major+minor
834 (package-version python))
835 "/site-packages:"
836 (getenv "PYTHONPATH"))))
837 (wrap-program file
838 `("PYTHONPATH" ":" prefix (,path))
839 `("PATH" ":" prefix
840 (,(string-append python "/bin:")))))
841 #t)))))
842 (native-search-paths
843 (list (search-path-specification
844 (variable "KICAD_TEMPLATE_DIR")
845 (files '("share/kicad/template")))
846 (search-path-specification
847 (variable "KICAD_SYMBOL_DIR") ; symbol path
848 (files '("share/kicad/library")))
849 (search-path-specification
850 (variable "KISYSMOD") ; footprint path
851 (files '("share/kicad/modules")))
852 (search-path-specification
853 (variable "KISYS3DMOD") ; 3D model path
854 (files '("share/kicad/modules/packages3d")))))
855 (native-inputs
856 `(("boost" ,boost)
857 ("desktop-file-utils" ,desktop-file-utils)
858 ("gettext" ,gnu-gettext)
859 ("kicad-i18l" ,kicad-i18l)
860 ("pkg-config" ,pkg-config)
861 ("swig" ,swig)
862 ("zlib" ,zlib)))
863 (inputs
864 `(("cairo" ,cairo)
865 ("curl" ,curl)
866 ("glew" ,glew)
867 ("glm" ,glm)
868 ("hicolor-icon-theme" ,hicolor-icon-theme)
869 ("libngspice" ,libngspice)
870 ("libsm" ,libsm)
871 ("mesa" ,mesa)
872 ("opencascade-oce" ,opencascade-oce)
873 ("openssl" ,openssl)
874 ("python" ,python-wrapper)
875 ("wxwidgets" ,wxwidgets)
876 ("wxpython" ,python-wxpython)))
877 (home-page "https://kicad-pcb.org/")
878 (synopsis "Electronics Design Automation Suite")
879 (description "Kicad is a program for the formation of printed circuit
880 boards and electrical circuits. The software has a number of programs that
881 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
882 electrical diagrams), gerbview (viewing Gerber files) and others.")
883 (license license:gpl3+)))
884
885 (define kicad-i18l
886 (package
887 (name "kicad-i18l")
888 (version "5.1.5")
889 (source (origin
890 (method git-fetch)
891 (uri (git-reference
892 (url "https://gitlab.com/kicad/code/kicad-i18n.git")
893 (commit version)))
894 (file-name (git-file-name name version))
895 (sha256
896 (base32
897 "1rfpifl8vky1gba2angizlb2n7mwmsiai3r6ip6qma60wdj8sbd3"))))
898 (build-system cmake-build-system)
899 (arguments
900 `(#:phases
901 (modify-phases %standard-phases
902 (delete 'build)
903 (delete 'check))))
904 (native-inputs
905 `(("gettext" ,gnu-gettext)))
906 (home-page "https://kicad-pcb.org/")
907 (synopsis "KiCad GUI translations")
908 (description "This package contains the po files that are used for the GUI
909 translations for KiCad.")
910 (license license:gpl3+)))
911
912 (define-public kicad-symbols
913 (package
914 (name "kicad-symbols")
915 (version "5.1.5")
916 (source (origin
917 (method git-fetch)
918 (uri (git-reference
919 (url "https://github.com/KiCad/kicad-symbols.git")
920 (commit version)))
921 (file-name (git-file-name name version))
922 (sha256
923 (base32
924 "048b07ffsaav1ssrchw2p870lvb4rsyb5vnniy670k7q9p16qq6h"))))
925 (build-system cmake-build-system)
926 (arguments
927 `(#:tests? #f)) ; no tests exist
928 (home-page "https://kicad-pcb.org/")
929 (synopsis "Official KiCad schematic symbol libraries")
930 (description "This package contains the official KiCad schematic symbol
931 libraries.")
932 ;; TODO: Exception: "To the extent that the creation of electronic designs
933 ;; that use 'Licensed Material' can be considered to be 'Adapted Material',
934 ;; then the copyright holder waives article 3 of the license with respect to
935 ;; these designs and any generated files which use data provided as part of
936 ;; the 'Licensed Material'."
937 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
938 (license license:cc-by-sa4.0)))
939
940 (define-public kicad-footprints
941 (package
942 (inherit kicad-symbols)
943 (name "kicad-footprints")
944 (version "5.1.5")
945 (source (origin
946 (method git-fetch)
947 (uri (git-reference
948 (url "https://github.com/KiCad/kicad-footprints.git")
949 (commit version)))
950 (file-name (git-file-name name version))
951 (sha256
952 (base32
953 "1c4whgn14qhz4yqkl46w13p6rpv1k0hsc9s9h9368fxfcz9knb2j"))))
954 (synopsis "Official KiCad footprint libraries")
955 (description "This package contains the official KiCad footprint libraries.")))
956
957 (define-public kicad-packages3d
958 (package
959 (inherit kicad-symbols)
960 (name "kicad-packages3d")
961 (version "5.1.5")
962 (source (origin
963 (method git-fetch)
964 (uri (git-reference
965 (url "https://github.com/KiCad/kicad-packages3d.git")
966 (commit version)))
967 (file-name (git-file-name name version))
968 (sha256
969 (base32
970 "0cff2ms1bsw530kqb1fr1m2pjixyxzwa81mxgac3qpbcf8fnpvaz"))))
971 (synopsis "Official KiCad 3D model libraries")
972 (description "This package contains the official KiCad 3D model libraries.")))
973
974 (define-public kicad-templates
975 (package
976 (inherit kicad-symbols)
977 (name "kicad-templates")
978 (version "5.1.5")
979 (source (origin
980 (method git-fetch)
981 (uri (git-reference
982 (url "https://github.com/KiCad/kicad-templates.git")
983 (commit version)))
984 (file-name (git-file-name name version))
985 (sha256
986 (base32
987 "0cs3bm3zb5ngw5ldn0lzw5bvqm4kvcidyrn76438alffwiz2b15g"))))
988 (synopsis "Official KiCad project and worksheet templates")
989 (description "This package contains the official KiCad project and
990 worksheet templates.")))
991
992 (define-public linsmith
993 (package
994 (name "linsmith")
995 (version "0.99.31")
996 (source (origin
997 (method url-fetch)
998 (uri (string-append
999 "mirror://sourceforge/linsmith/linsmith/linsmith-"
1000 version "/linsmith-" version ".tar.gz"))
1001 (sha256
1002 (base32
1003 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
1004 (build-system gnu-build-system)
1005 (native-inputs
1006 `(("pkg-config" ,pkg-config)
1007 ("gtk" ,gtk+-2)
1008 ("libgnome" ,libgnomeui)))
1009 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
1010 (synopsis "Smith Charting program")
1011 (description "LinSmith is a Smith Charting program, mainly designed for
1012 educational use. As such, there is an emphasis on capabilities that improve
1013 the 'showing the effect of'-style of operation.")
1014 (license license:gpl2+)))
1015
1016 (define-public volk
1017 (package
1018 (name "volk")
1019 (version "1.3")
1020 (source
1021 (origin
1022 (method url-fetch)
1023 (uri (string-append "http://libvolk.org/releases/volk-"
1024 version ".tar.gz"))
1025 (sha256
1026 (base32
1027 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
1028 (build-system cmake-build-system)
1029 (inputs
1030 `(("boost" ,boost)))
1031 (native-inputs
1032 `(("python-2" ,python-2)
1033 ("python2-cheetah" ,python2-cheetah)))
1034 (home-page "http://libvolk.org/")
1035 (synopsis "Vector-Optimized Library of Kernels")
1036 (description
1037 "@code{volk} contains procedures with machine-specific optimizations
1038 for mathematical functions. It also provides an machine-independent
1039 interface to select the best such procedures to use on a given system.")
1040 (license license:gpl3+)))
1041
1042 (define-public minicom
1043 (package
1044 (name "minicom")
1045 (version "2.7.1")
1046 (source
1047 (origin
1048 (method url-fetch)
1049 (uri (string-append "https://alioth.debian.org/frs/download.php/"
1050 "file/4215/" name "-" version ".tar.gz"))
1051 (sha256
1052 (base32
1053 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
1054 (build-system gnu-build-system)
1055 (arguments
1056 `(#:configure-flags '("--enable-lock-dir=/var/lock")
1057 #:phases
1058 (modify-phases %standard-phases
1059 (add-after 'unpack 'patch-lock-check
1060 (lambda _
1061 (substitute* "configure"
1062 (("test -d [$]UUCPLOCK") "true"))
1063 #t)))))
1064 (inputs
1065 `(("ncurses" ,ncurses)))
1066 (home-page "https://alioth.debian.org/projects/minicom/")
1067 (synopsis "Serial terminal emulator")
1068 (description "@code{minicom} is a serial terminal emulator.")
1069 (license license:gpl2+)))
1070
1071 (define-public harminv
1072 (package
1073 (name "harminv")
1074 (version "1.4.1")
1075 (source (origin
1076 (method url-fetch)
1077 (uri
1078 (string-append "https://github.com/stevengj/harminv/"
1079 "releases/download/v" version "/"
1080 name "-" version ".tar.gz"))
1081 (sha256
1082 (base32
1083 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
1084 (build-system gnu-build-system)
1085 (arguments
1086 `(#:configure-flags '("--enable-shared")
1087 #:phases
1088 (modify-phases %standard-phases
1089 (add-before 'configure 'fix-tests
1090 (lambda _
1091 (substitute* "./sines-test.sh"
1092 ; change test frequency range - default fails
1093 (("0\\.15") "0.16"))
1094 #t)))))
1095 (native-inputs
1096 `(("fortran" ,gfortran)))
1097 (inputs
1098 `(("lapack" ,lapack)))
1099 (home-page "https://github.com/stevengj/harminv")
1100 (synopsis "Harmonic inversion solver")
1101 (description
1102 "Harminv is a free program (and accompanying library) to solve the problem of
1103 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
1104 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
1105 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
1106 (license license:gpl2+)))
1107
1108 (define-public guile-libctl
1109 (package
1110 (name "guile-libctl")
1111 (version "4.2.0")
1112 (source (origin
1113 (method url-fetch)
1114 (uri
1115 (string-append
1116 "https://github.com/NanoComp/libctl/releases/download/v"
1117 version "/libctl-" version ".tar.gz"))
1118 (sha256
1119 (base32
1120 "0x8r56lpfq83kfbq28vr25icl19xpfd6fjrxzcpdmv30l9pash83"))))
1121 (build-system gnu-build-system)
1122 (arguments
1123 `(#:configure-flags '("--enable-shared")))
1124 (native-inputs
1125 `(("fortran" ,gfortran)))
1126 (inputs
1127 `(("guile" ,guile-2.2)))
1128 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
1129 (synopsis "Flexible control files implementation for scientific simulations")
1130 (description
1131 "Libctl is a Guile-based library implementing flexible control files
1132 for scientific simulations.")
1133 (license license:gpl2+)))
1134
1135 (define-public mpb
1136 (package
1137 (name "mpb")
1138 (version "1.8.0")
1139 (source (origin
1140 (method url-fetch)
1141 (uri
1142 (string-append
1143 "https://github.com/NanoComp/mpb/releases/download/v"
1144 version "/mpb-" version ".tar.gz"))
1145 (sha256
1146 (base32
1147 "1jgrb7dd6qs6j6y1gnxmdgrh79l2bvqa6nk60a4pw1annsks4brd"))))
1148 (build-system gnu-build-system)
1149 (arguments
1150 `(#:configure-flags
1151 (list (string-append "--with-libctl="
1152 (assoc-ref %build-inputs "libctl")
1153 "/share/libctl")
1154 "--enable-shared")))
1155 (native-inputs
1156 `(("fortran" ,gfortran)
1157 ("pkg-config" ,pkg-config)
1158 ("swig" ,swig)))
1159 (inputs
1160 `(("fftw" ,fftw)
1161 ("gsl" ,gsl)
1162 ("guile" ,guile-2.2)
1163 ("hdf5" ,hdf5)
1164 ("lapack" ,lapack)
1165 ("libctl" ,guile-libctl)
1166 ("readline" ,readline)
1167 ("zlib" ,zlib)))
1168 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1169 (synopsis "Computes band structures and electromagnetic modes of dielectric
1170 structures")
1171 (description
1172 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1173 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1174 fully-vectorial and three-dimensional methods.")
1175 (license license:gpl2+)))
1176
1177 (define-public meep
1178 (package
1179 (name "meep")
1180 (version "1.8.0")
1181 (source (origin
1182 (method url-fetch)
1183 (uri
1184 (string-append
1185 "https://github.com/NanoComp/meep/releases/download/v"
1186 version "/meep-" version ".tar.gz"))
1187 (sha256
1188 (base32
1189 "14zyxmm3p80j5fz5b89sl7hgkgcisqjny5hjh4pi274ziqjqz8bm"))))
1190 (build-system gnu-build-system)
1191 (arguments
1192 `(#:configure-flags
1193 (list (string-append "--with-libctl="
1194 (assoc-ref %build-inputs "libctl")
1195 "/share/libctl"))))
1196 (native-inputs
1197 `(("fortran" ,gfortran)
1198 ("pkg-config" ,pkg-config)
1199 ("swig" ,swig)))
1200 (inputs
1201 `(("fftw" ,fftw)
1202 ("gsl" ,gsl)
1203 ("guile" ,guile-2.2)
1204 ("harminv" ,harminv)
1205 ("hdf5" ,hdf5)
1206 ("lapack" ,lapack)
1207 ("libctl" ,guile-libctl)
1208 ("mpb" ,mpb)
1209 ("zlib" ,zlib)))
1210 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1211 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1212 (description
1213 "Meep is a finite-difference time-domain (FDTD) simulation software package
1214 developed at MIT to model electromagnetic systems.")
1215 (license license:gpl2+)))
1216
1217 (define-public adms
1218 (package
1219 (name "adms")
1220 (version "2.3.6")
1221 (source (origin
1222 (method url-fetch)
1223 (uri
1224 (string-append
1225 "mirror://sourceforge/mot-adms/adms-source/"
1226 (version-major+minor version) "/adms-" version ".tar.gz"))
1227 (sha256
1228 (base32
1229 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1230 (build-system gnu-build-system)
1231 (native-inputs
1232 `(("flex" ,flex)
1233 ("bison" ,bison)))
1234 (home-page "https://sourceforge.net/projects/mot-adms")
1235 (synopsis "Automatic device model synthesizer")
1236 (description
1237 "ADMS is a code generator that converts electrical compact device models
1238 specified in high-level description language into ready-to-compile C code for
1239 the API of spice simulators. Based on transformations specified in XML
1240 language, ADMS transforms Verilog-AMS code into other target languages.")
1241 (license license:gpl3)))
1242
1243 (define-public capstone
1244 (package
1245 (name "capstone")
1246 (version "3.0.5")
1247 (source (origin
1248 (method git-fetch)
1249 (uri (git-reference
1250 (url "https://github.com/aquynh/capstone")
1251 (commit version)))
1252 (file-name (git-file-name name version))
1253 (sha256
1254 (base32
1255 "0dgf82kxj4rs45d6s8sr984c38sll1n5scpypjlyh21gh2yl4qfw"))))
1256 (build-system gnu-build-system)
1257 (arguments
1258 `(#:tests? #f
1259 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1260 "CC=gcc")
1261 #:phases
1262 (modify-phases %standard-phases
1263 (delete 'configure) ; no configure script
1264 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1265 (add-before 'build 'fix-cstool-ldflags
1266 (lambda* (#:key outputs #:allow-other-keys)
1267 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1268 (assoc-ref outputs "out") "/lib"))
1269 #t)))))
1270 (home-page "https://www.capstone-engine.org")
1271 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1272 (description
1273 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1274 framework. Capstone can disassemble machine code for many supported architectures
1275 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1276 bindings for Python, Java, OCaml and more.")
1277 (license license:bsd-3)))
1278
1279 ;; FIXME: This package has a timestamp embedded in
1280 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1281 (define-public python-capstone
1282 (package
1283 (inherit capstone)
1284 (name "python-capstone")
1285 (propagated-inputs
1286 `(("capstone" ,capstone)))
1287 (build-system python-build-system)
1288 (arguments
1289 `(#:phases
1290 (modify-phases %standard-phases
1291 (add-after 'unpack 'chdir-and-fix-setup-py
1292 (lambda _
1293 (chdir "bindings/python")
1294 ;; Do not build the library again, because we already have it.
1295 (substitute* "setup.py" ((".* build_libraries.*") ""))
1296 ;; This substitution tells python-capstone where to find the
1297 ;; library.
1298 (substitute* "capstone/__init__.py"
1299 (("pkg_resources.resource_filename.*")
1300 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1301 #t)))))))
1302
1303 (define-public python2-capstone
1304 (package-with-python2 python-capstone))
1305
1306 (define-public radare2
1307 (package
1308 (name "radare2")
1309 (version "4.2.1")
1310 (source (origin
1311 (method git-fetch)
1312 (uri (git-reference
1313 (url "https://github.com/radareorg/radare2")
1314 (commit version)))
1315 (sha256
1316 (base32
1317 "14b9433cgc2nabhz836zfgvgh2dwailcmvy05krsa0inmzbvx9fg"))
1318 (file-name (git-file-name name version))
1319 (modules '((guix build utils)))
1320 (snippet
1321 '(begin
1322 (substitute* "libr/asm/p/Makefile"
1323 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1324 (substitute* "libr/parse/p/Makefile"
1325 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1326 (substitute* "libr/bin/p/Makefile"
1327 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1328 #t))))
1329 (build-system gnu-build-system)
1330 (arguments
1331 '(#:tests? #f ; tests require git and network access
1332 #:phases
1333 (modify-phases %standard-phases
1334 (add-before 'configure 'mklibdir
1335 (lambda* (#:key inputs #:allow-other-keys)
1336 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1337 #t)))
1338 #:configure-flags
1339 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1340 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1341 #:make-flags
1342 (list "CC=gcc")))
1343 (inputs
1344 `(("openssl" ,openssl)
1345 ("zip" ,zip)
1346 ("gmp" ,gmp)
1347 ("capstone" ,capstone)))
1348 (native-inputs
1349 `(("pkg-config" ,pkg-config)))
1350 (home-page "https://radare.org/")
1351 (synopsis "Reverse engineering framework")
1352 (description
1353 "Radare2 is a complete framework for reverse-engineering, debugging, and
1354 analyzing binaries. It is composed of a set of small utilities that can be
1355 used together or independently from the command line.
1356
1357 Radare2 is built around a scriptable disassembler and hexadecimal editor that
1358 support a variety of executable formats for different processors and operating
1359 systems, through multiple back ends for local and remote files and disk
1360 images.
1361
1362 It can also compare (@dfn{diff}) binaries with graphs and extract information
1363 like relocation symbols. It is able to deal with malformed binaries, making
1364 it suitable for security research and analysis.")
1365 (license license:lgpl3)))
1366
1367 (define-public asco
1368 (package
1369 (name "asco")
1370 (version "0.4.10")
1371 (source (origin
1372 (method url-fetch)
1373 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1374 version ".tar.gz"))
1375 (sha256
1376 (base32
1377 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1378 (build-system gnu-build-system)
1379 (arguments
1380 `(#:tests? #f ; no tests
1381 #:make-flags '("all" "asco-mpi")
1382 #:phases
1383 (modify-phases %standard-phases
1384 (delete 'configure)
1385 (add-before 'build 'fix-paths
1386 (lambda* (#:key inputs #:allow-other-keys)
1387 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1388 (substitute* '("errfunc.c" "asco.c")
1389 (("cp ")
1390 (string-append coreutils "/bin/cp "))
1391 (("nice")
1392 (string-append coreutils "/bin/nice")))
1393 (substitute* "Makefile"
1394 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1395 #t)))
1396 (replace 'install ; no install target
1397 (lambda* (#:key outputs #:allow-other-keys)
1398 (for-each (lambda (file)
1399 (install-file file (string-append
1400 (assoc-ref outputs "out")
1401 "/bin")))
1402 '("asco" "asco-mpi" "asco-test"
1403 "tools/alter/alter" "tools/log/log"))
1404 #t)))))
1405 (native-inputs
1406 `(("mpi" ,openmpi)))
1407 (inputs
1408 `(("coreutils-minimal" ,coreutils-minimal)))
1409 (home-page "http://asco.sourceforge.net/")
1410 (synopsis "SPICE circuit optimizer")
1411 (description
1412 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1413 high-performance parallel differential evolution (DE) optimization algorithm.")
1414 (license license:gpl2+)))
1415
1416 (define-public libngspice
1417 ;; Note: The ngspice's build system does not allow us to build both the
1418 ;; library and the executables in one go. Thus, we have two packages.
1419 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1420 (package
1421 (name "libngspice")
1422 (version "28")
1423 (source (origin
1424 (method url-fetch)
1425 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1426 version "/ngspice-" version ".tar.gz"))
1427 (sha256
1428 (base32
1429 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1430 (modules '((guix build utils)))
1431 ;; We remove the non-free cider and build without it.
1432 (snippet
1433 '(begin
1434 (delete-file-recursively "src/ciderlib")
1435 (delete-file "src/ciderinit")
1436 (substitute* "configure"
1437 (("src/ciderlib/Makefile") "")
1438 (("src/ciderlib/input/Makefile") "")
1439 (("src/ciderlib/support/Makefile") "")
1440 (("src/ciderlib/oned/Makefile") "")
1441 (("src/ciderlib/twod/Makefile") ""))
1442 #t))))
1443 (build-system gnu-build-system)
1444 (arguments
1445 `(;; No tests for libngspice exist.
1446 ;; The transient tests for ngspice fail.
1447 #:tests? #f
1448 #:phases
1449 (modify-phases %standard-phases
1450 (add-after 'unpack 'patch-timestamps
1451 (lambda _
1452 (substitute* "configure"
1453 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1454 #t))
1455 (add-after 'unpack 'delete-program-manuals
1456 (lambda _
1457 (substitute* "man/man1/Makefile.in"
1458 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1459 "man_MANS = "))
1460 #t))
1461 (add-after 'install 'delete-script-files
1462 (lambda* (#:key outputs #:allow-other-keys)
1463 (delete-file-recursively
1464 (string-append (assoc-ref outputs "out")
1465 "/share/ngspice/scripts")))))
1466 #:configure-flags
1467 (list "--enable-openmp"
1468 "--enable-xspice"
1469 "--with-ngshared"
1470 "--with-readline=yes")))
1471 (native-inputs
1472 `(("bison" ,bison)
1473 ("flex" ,flex)))
1474 (inputs
1475 `(("libxaw" ,libxaw)
1476 ("mpi" ,openmpi)
1477 ("readline" ,readline)))
1478 (home-page "http://ngspice.sourceforge.net/")
1479 (synopsis "Mixed-level/mixed-signal circuit simulator")
1480 (description
1481 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1482 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1483 provides code modeling support and simulation of digital components through
1484 an embedded event driven algorithm.")
1485 (license (list license:lgpl2.0+ ; code in frontend/numparam
1486 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1487 license:public-domain)))) ; xspice
1488
1489 (define-public ngspice
1490 ;; The ngspice executables (see libngpsice above.)
1491 (package (inherit libngspice)
1492 (name "ngspice")
1493 (arguments
1494 (substitute-keyword-arguments (package-arguments libngspice)
1495 ((#:configure-flags flags)
1496 `(delete "--with-ngshared" ,flags))
1497 ((#:phases phases)
1498 `(modify-phases ,phases
1499 (add-after 'unpack 'delete-include-files
1500 (lambda _
1501 (substitute* "src/Makefile.in"
1502 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1503 "SUBDIRS = misc maths frontend spicelib"))
1504 #t))
1505 (add-after 'install 'delete-cmpp-dlmain
1506 (lambda* (#:key outputs #:allow-other-keys)
1507 (for-each (lambda (file)
1508 (delete-file
1509 (string-append (assoc-ref outputs "out")
1510 file)))
1511 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1512 #t))
1513 (delete 'delete-program-manuals)
1514 (delete 'delete-script-files)))))
1515 (inputs
1516 `(("libngspice" ,libngspice)
1517 ("readline" ,readline)))))
1518
1519 (define trilinos-serial-xyce
1520 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1521 ;; keep it private. See
1522 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1523 ;; TODO: Remove when we have modular Trilinos packages?
1524 (package
1525 (name "trilinos-serial-xyce")
1526 (version "12.12.1")
1527 (source
1528 (origin (method url-fetch)
1529 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1530 version "-Source.tar.gz"))
1531 (sha256
1532 (base32
1533 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1534 (build-system cmake-build-system)
1535 (arguments
1536 `(#:out-of-source? #t
1537 #:phases
1538 (modify-phases %standard-phases
1539 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1540 ;; phase to fail.
1541 (add-before 'validate-runpath 'delete-tribits
1542 (lambda* (#:key outputs #:allow-other-keys)
1543 (delete-file-recursively
1544 (string-append (assoc-ref outputs "out")
1545 "/lib/cmake/tribits"))
1546 #t)))
1547 #:configure-flags
1548 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1549 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1550 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1551 "-DTrilinos_ENABLE_NOX=ON"
1552 "-DNOX_ENABLE_LOCA=ON"
1553 "-DTrilinos_ENABLE_EpetraExt=ON"
1554 "-DEpetraExt_BUILD_BTF=ON"
1555 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1556 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1557 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1558 "-DTrilinos_ENABLE_Ifpack=ON"
1559 "-DTrilinos_ENABLE_Isorropia=ON"
1560 "-DTrilinos_ENABLE_AztecOO=ON"
1561 "-DTrilinos_ENABLE_Belos=ON"
1562 "-DTrilinos_ENABLE_Teuchos=ON"
1563 "-DTeuchos_ENABLE_COMPLEX=ON"
1564 "-DTrilinos_ENABLE_Amesos=ON"
1565 "-DAmesos_ENABLE_KLU=ON"
1566 "-DAmesos_ENABLE_UMFPACK=ON"
1567 "-DTrilinos_ENABLE_Sacado=ON"
1568 "-DTrilinos_ENABLE_Kokkos=OFF"
1569 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1570 "-DTPL_ENABLE_AMD=ON"
1571 "-DTPL_ENABLE_UMFPACK=ON"
1572 "-DTPL_ENABLE_BLAS=ON"
1573 "-DTPL_ENABLE_LAPACK=ON")))
1574 (native-inputs
1575 `(("fortran" ,gfortran)
1576 ("swig" ,swig)))
1577 (inputs
1578 `(("boost" ,boost)
1579 ("lapack" ,lapack)
1580 ("suitesparse" ,suitesparse)))
1581 (home-page "https://trilinos.org")
1582 (synopsis "Engineering and scientific problems algorithms")
1583 (description
1584 "The Trilinos Project is an effort to develop algorithms and enabling
1585 technologies within an object-oriented software framework for the solution of
1586 large-scale, complex multi-physics engineering and scientific problems. A
1587 unique design feature of Trilinos is its focus on packages.")
1588 (license (list license:lgpl2.1+
1589 license:bsd-3))))
1590
1591 (define-public xyce-serial
1592 (package
1593 (name "xyce-serial")
1594 (version "6.8")
1595 (source
1596 (origin (method url-fetch)
1597 (uri (string-append "https://archive.org/download/Xyce-"
1598 version "/Xyce-" version ".tar.gz"))
1599 (sha256
1600 (base32
1601 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1602 (build-system gnu-build-system)
1603 (arguments
1604 `(#:tests? #f
1605 #:configure-flags
1606 (list
1607 "CXXFLAGS=-O3"
1608 (string-append "ARCHDIR="
1609 (assoc-ref %build-inputs "trilinos")))))
1610 (native-inputs
1611 `(("bison" ,bison-3.0) ;'configure' fails with Bison 3.4
1612 ("flex" ,flex)
1613 ("fortran" ,gfortran)))
1614 (inputs
1615 `(("fftw" ,fftw)
1616 ("suitesparse" ,suitesparse)
1617 ("lapack" ,lapack)
1618 ("trilinos" ,trilinos-serial-xyce)))
1619 (home-page "https://xyce.sandia.gov/")
1620 (synopsis "High-performance analog circuit simulator")
1621 (description
1622 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1623 capable of solving extremely large circuit problems by supporting large-scale
1624 parallel computing platforms. It also supports serial execution.")
1625 (license license:gpl3+)))
1626
1627 (define trilinos-parallel-xyce
1628 (package (inherit trilinos-serial-xyce)
1629 (name "trilinos-parallel-xyce")
1630 (arguments
1631 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1632 ((#:configure-flags flags)
1633 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1634 "-DTrilinos_ENABLE_Zoltan=ON"
1635 "-DTPL_ENABLE_MPI=ON")
1636 ,flags)))))
1637 (inputs
1638 `(("mpi" ,openmpi)
1639 ,@(package-inputs trilinos-serial-xyce)))))
1640
1641 (define-public xyce-parallel
1642 (package (inherit xyce-serial)
1643 (name "xyce-parallel")
1644 (arguments
1645 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1646 ((#:configure-flags flags)
1647 `(list "CXXFLAGS=-O3"
1648 "CXX=mpiCC"
1649 "CC=mpicc"
1650 "F77=mpif77"
1651 "--enable-mpi"
1652 (string-append
1653 "ARCHDIR="
1654 (assoc-ref %build-inputs "trilinos")))))))
1655 (propagated-inputs
1656 `(("mpi" ,openmpi)))
1657 (inputs
1658 `(("trilinos" ,trilinos-parallel-xyce)
1659 ,@(alist-delete "trilinos"
1660 (package-inputs xyce-serial))))))
1661
1662 (define-public freehdl
1663 (package
1664 (name "freehdl")
1665 (version "0.0.8")
1666 (source (origin
1667 (method url-fetch)
1668 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1669 version ".tar.gz"))
1670 (sha256
1671 (base32
1672 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1673 (build-system gnu-build-system)
1674 (arguments
1675 `(#:phases
1676 (modify-phases %standard-phases
1677 (add-before 'configure 'patch-pkg-config
1678 (lambda* (#:key inputs #:allow-other-keys)
1679 (substitute* "freehdl/freehdl-config"
1680 (("pkg-config")
1681 (string-append (assoc-ref inputs "pkg-config")
1682 "/bin/pkg-config"))
1683 (("cat")
1684 (string-append (assoc-ref inputs "coreutils")
1685 "/bin/cat")))
1686 #t))
1687 (add-after 'patch-pkg-config 'setenv
1688 (lambda* (#:key inputs #:allow-other-keys)
1689 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1690 "/bin/g++"))
1691 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1692 "/bin/libtool"))
1693 #t))
1694 (add-after 'setenv 'patch-gvhdl
1695 (lambda _
1696 (substitute* "v2cc/gvhdl.in"
1697 (("--mode=link") "--mode=link --tag=CXX")
1698 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1699 #t))
1700 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1701 (lambda* (#:key inputs #:allow-other-keys)
1702 (substitute* "freehdl/freehdl-gennodes.in"
1703 (("guile")
1704 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1705 (("\\(debug") ";(debug")
1706 (("\\(@ ") "(apply-emit")
1707 (("\\(@@ ") "(apply-mini-format"))
1708 #t))
1709 (add-after 'configure 'patch-freehdl-pc
1710 (lambda* (#:key inputs #:allow-other-keys)
1711 (substitute* "freehdl.pc"
1712 (("=g\\+\\+")
1713 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1714 "/bin/g++"))
1715 (("=libtool")
1716 (string-append "=" (assoc-ref inputs "libtool")
1717 "/bin/libtool")))
1718 #t))
1719 (add-after 'install-scripts 'make-wrapper
1720 (lambda* (#:key inputs outputs #:allow-other-keys)
1721 (let ((out (assoc-ref outputs "out")))
1722 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1723 ;; file name.
1724 (wrap-program (string-append out "/bin/gvhdl")
1725 `("CPLUS_INCLUDE_PATH" ":" prefix
1726 (,(string-append (assoc-ref inputs "gcc-toolchain")
1727 "/include")))
1728 `("LIBRARY_PATH" ":" prefix
1729 (,(string-append (assoc-ref inputs "gcc-toolchain")
1730 "/lib")))
1731 `("PATH" ":" prefix
1732 (,(string-append (assoc-ref inputs "gcc-toolchain")
1733 "/bin")
1734 ,(string-append (assoc-ref inputs "coreutils")
1735 "/bin"))))
1736 (wrap-program (string-append out "/bin/freehdl-config")
1737 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1738 #t)))))
1739 (inputs
1740 `(("coreutils" ,coreutils)
1741 ("gcc-toolchain" ,gcc-toolchain)
1742 ("guile" ,guile-2.2)
1743 ("perl" ,perl)
1744 ("pkg-config" ,pkg-config)
1745 ("libtool" ,libtool)))
1746 (native-inputs
1747 `(("pkg-config-native" ,pkg-config)
1748 ("gcc" ,gcc-5)
1749 ("libtool-native" ,libtool)))
1750 (home-page "http://www.freehdl.seul.org/")
1751 (synopsis "VHDL simulator")
1752 (description
1753 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1754 VHDL'93 as well as VHDL'87 standards are supported.")
1755 (license (list license:gpl2+
1756 license:lgpl2.0+)))) ; freehdl's libraries
1757
1758 (define-public qucs
1759 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1760 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1761 ;; comment and update the package.
1762 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1763 (revision "0"))
1764 (package
1765 (name "qucs")
1766 (version (git-version "0.0.19" revision commit))
1767 (source (origin
1768 (method git-fetch)
1769 (uri (git-reference
1770 (url "https://github.com/Qucs/qucs")
1771 (commit commit)))
1772 (sha256
1773 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1774 (file-name (string-append name "-" version "-checkout"))))
1775 (build-system gnu-build-system)
1776 (arguments
1777 `(#:phases
1778 (modify-phases %standard-phases
1779 (add-before 'bootstrap 'patch-bootstrap
1780 (lambda _
1781 (for-each patch-shebang
1782 '("bootstrap"
1783 "qucs/bootstrap"
1784 "qucs-doc/bootstrap"
1785 "qucs-core/bootstrap"))
1786 #t))
1787 (add-before 'configure 'patch-configure
1788 (lambda* (#:key inputs #:allow-other-keys)
1789 (substitute* "qucs/configure"
1790 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1791 #t))
1792 (add-after 'patch-configure 'patch-scripts
1793 (lambda* (#:key inputs outputs #:allow-other-keys)
1794 (substitute* '("qucs/qucs/qucsdigi"
1795 "qucs/qucs/qucsdigilib"
1796 "qucs/qucs/qucsveri")
1797 (("\\$BINDIR")
1798 (string-append (assoc-ref outputs "out") "/bin"))
1799 (("freehdl-config")
1800 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1801 (("freehdl-v2cc")
1802 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1803 (("cp ")
1804 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1805 (("glibtool")
1806 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1807 (("sed")
1808 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1809 (("iverilog")
1810 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1811 (("vvp")
1812 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1813 #t))
1814 (add-before 'check 'pre-check
1815 (lambda _
1816 ;; The test suite requires a running X server.
1817 (system "Xvfb :1 &")
1818 (setenv "DISPLAY" ":1")
1819 #t))
1820 (add-after 'install 'make-wrapper
1821 (lambda* (#:key inputs outputs #:allow-other-keys)
1822 (let ((out (assoc-ref outputs "out")))
1823 ;; 'qucs' directly invokes gcc, hence this wrapping.
1824 (wrap-program (string-append out "/bin/qucs")
1825 `("CPLUS_INCLUDE_PATH" ":" prefix
1826 (,(string-append (assoc-ref inputs "gcc-toolchain")
1827 "/include")))
1828 `("PATH" ":" prefix
1829 (,(string-append (assoc-ref inputs "gcc-toolchain")
1830 "/bin")))
1831 `("LIBRARY_PATH" ":" prefix
1832 (,(string-append (assoc-ref inputs "gcc-toolchain")
1833 "/lib")))
1834 `("ADMSXMLBINDIR" ":" prefix
1835 (,(string-append (assoc-ref inputs "adms") "/bin")))
1836 `("ASCOBINDIR" ":" prefix
1837 (,(string-append (assoc-ref inputs "asco") "/bin")))
1838 `("QUCS_OCTAVE" ":" prefix
1839 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1840 #t)))
1841 #:parallel-build? #f ; race condition
1842 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1843 (native-inputs
1844 `(("autoconf" ,autoconf)
1845 ("automake" ,automake)
1846 ("bison" ,bison)
1847 ("flex" ,flex)
1848 ("gperf" ,gperf)
1849 ("libtool-native" ,libtool)
1850 ("pkg-config" ,pkg-config)
1851 ("python" ,python-2) ; for tests
1852 ("matplotlib" ,python2-matplotlib) ; for tests
1853 ("numpy" ,python2-numpy) ; for tests
1854 ("xorg-server" ,xorg-server-for-tests))) ; for tests
1855 (inputs
1856 `(("adms" ,adms)
1857 ("asco" ,asco)
1858 ("coreutils" ,coreutils)
1859 ("freehdl" ,freehdl)
1860 ("gcc-toolchain" ,gcc-toolchain)
1861 ("iverilog" ,iverilog)
1862 ("libtool" ,libtool)
1863 ("octave" ,octave-cli)
1864 ("qt4" ,qt-4)
1865 ("sed" ,sed)))
1866 (home-page "http://qucs.sourceforge.net/")
1867 (synopsis "Circuit simulator with graphical user interface")
1868 (description
1869 "Qucs is a circuit simulator with graphical user interface. The software
1870 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1871 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1872 simulations are also supported.")
1873 (license license:gpl2+))))
1874
1875 (define-public qucs-s
1876 (package
1877 (name "qucs-s")
1878 (version "0.0.21")
1879 (source (origin
1880 (method url-fetch)
1881 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1882 version ".tar.gz"))
1883 (file-name (string-append name "-" version ".tar.gz"))
1884 (sha256
1885 (base32
1886 "12m1jwhb9qwvb141qzyskbxnw3wn1x22d02z4b4862p7xvccl5h7"))))
1887 (build-system cmake-build-system)
1888 (arguments
1889 `(#:tests? #f ; no tests
1890 #:phases
1891 (modify-phases %standard-phases
1892 (add-before 'configure 'patch-scripts
1893 (lambda* (#:key inputs #:allow-other-keys)
1894 (substitute* '("qucs/qucsdigi"
1895 "qucs/qucsdigilib"
1896 "qucs/qucsveri")
1897 (("\\$BINDIR")
1898 (string-append (assoc-ref inputs "qucs") "/bin"))
1899 (("freehdl-config")
1900 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1901 (("freehdl-v2cc")
1902 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1903 (("cp ")
1904 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1905 (("glibtool")
1906 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1907 (("sed")
1908 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1909 (("iverilog")
1910 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1911 (("vvp")
1912 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1913 #t))
1914 (add-after 'patch-scripts 'patch-paths
1915 (lambda* (#:key inputs #:allow-other-keys)
1916 (substitute* "qucs/main.cpp"
1917 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1918 "\\+ \"qucsator\" \\+ executableSuffix"))
1919 (string-append "}{ QucsSettings.Qucsator = \""
1920 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1921 (((string-append "QucsSettings\\.XyceExecutable = "
1922 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1923 (string-append "}{ QucsSettings.XyceExecutable = \""
1924 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1925 (((string-append "else QucsSettings\\.XyceParExecutable = "
1926 "\"mpirun -np %p /usr/local"
1927 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1928 (string-append "QucsSettings.XyceParExecutable = \""
1929 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1930 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1931 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1932 (string-append "QucsSettings.NgspiceExecutable = " "\""
1933 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1934 (substitute* "qucs/extsimkernels/ngspice.cpp"
1935 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1936 (substitute* "qucs/qucs_actions.cpp"
1937 (("qucstrans")
1938 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1939 (("qucsattenuator")
1940 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1941 (("qucsrescodes")
1942 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1943 #t))
1944 (add-after 'install 'install-scripts
1945 (lambda* (#:key inputs outputs #:allow-other-keys)
1946 (for-each
1947 (lambda (script)
1948 (let ((file (string-append "../qucs_s-" ,version
1949 "/qucs/" script))
1950 (out (assoc-ref outputs "out")))
1951 (install-file file (string-append out "/bin"))
1952 (chmod (string-append out "/bin/" script) #o555)))
1953 '("qucsdigi" "qucsdigilib" "qucsveri"))
1954 #t))
1955 (add-after 'install-scripts 'make-wrapper
1956 (lambda* (#:key inputs outputs #:allow-other-keys)
1957 (let* ((out (assoc-ref outputs "out"))
1958 (file (string-append out "/bin/qucs-s"))
1959 (qucs (assoc-ref inputs "qucs"))
1960 (qucsator (string-append qucs "/bin/qucsator")))
1961 (wrap-program file
1962 `("CPLUS_INCLUDE_PATH" ":" prefix
1963 (,(string-append (assoc-ref inputs "gcc-toolchain")
1964 "/include")))
1965 `("PATH" ":" prefix
1966 (,(string-append (assoc-ref inputs "gcc-toolchain")
1967 "/bin")))
1968 `("LIBRARY_PATH" ":" prefix
1969 (,(string-append (assoc-ref inputs "gcc-toolchain")
1970 "/lib")))
1971 `("QUCSATOR" ":" prefix (,qucsator))
1972 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1973 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1974 "/bin")))
1975 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1976 "/bin")))
1977 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1978 "/bin/octave"))))
1979 (symlink qucsator (string-append out "/bin/qucsator"))
1980 #t))))))
1981 (native-inputs
1982 `(("libtool-native" ,libtool)))
1983 (inputs
1984 `(("adms" ,adms)
1985 ("asco" ,asco)
1986 ("coreutils" ,coreutils)
1987 ("freehdl" ,freehdl)
1988 ("gcc-toolchain" ,gcc-toolchain)
1989 ("iverilog" ,iverilog)
1990 ("libtool" ,libtool)
1991 ("mpi" ,openmpi)
1992 ("ngspice" ,ngspice)
1993 ("octave" ,octave-cli)
1994 ("qt4" ,qt-4)
1995 ("qucs" ,qucs)
1996 ("sed" ,sed)
1997 ("xyce-serial" ,xyce-serial)
1998 ("xyce-parallel" ,xyce-parallel)))
1999 (home-page "https://ra3xdh.github.io/")
2000 (synopsis "Circuit simulator with graphical user interface")
2001 (description
2002 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
2003 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
2004 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
2005 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
2006 (license license:gpl2+)))
2007
2008 (define-public librepcb
2009 (package
2010 (name "librepcb")
2011 (version "0.1.3")
2012 (source
2013 (origin
2014 (method url-fetch)
2015 (uri (string-append "https://download.librepcb.org/releases/"
2016 version "/librepcb-" version "-source.zip"))
2017 (sha256
2018 (base32 "1ich849dsx2hmcwlwbry4mkg374n940l3hy6srh4qms2rm7vd7x0"))))
2019 (build-system gnu-build-system)
2020 (inputs
2021 `(("qtbase" ,qtbase)
2022 ("zlib" ,zlib)))
2023 (native-inputs
2024 `(("qttools" ,qttools) ; for lrelease
2025 ("unzip" ,unzip)))
2026 (arguments
2027 `(#:phases
2028 (modify-phases %standard-phases
2029 (replace 'configure
2030 (lambda* (#:key inputs outputs #:allow-other-keys)
2031 (mkdir-p "build")
2032 (chdir "build")
2033 (let ((lrelease (string-append (assoc-ref inputs "qttools")
2034 "/bin/lrelease"))
2035 (out (assoc-ref outputs "out")))
2036 (invoke "qmake"
2037 (string-append "QMAKE_LRELEASE=" lrelease)
2038 (string-append "PREFIX=" out)
2039 "../librepcb.pro")))))))
2040 (home-page "https://librepcb.org/")
2041 (synopsis "Electronic Design Automation tool")
2042 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
2043 software to develop printed circuit boards. It features human readable file
2044 formats and complete project management with library, schematic and board
2045 editors.")
2046 (license (list license:gpl3+
2047 license:boost1.0 ; libs/clipper,
2048 ; libs/optional/tests/catch.hpp,
2049 ; libs/sexpresso/tests/catch.hpp
2050 license:expat ; libs/delaunay-triangulation,
2051 ; libs/parseagle, libs/type_safe
2052 license:asl2.0 ; libs/fontobene, libs/googletest,
2053 ; libs/parseagle
2054 license:isc ; libs/hoedown
2055 license:cc0 ; libs/optional, libs/sexpresso
2056 license:bsd-2 ; libs/optional/tests/catch.hpp
2057 license:lgpl2.1+)))) ; libs/quazip
2058
2059 (define-public gpx
2060 (package
2061 (name "gpx")
2062 (version "2.5.2")
2063 (source (origin
2064 (method git-fetch)
2065 (uri (git-reference
2066 (url "https://github.com/markwal/GPX.git")
2067 (commit version)))
2068 (file-name (git-file-name name version))
2069 (sha256
2070 (base32
2071 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
2072 (build-system gnu-build-system)
2073 (home-page "https://github.com/markwal/GPX")
2074 (synopsis "Converting gcode to x3g files for 3D printing")
2075 (description
2076 "GPX is a post processing utility for converting gcode output from 3D
2077 slicing software to x3g files for standalone 3D printing on common 3D
2078 printers.")
2079 (license license:gpl2+)))
2080
2081 (define-public gnucap
2082 (package
2083 (name "gnucap")
2084 (version "20171003")
2085 (source
2086 (origin
2087 (method url-fetch)
2088 (uri (string-append "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/gnucap-"
2089 version ".tar.gz"))
2090 (sha256
2091 (base32
2092 "16m09xa685qhj5fqq3bcgakrwnb74xhf5f7rpqkkf9fg8plzbb1g"))))
2093 (build-system gnu-build-system)
2094 (inputs
2095 `(("readline" ,readline)))
2096 (arguments
2097 `(#:phases
2098 (modify-phases %standard-phases
2099 (replace 'configure
2100 (lambda* (#:key outputs #:allow-other-keys)
2101 (let ((out (assoc-ref outputs "out")))
2102 ;; Set correct rpath so that gnucap finds libgnucap.so.
2103 (substitute* (list "apps/configure" "lib/configure"
2104 "main/configure" "modelgen/configure")
2105 (("LDFLAGS =")
2106 (string-append "LDFLAGS = -Wl,-rpath=" out "/lib")))
2107 ;; gnucap uses a hand-written configure script that expects the
2108 ;; --prefix argument to be the first argument passed to it.
2109 (invoke "./configure" (string-append "--prefix=" out)))))
2110 (replace 'check
2111 (lambda* (#:key outputs #:allow-other-keys)
2112 (let ((out (assoc-ref outputs "out"))
2113 (libpath "../lib/O:../apps/O"))
2114 (with-directory-excursion "tests"
2115 ;; Make test return non-zero exit code when a test fails.
2116 (substitute* "test"
2117 (("/bin/sh") "/bin/sh -e")
2118 (("\\|\\| echo \"\\*\\*\\*\\* \\$ii fails \\*\\*\\*\\*\"") ""))
2119 ;; Fix expected plugin search path for test c_attach.1.gc
2120 (substitute* "==out/c_attach.1.gc.out"
2121 (("/usr/local/lib/gnucap")
2122 (string-append libpath ":" out "/lib/gnucap")))
2123 ;; Set library path so that gnucap can find libgnucap.so
2124 ;; while running the tests.
2125 (setenv "LD_LIBRARY_PATH" libpath)
2126 (invoke "./test" "../main/O/gnucap" "" "test-output" "==out"))))))))
2127 (home-page "https://www.gnu.org/software/gnucap/")
2128 (synopsis "Mixed analog and digital circuit simulator")
2129 (description "GNUcap is a circuit analysis package. It offers a general
2130 purpose circuit simulator and can perform DC and transient analyses, fourier
2131 analysis and AC analysis. The engine is designed to do true mixed-mode
2132 simulation.")
2133 (license license:gpl3+)))
2134
2135 (define-public cutter
2136 (package
2137 (name "cutter")
2138 (version "1.10.1")
2139 (source
2140 (origin
2141 (method git-fetch)
2142 (uri (git-reference
2143 (url "https://github.com/radareorg/cutter")
2144 (commit (string-append "v" version))))
2145 (file-name (git-file-name name version))
2146 (sha256
2147 (base32
2148 "1gvsrcskcdd1hxrjpkpc657anmfs25f174vxk4wzvn385rnmrxd3"))))
2149 (build-system gnu-build-system)
2150 (arguments
2151 `(#:phases
2152 (modify-phases %standard-phases
2153 (replace 'configure
2154 (lambda* (#:key inputs outputs #:allow-other-keys)
2155 (let ((out (assoc-ref outputs "out"))
2156 (radare2 (assoc-ref inputs "radare2")))
2157 ;; fix pkg-config detection ./src/lib_radare2.pri:PREFIX=/usr/lib
2158 ;; override `qmake PREFIX=`
2159 (substitute* "./src/lib_radare2.pri"
2160 (("PREFIX") "R2PREFIX")
2161 (("R2PREFIX=/usr") (string-append "R2PREFIX=" radare2)))
2162 (invoke "qmake"
2163 (string-append "PREFIX=" out)
2164 "./src/Cutter.pro")))))))
2165 (native-inputs
2166 `(("pkg-config" ,pkg-config)))
2167 (inputs
2168 `(("qtbase" ,qtbase)
2169 ("qtsvg" ,qtsvg)
2170 ("openssl" ,openssl)
2171 ("radare2" ,radare2)))
2172 (home-page "https://github.com/radareorg/cutter")
2173 (synopsis "GUI for radare2 reverse engineering framework")
2174 (description "Cutter is a GUI for radare2 reverse engineering framework.
2175 Its goal is making an advanced andcustomizable reverse-engineering platform
2176 while keeping the user experience at mind. Cutter is created by reverse
2177 engineers for reverse engineers.")
2178 (license (list license:cc-by-sa3.0 ;the "Iconic" icon set
2179 license:gpl3+)))) ;everything else
2180
2181 (define-public lib3mf
2182 (package
2183 (name "lib3mf")
2184 (version "1.8.1")
2185 (source
2186 (origin
2187 (method git-fetch)
2188 (uri (git-reference (url "https://github.com/3MFConsortium/lib3mf.git")
2189 (commit (string-append "v" version))))
2190 (file-name (git-file-name name version))
2191 (sha256
2192 (base32
2193 "11wpk6n9ga2p57h1dcrp37w77mii0r7r6mlrgmykf7rvii1rzgqd"))))
2194 (build-system cmake-build-system)
2195 (native-inputs
2196 `(("googletest-source" ,(package-source googletest))))
2197 (inputs
2198 `(("libuuid" ,util-linux)))
2199 (arguments
2200 `(#:phases
2201 (modify-phases %standard-phases
2202 (add-after 'unpack 'unpack-googletest
2203 (lambda* (#:key inputs #:allow-other-keys)
2204 (copy-recursively (assoc-ref inputs "googletest-source")
2205 "UnitTests/googletest")
2206 #t)))))
2207 (synopsis "Implementation of the 3D Manufacturing Format (3MF) file standard")
2208 (description
2209 "Lib3MF is a C++ implementation of the 3D Manufacturing Format (3MF) file
2210 standard. It offers a way to integrate 3MF reading and writing capabilities, as
2211 well as conversion and validation tools for input and output data. The
2212 specification can be downloaded at @url{http://3mf.io/specification/}.")
2213 (home-page "https://3mf.io/")
2214 (license license:bsd-2)))
2215
2216 (define-public openscad
2217 (package
2218 (name "openscad")
2219 (version "2019.05")
2220 (source
2221 (origin
2222 (method url-fetch)
2223 (uri (string-append "https://files.openscad.org/openscad-" version
2224 ".src.tar.gz"))
2225 (sha256
2226 (base32
2227 "0nbgk5q5pgnw53la0kccdcpz2f4xf6d6076rkn0q08z57hkc85ha"))))
2228 (build-system cmake-build-system)
2229 (inputs
2230 `(("boost" ,boost)
2231 ("cgal" ,cgal)
2232 ("double-conversion" ,double-conversion)
2233 ("eigen" ,eigen)
2234 ("fontconfig" ,fontconfig)
2235 ("glew" ,glew)
2236 ("gmp" ,gmp)
2237 ("harfbuzz" ,harfbuzz)
2238 ("lib3mf" ,lib3mf)
2239 ("libxml2" ,libxml2)
2240 ("libzip" ,libzip)
2241 ("mpfr" ,mpfr)
2242 ("opencsg" ,opencsg)
2243 ("qscintilla" ,qscintilla)
2244 ("qtbase" ,qtbase)
2245 ("qtmultimedia" ,qtmultimedia)))
2246 (native-inputs
2247 `(("bison" ,bison)
2248 ("flex" ,flex)
2249 ("gettext" ,gettext-minimal)
2250 ("pkg-config" ,pkg-config)
2251 ("which" ,which)
2252 ;; the following are only needed for tests
2253 ("imagemagick" ,imagemagick)
2254 ("ps" ,procps)
2255 ("python" ,python)
2256 ("xvfb" ,xorg-server-for-tests)))
2257 (arguments
2258 `(#:phases
2259 (modify-phases %standard-phases
2260 (replace 'configure
2261 (lambda* (#:key outputs #:allow-other-keys)
2262 (invoke "qmake"
2263 (string-append "PREFIX=" (assoc-ref outputs "out")))
2264 #t))
2265 (replace 'check
2266 (lambda _
2267 (with-directory-excursion "tests"
2268 (invoke "cmake" ".")
2269 (invoke "make")
2270 (invoke "ctest"))
2271 ;; strip python test files since lib dir ends up in out/share
2272 (for-each delete-file
2273 (find-files "libraries/MCAD" ".*\\.py"))
2274 #t)))))
2275 (synopsis "Script-based 3D modeling application")
2276 (description
2277 "OpenSCAD is a 3D Computer-aided Design (CAD) application. Unlike an
2278 interactive modeler, OpenSCAD generates 3D models from a script, giving you
2279 full programmatic control over your models.")
2280 (home-page "https://www.openscad.org/")
2281 (license license:gpl2+)))
2282
2283 (define-public freecad
2284 (package
2285 (name "freecad")
2286 (version "0.18.4")
2287 (source
2288 (origin
2289 (method git-fetch)
2290 (uri (git-reference
2291 (url "https://github.com/FreeCAD/FreeCAD.git")
2292 (commit version)))
2293 (file-name (git-file-name name version))
2294 (sha256
2295 (base32
2296 "170hk1kgrvsddrwykp24wyj0cha78zzmzbf50gn98x7ngqqs395s"))))
2297 (build-system qt-build-system)
2298 (native-inputs
2299 `(("doxygen" ,doxygen)
2300 ("graphviz" ,graphviz)
2301 ("qttools" ,qttools)
2302 ("pkg-config" ,pkg-config)
2303 ("swig" ,swig)))
2304 (inputs
2305 `(("boost" ,boost)
2306 ("coin3D" ,coin3D)
2307 ("eigen" ,eigen)
2308 ("freetype" ,freetype)
2309 ("glew" ,glew)
2310 ("hdf5" ,hdf5-1.10)
2311 ("libarea" ,libarea)
2312 ("libmedfile" ,libmedfile)
2313 ("libspnav" ,libspnav)
2314 ("libxi" ,libxi)
2315 ("libxmu" ,libxmu)
2316 ("openmpi" ,openmpi)
2317 ("opencascade-occt" ,opencascade-occt)
2318 ("python-matplotlib" ,python-matplotlib)
2319 ("python-pyside-2" ,python-pyside-2)
2320 ("python-pyside-2-tools" ,python-pyside-2-tools)
2321 ("python-shiboken-2" ,python-shiboken-2)
2322 ("python-wrapper" ,python-wrapper)
2323 ("qtbase" ,qtbase)
2324 ("qtsvg" ,qtsvg)
2325 ("qtx11extras" ,qtx11extras)
2326 ("qtxmlpatterns" ,qtxmlpatterns)
2327 ;; qtwebkit is optional. We remove it currently, because it takes
2328 ;; much time to compile and substitutes are often unavailable
2329 ;;("qtwebkit" ,qtwebkit)
2330 ("tbb" ,tbb)
2331 ("vtk" ,vtk)
2332 ("xerces-c" ,xerces-c)
2333 ("zlib" ,zlib)))
2334 (arguments
2335 `(#:tests? #f
2336 #:configure-flags
2337 (list
2338 "-DBUILD_QT5=ON"
2339 (string-append "-DCMAKE_INSTALL_LIBDIR="
2340 (assoc-ref %outputs "out") "/lib"))
2341 #:phases
2342 (modify-phases %standard-phases
2343 (add-before 'configure 'restore-pythonpath
2344 (lambda _
2345 (substitute* "src/Main/MainGui.cpp"
2346 (("_?putenv\\(\"PYTHONPATH=\"\\);") ""))
2347 #t))
2348 (add-after 'install 'wrap-pythonpath
2349 (lambda* (#:key outputs #:allow-other-keys)
2350 (let ((out (assoc-ref outputs "out")))
2351 (wrap-program (string-append out "/bin/FreeCAD")
2352 (list "PYTHONPATH"
2353 'prefix (list (getenv "PYTHONPATH")))))
2354 #t)))))
2355 (home-page "https://www.freecadweb.org/")
2356 (synopsis "Your Own 3D Parametric Modeler")
2357 (description
2358 "FreeCAD is a general purpose feature-based, parametric 3D modeler for
2359 CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering and
2360 product design but also fits a wider range of uses in engineering, such as
2361 architecture or other engineering specialties. It is 100% Open Source (LGPL2+
2362 license) and extremely modular, allowing for very advanced extension and
2363 customization.")
2364 (license
2365 (list
2366 license:lgpl2.1+
2367 license:lgpl2.0+
2368 license:gpl3+
2369 license:bsd-3))))
2370
2371 (define-public libmedfile
2372 (package
2373 (name "libmedfile")
2374 (version "4.0.0")
2375 (source
2376 (origin
2377 (method url-fetch)
2378 (uri (string-append
2379 "https://files.salome-platform.org/Salome/other/med-"
2380 version ".tar.gz"))
2381 (sha256
2382 (base32
2383 "017h9p0x533fm4gn6pwc8kmp72rvqmcn6vznx72nkkl2b05yjx54"))))
2384 (build-system cmake-build-system)
2385 (inputs `(("hdf5" ,hdf5-1.10)))
2386 (arguments
2387 `(#:phases
2388 (modify-phases %standard-phases
2389 (add-after 'install 'remove-test-output
2390 (lambda* (#:key outputs #:allow-other-keys)
2391 (let ((out (assoc-ref outputs "out")))
2392 (delete-file-recursively
2393 (string-append out "/bin/testc"))
2394 #t))))))
2395 (home-page "https://www.salome-platform.org")
2396 (synopsis "Library to read and write MED files")
2397 (description
2398 "The purpose of the MED module is to provide a standard for storing and
2399 recovering computer data associated to numerical meshes and fields, and to
2400 facilitate the exchange between codes and solvers.
2401
2402 The persistent data storage is based upon HDF format (like CGNS, a standard
2403 developed by Boeing and NASA in the area of Computational Fluid Dynamic).
2404
2405 MED also provides structures to hold data on meshes and fields. These
2406 structures are exchanged between solvers, hide the communication level (CORBA
2407 or MPI), and offer persistence (read/write in .med files).
2408
2409 The main benefit of a common exchange format is reduced complexity of code
2410 coupling. It also allows sharing such high level functionalities as
2411 computation of nodal connectivity of sub-elements (faces and edges),
2412 arithmetic operations on fields, entity location functionalities, and
2413 interpolation toolkit.")
2414 (license license:gpl3+)))
2415
2416 (define-public libarea
2417 (let ((revision "1")
2418 (commit "8f8bac811c10f1f01fda0d742a18591f61dd76ee"))
2419 (package
2420 (name "libarea")
2421 (version (git-version "0" revision commit))
2422 (source
2423 (origin
2424 (method git-fetch)
2425 (uri (git-reference (url "https://github.com/Heeks/libarea.git")
2426 (commit commit)))
2427 (file-name (git-file-name name version))
2428 (sha256
2429 (base32 "0pvqz6cabxqdz5y26wnj6alkn8v5d7gkx0d3h8xmg4lvy9r3kh3g"))))
2430 (build-system gnu-build-system)
2431 (inputs `(("boost" ,boost)
2432 ("python-wrapper" ,python-wrapper)))
2433 (native-inputs
2434 `(("cmake" ,cmake-minimal)))
2435 (arguments
2436 `(#:tests? #f
2437 #:phases
2438 (modify-phases %standard-phases
2439 (add-after 'configure 'cmake-configure
2440 (lambda* (#:key inputs outputs #:allow-other-keys)
2441 (let ((out (assoc-ref outputs "out"))
2442 (cmake (assoc-ref inputs "cmake")))
2443 (mkdir-p "build")
2444 (invoke "cmake"
2445 (string-append "-DCMAKE_INSTALL_PREFIX=" out)))))
2446 (delete 'configure))))
2447 (home-page "https://github.com/Heeks/libarea")
2448 (synopsis
2449 "Library and python module for pocketing and profiling operations")
2450 (description
2451 "Area is a CAM-related software for pocketing operation.
2452
2453 This project provides library and associated python-module to compute pocket
2454 operations.")
2455 (license (list
2456 license:bsd-3
2457 license:gpl3+)))))
2458
2459 (define-public libspnav
2460 (package
2461 (name "libspnav")
2462 (version "0.2.3")
2463 (source (origin
2464 (method git-fetch)
2465 (uri (git-reference
2466 (url "https://github.com/FreeSpacenav/libspnav.git")
2467 (commit (string-append "libspnav-" version))))
2468 (sha256
2469 (base32
2470 "098h1jhlj87axpza5zgy58prp0zn94wyrbch6x0s7q4mzh7dc8ba"))
2471 (file-name (git-file-name name version))))
2472 (build-system gnu-build-system)
2473 (inputs
2474 `(("libx11" ,libx11)))
2475 (arguments `(#:tests? #f))
2476 (home-page "http://spacenav.sourceforge.net/")
2477 (synopsis
2478 "Library for communicating with spacenavd or 3dxsrv")
2479 (description
2480 "The libspnav library is provided as a replacement of the magellan
2481 library. It provides a cleaner, and more orthogonal interface. libspnav
2482 supports both the original X11 protocol for communicating with the driver, and
2483 the new alternative non-X protocol. Programs that choose to use the X11
2484 protocol, are automatically compatible with either the free spacenavd driver
2485 or the official 3dxserv, as if they were using the magellan SDK.
2486
2487 Also, libspnav provides a magellan API wrapper on top of the new API. So, any
2488 applications that were using the magellan library, can switch to libspnav
2489 without any changes. And programmers that are familiar with the magellan API
2490 can continue using it with a free library without the restrictions of the
2491 official SDK.")
2492 (license license:bsd-3)))