28a30a6831f48af01cbc65fa6c84fe6c6b16ec7b
[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 (define-public ao
795 (deprecated-package "ao-cad" libfive))
796
797 ;; TODO Add doc https://gitlab.com/kicad/services/kicad-doc/-/tree/master
798 (define-public kicad
799 (package
800 (name "kicad")
801 (version "5.1.5")
802 (source
803 (origin
804 (method url-fetch)
805 (file-name (string-append name "-" version ".tar.xz"))
806 (uri (string-append
807 "https://launchpad.net/kicad/" (version-major version)
808 ".0/" version "/+download/kicad-" version ".tar.xz"))
809 (sha256
810 (base32 "0x3417f2pa7p65s9f7l49rqbnrzy8gz6i0n07mlbxqbnm0fmlql0"))))
811 (build-system cmake-build-system)
812 (arguments
813 `(#:out-of-source? #t
814 #:tests? #f ; no tests
815 #:build-type "Release"
816 #:configure-flags
817 (list "-DKICAD_SCRIPTING_PYTHON3=ON"
818 "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
819 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
820 #:phases
821 (modify-phases %standard-phases
822 (add-after 'install 'install-translations
823 (lambda* (#:key inputs outputs #:allow-other-keys)
824 (copy-recursively (assoc-ref inputs "kicad-i18l")
825 (assoc-ref outputs "out"))
826 #t))
827 (add-after 'install 'wrap-program
828 ;; Ensure correct Python at runtime.
829 (lambda* (#:key inputs outputs #:allow-other-keys)
830 (let* ((out (assoc-ref outputs "out"))
831 (python (assoc-ref inputs "python"))
832 (file (string-append out "/bin/kicad"))
833 (path (string-append
834 out
835 "/lib/python"
836 ,(version-major+minor
837 (package-version python))
838 "/site-packages:"
839 (getenv "PYTHONPATH"))))
840 (wrap-program file
841 `("PYTHONPATH" ":" prefix (,path))
842 `("PATH" ":" prefix
843 (,(string-append python "/bin:")))))
844 #t)))))
845 (native-search-paths
846 (list (search-path-specification
847 (variable "KICAD_TEMPLATE_DIR")
848 (files '("share/kicad/template")))
849 (search-path-specification
850 (variable "KICAD_SYMBOL_DIR") ; symbol path
851 (files '("share/kicad/library")))
852 (search-path-specification
853 (variable "KISYSMOD") ; footprint path
854 (files '("share/kicad/modules")))
855 (search-path-specification
856 (variable "KISYS3DMOD") ; 3D model path
857 (files '("share/kicad/modules/packages3d")))))
858 (native-inputs
859 `(("boost" ,boost)
860 ("desktop-file-utils" ,desktop-file-utils)
861 ("gettext" ,gnu-gettext)
862 ("kicad-i18l" ,kicad-i18l)
863 ("pkg-config" ,pkg-config)
864 ("swig" ,swig)
865 ("zlib" ,zlib)))
866 (inputs
867 `(("cairo" ,cairo)
868 ("curl" ,curl)
869 ("glew" ,glew)
870 ("glm" ,glm)
871 ("hicolor-icon-theme" ,hicolor-icon-theme)
872 ("libngspice" ,libngspice)
873 ("libsm" ,libsm)
874 ("mesa" ,mesa)
875 ("opencascade-oce" ,opencascade-oce)
876 ("openssl" ,openssl)
877 ("python" ,python-wrapper)
878 ("wxwidgets" ,wxwidgets)
879 ("wxpython" ,python-wxpython)))
880 (home-page "https://kicad-pcb.org/")
881 (synopsis "Electronics Design Automation Suite")
882 (description "Kicad is a program for the formation of printed circuit
883 boards and electrical circuits. The software has a number of programs that
884 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
885 electrical diagrams), gerbview (viewing Gerber files) and others.")
886 (license license:gpl3+)))
887
888 (define kicad-i18l
889 (package
890 (name "kicad-i18l")
891 (version "5.1.5")
892 (source (origin
893 (method git-fetch)
894 (uri (git-reference
895 (url "https://gitlab.com/kicad/code/kicad-i18n.git")
896 (commit version)))
897 (file-name (git-file-name name version))
898 (sha256
899 (base32
900 "1rfpifl8vky1gba2angizlb2n7mwmsiai3r6ip6qma60wdj8sbd3"))))
901 (build-system cmake-build-system)
902 (arguments
903 `(#:phases
904 (modify-phases %standard-phases
905 (delete 'build)
906 (delete 'check))))
907 (native-inputs
908 `(("gettext" ,gnu-gettext)))
909 (home-page "https://kicad-pcb.org/")
910 (synopsis "KiCad GUI translations")
911 (description "This package contains the po files that are used for the GUI
912 translations for KiCad.")
913 (license license:gpl3+)))
914
915 (define-public kicad-symbols
916 (package
917 (name "kicad-symbols")
918 (version "5.1.5")
919 (source (origin
920 (method git-fetch)
921 (uri (git-reference
922 (url "https://github.com/KiCad/kicad-symbols.git")
923 (commit version)))
924 (file-name (git-file-name name version))
925 (sha256
926 (base32
927 "048b07ffsaav1ssrchw2p870lvb4rsyb5vnniy670k7q9p16qq6h"))))
928 (build-system cmake-build-system)
929 (arguments
930 `(#:tests? #f)) ; no tests exist
931 (home-page "https://kicad-pcb.org/")
932 (synopsis "Official KiCad schematic symbol libraries")
933 (description "This package contains the official KiCad schematic symbol
934 libraries.")
935 ;; TODO: Exception: "To the extent that the creation of electronic designs
936 ;; that use 'Licensed Material' can be considered to be 'Adapted Material',
937 ;; then the copyright holder waives article 3 of the license with respect to
938 ;; these designs and any generated files which use data provided as part of
939 ;; the 'Licensed Material'."
940 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
941 (license license:cc-by-sa4.0)))
942
943 (define-public kicad-footprints
944 (package
945 (inherit kicad-symbols)
946 (name "kicad-footprints")
947 (version "5.1.5")
948 (source (origin
949 (method git-fetch)
950 (uri (git-reference
951 (url "https://github.com/KiCad/kicad-footprints.git")
952 (commit version)))
953 (file-name (git-file-name name version))
954 (sha256
955 (base32
956 "1c4whgn14qhz4yqkl46w13p6rpv1k0hsc9s9h9368fxfcz9knb2j"))))
957 (synopsis "Official KiCad footprint libraries")
958 (description "This package contains the official KiCad footprint libraries.")))
959
960 (define-public kicad-packages3d
961 (package
962 (inherit kicad-symbols)
963 (name "kicad-packages3d")
964 (version "5.1.5")
965 (source (origin
966 (method git-fetch)
967 (uri (git-reference
968 (url "https://github.com/KiCad/kicad-packages3d.git")
969 (commit version)))
970 (file-name (git-file-name name version))
971 (sha256
972 (base32
973 "0cff2ms1bsw530kqb1fr1m2pjixyxzwa81mxgac3qpbcf8fnpvaz"))))
974 (synopsis "Official KiCad 3D model libraries")
975 (description "This package contains the official KiCad 3D model libraries.")))
976
977 (define-public kicad-templates
978 (package
979 (inherit kicad-symbols)
980 (name "kicad-templates")
981 (version "5.1.5")
982 (source (origin
983 (method git-fetch)
984 (uri (git-reference
985 (url "https://github.com/KiCad/kicad-templates.git")
986 (commit version)))
987 (file-name (git-file-name name version))
988 (sha256
989 (base32
990 "0cs3bm3zb5ngw5ldn0lzw5bvqm4kvcidyrn76438alffwiz2b15g"))))
991 (synopsis "Official KiCad project and worksheet templates")
992 (description "This package contains the official KiCad project and
993 worksheet templates.")))
994
995 (define-public linsmith
996 (package
997 (name "linsmith")
998 (version "0.99.31")
999 (source (origin
1000 (method url-fetch)
1001 (uri (string-append
1002 "mirror://sourceforge/linsmith/linsmith/linsmith-"
1003 version "/linsmith-" version ".tar.gz"))
1004 (sha256
1005 (base32
1006 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
1007 (build-system gnu-build-system)
1008 (native-inputs
1009 `(("pkg-config" ,pkg-config)
1010 ("gtk" ,gtk+-2)
1011 ("libgnome" ,libgnomeui)))
1012 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
1013 (synopsis "Smith Charting program")
1014 (description "LinSmith is a Smith Charting program, mainly designed for
1015 educational use. As such, there is an emphasis on capabilities that improve
1016 the 'showing the effect of'-style of operation.")
1017 (license license:gpl2+)))
1018
1019 (define-public volk
1020 (package
1021 (name "volk")
1022 (version "1.3")
1023 (source
1024 (origin
1025 (method url-fetch)
1026 (uri (string-append "http://libvolk.org/releases/volk-"
1027 version ".tar.gz"))
1028 (sha256
1029 (base32
1030 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
1031 (build-system cmake-build-system)
1032 (inputs
1033 `(("boost" ,boost)))
1034 (native-inputs
1035 `(("python-2" ,python-2)
1036 ("python2-cheetah" ,python2-cheetah)))
1037 (home-page "http://libvolk.org/")
1038 (synopsis "Vector-Optimized Library of Kernels")
1039 (description
1040 "@code{volk} contains procedures with machine-specific optimizations
1041 for mathematical functions. It also provides an machine-independent
1042 interface to select the best such procedures to use on a given system.")
1043 (license license:gpl3+)))
1044
1045 (define-public minicom
1046 (package
1047 (name "minicom")
1048 (version "2.7.1")
1049 (source
1050 (origin
1051 (method url-fetch)
1052 (uri (string-append "https://alioth.debian.org/frs/download.php/"
1053 "file/4215/" name "-" version ".tar.gz"))
1054 (sha256
1055 (base32
1056 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
1057 (build-system gnu-build-system)
1058 (arguments
1059 `(#:configure-flags '("--enable-lock-dir=/var/lock")
1060 #:phases
1061 (modify-phases %standard-phases
1062 (add-after 'unpack 'patch-lock-check
1063 (lambda _
1064 (substitute* "configure"
1065 (("test -d [$]UUCPLOCK") "true"))
1066 #t)))))
1067 (inputs
1068 `(("ncurses" ,ncurses)))
1069 (home-page "https://alioth.debian.org/projects/minicom/")
1070 (synopsis "Serial terminal emulator")
1071 (description "@code{minicom} is a serial terminal emulator.")
1072 (license license:gpl2+)))
1073
1074 (define-public harminv
1075 (package
1076 (name "harminv")
1077 (version "1.4.1")
1078 (source (origin
1079 (method url-fetch)
1080 (uri
1081 (string-append "https://github.com/stevengj/harminv/"
1082 "releases/download/v" version "/"
1083 name "-" version ".tar.gz"))
1084 (sha256
1085 (base32
1086 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
1087 (build-system gnu-build-system)
1088 (arguments
1089 `(#:configure-flags '("--enable-shared")
1090 #:phases
1091 (modify-phases %standard-phases
1092 (add-before 'configure 'fix-tests
1093 (lambda _
1094 (substitute* "./sines-test.sh"
1095 ; change test frequency range - default fails
1096 (("0\\.15") "0.16"))
1097 #t)))))
1098 (native-inputs
1099 `(("fortran" ,gfortran)))
1100 (inputs
1101 `(("lapack" ,lapack)))
1102 (home-page "https://github.com/stevengj/harminv")
1103 (synopsis "Harmonic inversion solver")
1104 (description
1105 "Harminv is a free program (and accompanying library) to solve the problem of
1106 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
1107 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
1108 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
1109 (license license:gpl2+)))
1110
1111 (define-public guile-libctl
1112 (package
1113 (name "guile-libctl")
1114 (version "4.2.0")
1115 (source (origin
1116 (method url-fetch)
1117 (uri
1118 (string-append
1119 "https://github.com/NanoComp/libctl/releases/download/v"
1120 version "/libctl-" version ".tar.gz"))
1121 (sha256
1122 (base32
1123 "0x8r56lpfq83kfbq28vr25icl19xpfd6fjrxzcpdmv30l9pash83"))))
1124 (build-system gnu-build-system)
1125 (arguments
1126 `(#:configure-flags '("--enable-shared")))
1127 (native-inputs
1128 `(("fortran" ,gfortran)))
1129 (inputs
1130 `(("guile" ,guile-2.2)))
1131 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
1132 (synopsis "Flexible control files implementation for scientific simulations")
1133 (description
1134 "Libctl is a Guile-based library implementing flexible control files
1135 for scientific simulations.")
1136 (license license:gpl2+)))
1137
1138 (define-public mpb
1139 (package
1140 (name "mpb")
1141 (version "1.8.0")
1142 (source (origin
1143 (method url-fetch)
1144 (uri
1145 (string-append
1146 "https://github.com/NanoComp/mpb/releases/download/v"
1147 version "/mpb-" version ".tar.gz"))
1148 (sha256
1149 (base32
1150 "1jgrb7dd6qs6j6y1gnxmdgrh79l2bvqa6nk60a4pw1annsks4brd"))))
1151 (build-system gnu-build-system)
1152 (arguments
1153 `(#:configure-flags
1154 (list (string-append "--with-libctl="
1155 (assoc-ref %build-inputs "libctl")
1156 "/share/libctl")
1157 "--enable-shared")))
1158 (native-inputs
1159 `(("fortran" ,gfortran)
1160 ("pkg-config" ,pkg-config)
1161 ("swig" ,swig)))
1162 (inputs
1163 `(("fftw" ,fftw)
1164 ("gsl" ,gsl)
1165 ("guile" ,guile-2.2)
1166 ("hdf5" ,hdf5)
1167 ("lapack" ,lapack)
1168 ("libctl" ,guile-libctl)
1169 ("readline" ,readline)
1170 ("zlib" ,zlib)))
1171 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1172 (synopsis "Computes band structures and electromagnetic modes of dielectric
1173 structures")
1174 (description
1175 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1176 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1177 fully-vectorial and three-dimensional methods.")
1178 (license license:gpl2+)))
1179
1180 (define-public meep
1181 (package
1182 (name "meep")
1183 (version "1.8.0")
1184 (source (origin
1185 (method url-fetch)
1186 (uri
1187 (string-append
1188 "https://github.com/NanoComp/meep/releases/download/v"
1189 version "/meep-" version ".tar.gz"))
1190 (sha256
1191 (base32
1192 "14zyxmm3p80j5fz5b89sl7hgkgcisqjny5hjh4pi274ziqjqz8bm"))))
1193 (build-system gnu-build-system)
1194 (arguments
1195 `(#:configure-flags
1196 (list (string-append "--with-libctl="
1197 (assoc-ref %build-inputs "libctl")
1198 "/share/libctl"))))
1199 (native-inputs
1200 `(("fortran" ,gfortran)
1201 ("pkg-config" ,pkg-config)
1202 ("swig" ,swig)))
1203 (inputs
1204 `(("fftw" ,fftw)
1205 ("gsl" ,gsl)
1206 ("guile" ,guile-2.2)
1207 ("harminv" ,harminv)
1208 ("hdf5" ,hdf5)
1209 ("lapack" ,lapack)
1210 ("libctl" ,guile-libctl)
1211 ("mpb" ,mpb)
1212 ("zlib" ,zlib)))
1213 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1214 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1215 (description
1216 "Meep is a finite-difference time-domain (FDTD) simulation software package
1217 developed at MIT to model electromagnetic systems.")
1218 (license license:gpl2+)))
1219
1220 (define-public adms
1221 (package
1222 (name "adms")
1223 (version "2.3.6")
1224 (source (origin
1225 (method url-fetch)
1226 (uri
1227 (string-append
1228 "mirror://sourceforge/mot-adms/adms-source/"
1229 (version-major+minor version) "/adms-" version ".tar.gz"))
1230 (sha256
1231 (base32
1232 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1233 (build-system gnu-build-system)
1234 (native-inputs
1235 `(("flex" ,flex)
1236 ("bison" ,bison)))
1237 (home-page "https://sourceforge.net/projects/mot-adms")
1238 (synopsis "Automatic device model synthesizer")
1239 (description
1240 "ADMS is a code generator that converts electrical compact device models
1241 specified in high-level description language into ready-to-compile C code for
1242 the API of spice simulators. Based on transformations specified in XML
1243 language, ADMS transforms Verilog-AMS code into other target languages.")
1244 (license license:gpl3)))
1245
1246 (define-public capstone
1247 (package
1248 (name "capstone")
1249 (version "3.0.5")
1250 (source (origin
1251 (method git-fetch)
1252 (uri (git-reference
1253 (url "https://github.com/aquynh/capstone")
1254 (commit version)))
1255 (file-name (git-file-name name version))
1256 (sha256
1257 (base32
1258 "0dgf82kxj4rs45d6s8sr984c38sll1n5scpypjlyh21gh2yl4qfw"))))
1259 (build-system gnu-build-system)
1260 (arguments
1261 `(#:tests? #f
1262 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1263 "CC=gcc")
1264 #:phases
1265 (modify-phases %standard-phases
1266 (delete 'configure) ; no configure script
1267 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1268 (add-before 'build 'fix-cstool-ldflags
1269 (lambda* (#:key outputs #:allow-other-keys)
1270 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1271 (assoc-ref outputs "out") "/lib"))
1272 #t)))))
1273 (home-page "https://www.capstone-engine.org")
1274 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1275 (description
1276 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1277 framework. Capstone can disassemble machine code for many supported architectures
1278 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1279 bindings for Python, Java, OCaml and more.")
1280 (license license:bsd-3)))
1281
1282 ;; FIXME: This package has a timestamp embedded in
1283 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1284 (define-public python-capstone
1285 (package
1286 (inherit capstone)
1287 (name "python-capstone")
1288 (propagated-inputs
1289 `(("capstone" ,capstone)))
1290 (build-system python-build-system)
1291 (arguments
1292 `(#:phases
1293 (modify-phases %standard-phases
1294 (add-after 'unpack 'chdir-and-fix-setup-py
1295 (lambda _
1296 (chdir "bindings/python")
1297 ;; Do not build the library again, because we already have it.
1298 (substitute* "setup.py" ((".* build_libraries.*") ""))
1299 ;; This substitution tells python-capstone where to find the
1300 ;; library.
1301 (substitute* "capstone/__init__.py"
1302 (("pkg_resources.resource_filename.*")
1303 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1304 #t)))))))
1305
1306 (define-public python2-capstone
1307 (package-with-python2 python-capstone))
1308
1309 (define-public radare2
1310 (package
1311 (name "radare2")
1312 (version "4.2.1")
1313 (source (origin
1314 (method git-fetch)
1315 (uri (git-reference
1316 (url "https://github.com/radareorg/radare2")
1317 (commit version)))
1318 (sha256
1319 (base32
1320 "14b9433cgc2nabhz836zfgvgh2dwailcmvy05krsa0inmzbvx9fg"))
1321 (file-name (git-file-name name version))
1322 (modules '((guix build utils)))
1323 (snippet
1324 '(begin
1325 (substitute* "libr/asm/p/Makefile"
1326 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1327 (substitute* "libr/parse/p/Makefile"
1328 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1329 (substitute* "libr/bin/p/Makefile"
1330 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1331 #t))))
1332 (build-system gnu-build-system)
1333 (arguments
1334 '(#:tests? #f ; tests require git and network access
1335 #:phases
1336 (modify-phases %standard-phases
1337 (add-before 'configure 'mklibdir
1338 (lambda* (#:key inputs #:allow-other-keys)
1339 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1340 #t)))
1341 #:configure-flags
1342 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1343 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1344 #:make-flags
1345 (list "CC=gcc")))
1346 (inputs
1347 `(("openssl" ,openssl)
1348 ("zip" ,zip)
1349 ("gmp" ,gmp)
1350 ("capstone" ,capstone)))
1351 (native-inputs
1352 `(("pkg-config" ,pkg-config)))
1353 (home-page "https://radare.org/")
1354 (synopsis "Reverse engineering framework")
1355 (description
1356 "Radare2 is a complete framework for reverse-engineering, debugging, and
1357 analyzing binaries. It is composed of a set of small utilities that can be
1358 used together or independently from the command line.
1359
1360 Radare2 is built around a scriptable disassembler and hexadecimal editor that
1361 support a variety of executable formats for different processors and operating
1362 systems, through multiple back ends for local and remote files and disk
1363 images.
1364
1365 It can also compare (@dfn{diff}) binaries with graphs and extract information
1366 like relocation symbols. It is able to deal with malformed binaries, making
1367 it suitable for security research and analysis.")
1368 (license license:lgpl3)))
1369
1370 (define-public asco
1371 (package
1372 (name "asco")
1373 (version "0.4.10")
1374 (source (origin
1375 (method url-fetch)
1376 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1377 version ".tar.gz"))
1378 (sha256
1379 (base32
1380 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1381 (build-system gnu-build-system)
1382 (arguments
1383 `(#:tests? #f ; no tests
1384 #:make-flags '("all" "asco-mpi")
1385 #:phases
1386 (modify-phases %standard-phases
1387 (delete 'configure)
1388 (add-before 'build 'fix-paths
1389 (lambda* (#:key inputs #:allow-other-keys)
1390 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1391 (substitute* '("errfunc.c" "asco.c")
1392 (("cp ")
1393 (string-append coreutils "/bin/cp "))
1394 (("nice")
1395 (string-append coreutils "/bin/nice")))
1396 (substitute* "Makefile"
1397 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1398 #t)))
1399 (replace 'install ; no install target
1400 (lambda* (#:key outputs #:allow-other-keys)
1401 (for-each (lambda (file)
1402 (install-file file (string-append
1403 (assoc-ref outputs "out")
1404 "/bin")))
1405 '("asco" "asco-mpi" "asco-test"
1406 "tools/alter/alter" "tools/log/log"))
1407 #t)))))
1408 (native-inputs
1409 `(("mpi" ,openmpi)))
1410 (inputs
1411 `(("coreutils-minimal" ,coreutils-minimal)))
1412 (home-page "http://asco.sourceforge.net/")
1413 (synopsis "SPICE circuit optimizer")
1414 (description
1415 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1416 high-performance parallel differential evolution (DE) optimization algorithm.")
1417 (license license:gpl2+)))
1418
1419 (define-public libngspice
1420 ;; Note: The ngspice's build system does not allow us to build both the
1421 ;; library and the executables in one go. Thus, we have two packages.
1422 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1423 (package
1424 (name "libngspice")
1425 (version "28")
1426 (source (origin
1427 (method url-fetch)
1428 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1429 version "/ngspice-" version ".tar.gz"))
1430 (sha256
1431 (base32
1432 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1433 (modules '((guix build utils)))
1434 ;; We remove the non-free cider and build without it.
1435 (snippet
1436 '(begin
1437 (delete-file-recursively "src/ciderlib")
1438 (delete-file "src/ciderinit")
1439 (substitute* "configure"
1440 (("src/ciderlib/Makefile") "")
1441 (("src/ciderlib/input/Makefile") "")
1442 (("src/ciderlib/support/Makefile") "")
1443 (("src/ciderlib/oned/Makefile") "")
1444 (("src/ciderlib/twod/Makefile") ""))
1445 #t))))
1446 (build-system gnu-build-system)
1447 (arguments
1448 `(;; No tests for libngspice exist.
1449 ;; The transient tests for ngspice fail.
1450 #:tests? #f
1451 #:phases
1452 (modify-phases %standard-phases
1453 (add-after 'unpack 'patch-timestamps
1454 (lambda _
1455 (substitute* "configure"
1456 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1457 #t))
1458 (add-after 'unpack 'delete-program-manuals
1459 (lambda _
1460 (substitute* "man/man1/Makefile.in"
1461 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1462 "man_MANS = "))
1463 #t))
1464 (add-after 'install 'delete-script-files
1465 (lambda* (#:key outputs #:allow-other-keys)
1466 (delete-file-recursively
1467 (string-append (assoc-ref outputs "out")
1468 "/share/ngspice/scripts")))))
1469 #:configure-flags
1470 (list "--enable-openmp"
1471 "--enable-xspice"
1472 "--with-ngshared"
1473 "--with-readline=yes")))
1474 (native-inputs
1475 `(("bison" ,bison)
1476 ("flex" ,flex)))
1477 (inputs
1478 `(("libxaw" ,libxaw)
1479 ("mpi" ,openmpi)
1480 ("readline" ,readline)))
1481 (home-page "http://ngspice.sourceforge.net/")
1482 (synopsis "Mixed-level/mixed-signal circuit simulator")
1483 (description
1484 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1485 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1486 provides code modeling support and simulation of digital components through
1487 an embedded event driven algorithm.")
1488 (license (list license:lgpl2.0+ ; code in frontend/numparam
1489 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1490 license:public-domain)))) ; xspice
1491
1492 (define-public ngspice
1493 ;; The ngspice executables (see libngpsice above.)
1494 (package (inherit libngspice)
1495 (name "ngspice")
1496 (arguments
1497 (substitute-keyword-arguments (package-arguments libngspice)
1498 ((#:configure-flags flags)
1499 `(delete "--with-ngshared" ,flags))
1500 ((#:phases phases)
1501 `(modify-phases ,phases
1502 (add-after 'unpack 'delete-include-files
1503 (lambda _
1504 (substitute* "src/Makefile.in"
1505 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1506 "SUBDIRS = misc maths frontend spicelib"))
1507 #t))
1508 (add-after 'install 'delete-cmpp-dlmain
1509 (lambda* (#:key outputs #:allow-other-keys)
1510 (for-each (lambda (file)
1511 (delete-file
1512 (string-append (assoc-ref outputs "out")
1513 file)))
1514 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1515 #t))
1516 (delete 'delete-program-manuals)
1517 (delete 'delete-script-files)))))
1518 (inputs
1519 `(("libngspice" ,libngspice)
1520 ("readline" ,readline)))))
1521
1522 (define trilinos-serial-xyce
1523 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1524 ;; keep it private. See
1525 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1526 ;; TODO: Remove when we have modular Trilinos packages?
1527 (package
1528 (name "trilinos-serial-xyce")
1529 (version "12.12.1")
1530 (source
1531 (origin (method url-fetch)
1532 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1533 version "-Source.tar.gz"))
1534 (sha256
1535 (base32
1536 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1537 (build-system cmake-build-system)
1538 (arguments
1539 `(#:out-of-source? #t
1540 #:phases
1541 (modify-phases %standard-phases
1542 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1543 ;; phase to fail.
1544 (add-before 'validate-runpath 'delete-tribits
1545 (lambda* (#:key outputs #:allow-other-keys)
1546 (delete-file-recursively
1547 (string-append (assoc-ref outputs "out")
1548 "/lib/cmake/tribits"))
1549 #t)))
1550 #:configure-flags
1551 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1552 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1553 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1554 "-DTrilinos_ENABLE_NOX=ON"
1555 "-DNOX_ENABLE_LOCA=ON"
1556 "-DTrilinos_ENABLE_EpetraExt=ON"
1557 "-DEpetraExt_BUILD_BTF=ON"
1558 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1559 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1560 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1561 "-DTrilinos_ENABLE_Ifpack=ON"
1562 "-DTrilinos_ENABLE_Isorropia=ON"
1563 "-DTrilinos_ENABLE_AztecOO=ON"
1564 "-DTrilinos_ENABLE_Belos=ON"
1565 "-DTrilinos_ENABLE_Teuchos=ON"
1566 "-DTeuchos_ENABLE_COMPLEX=ON"
1567 "-DTrilinos_ENABLE_Amesos=ON"
1568 "-DAmesos_ENABLE_KLU=ON"
1569 "-DAmesos_ENABLE_UMFPACK=ON"
1570 "-DTrilinos_ENABLE_Sacado=ON"
1571 "-DTrilinos_ENABLE_Kokkos=OFF"
1572 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1573 "-DTPL_ENABLE_AMD=ON"
1574 "-DTPL_ENABLE_UMFPACK=ON"
1575 "-DTPL_ENABLE_BLAS=ON"
1576 "-DTPL_ENABLE_LAPACK=ON")))
1577 (native-inputs
1578 `(("fortran" ,gfortran)
1579 ("swig" ,swig)))
1580 (inputs
1581 `(("boost" ,boost)
1582 ("lapack" ,lapack)
1583 ("suitesparse" ,suitesparse)))
1584 (home-page "https://trilinos.org")
1585 (synopsis "Engineering and scientific problems algorithms")
1586 (description
1587 "The Trilinos Project is an effort to develop algorithms and enabling
1588 technologies within an object-oriented software framework for the solution of
1589 large-scale, complex multi-physics engineering and scientific problems. A
1590 unique design feature of Trilinos is its focus on packages.")
1591 (license (list license:lgpl2.1+
1592 license:bsd-3))))
1593
1594 (define-public xyce-serial
1595 (package
1596 (name "xyce-serial")
1597 (version "6.8")
1598 (source
1599 (origin (method url-fetch)
1600 (uri (string-append "https://archive.org/download/Xyce-"
1601 version "/Xyce-" version ".tar.gz"))
1602 (sha256
1603 (base32
1604 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1605 (build-system gnu-build-system)
1606 (arguments
1607 `(#:tests? #f
1608 #:configure-flags
1609 (list
1610 "CXXFLAGS=-O3"
1611 (string-append "ARCHDIR="
1612 (assoc-ref %build-inputs "trilinos")))))
1613 (native-inputs
1614 `(("bison" ,bison-3.0) ;'configure' fails with Bison 3.4
1615 ("flex" ,flex)
1616 ("fortran" ,gfortran)))
1617 (inputs
1618 `(("fftw" ,fftw)
1619 ("suitesparse" ,suitesparse)
1620 ("lapack" ,lapack)
1621 ("trilinos" ,trilinos-serial-xyce)))
1622 (home-page "https://xyce.sandia.gov/")
1623 (synopsis "High-performance analog circuit simulator")
1624 (description
1625 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1626 capable of solving extremely large circuit problems by supporting large-scale
1627 parallel computing platforms. It also supports serial execution.")
1628 (license license:gpl3+)))
1629
1630 (define trilinos-parallel-xyce
1631 (package (inherit trilinos-serial-xyce)
1632 (name "trilinos-parallel-xyce")
1633 (arguments
1634 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1635 ((#:configure-flags flags)
1636 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1637 "-DTrilinos_ENABLE_Zoltan=ON"
1638 "-DTPL_ENABLE_MPI=ON")
1639 ,flags)))))
1640 (inputs
1641 `(("mpi" ,openmpi)
1642 ,@(package-inputs trilinos-serial-xyce)))))
1643
1644 (define-public xyce-parallel
1645 (package (inherit xyce-serial)
1646 (name "xyce-parallel")
1647 (arguments
1648 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1649 ((#:configure-flags flags)
1650 `(list "CXXFLAGS=-O3"
1651 "CXX=mpiCC"
1652 "CC=mpicc"
1653 "F77=mpif77"
1654 "--enable-mpi"
1655 (string-append
1656 "ARCHDIR="
1657 (assoc-ref %build-inputs "trilinos")))))))
1658 (propagated-inputs
1659 `(("mpi" ,openmpi)))
1660 (inputs
1661 `(("trilinos" ,trilinos-parallel-xyce)
1662 ,@(alist-delete "trilinos"
1663 (package-inputs xyce-serial))))))
1664
1665 (define-public freehdl
1666 (package
1667 (name "freehdl")
1668 (version "0.0.8")
1669 (source (origin
1670 (method url-fetch)
1671 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1672 version ".tar.gz"))
1673 (sha256
1674 (base32
1675 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1676 (build-system gnu-build-system)
1677 (arguments
1678 `(#:phases
1679 (modify-phases %standard-phases
1680 (add-before 'configure 'patch-pkg-config
1681 (lambda* (#:key inputs #:allow-other-keys)
1682 (substitute* "freehdl/freehdl-config"
1683 (("pkg-config")
1684 (string-append (assoc-ref inputs "pkg-config")
1685 "/bin/pkg-config"))
1686 (("cat")
1687 (string-append (assoc-ref inputs "coreutils")
1688 "/bin/cat")))
1689 #t))
1690 (add-after 'patch-pkg-config 'setenv
1691 (lambda* (#:key inputs #:allow-other-keys)
1692 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1693 "/bin/g++"))
1694 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1695 "/bin/libtool"))
1696 #t))
1697 (add-after 'setenv 'patch-gvhdl
1698 (lambda _
1699 (substitute* "v2cc/gvhdl.in"
1700 (("--mode=link") "--mode=link --tag=CXX")
1701 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1702 #t))
1703 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1704 (lambda* (#:key inputs #:allow-other-keys)
1705 (substitute* "freehdl/freehdl-gennodes.in"
1706 (("guile")
1707 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1708 (("\\(debug") ";(debug")
1709 (("\\(@ ") "(apply-emit")
1710 (("\\(@@ ") "(apply-mini-format"))
1711 #t))
1712 (add-after 'configure 'patch-freehdl-pc
1713 (lambda* (#:key inputs #:allow-other-keys)
1714 (substitute* "freehdl.pc"
1715 (("=g\\+\\+")
1716 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1717 "/bin/g++"))
1718 (("=libtool")
1719 (string-append "=" (assoc-ref inputs "libtool")
1720 "/bin/libtool")))
1721 #t))
1722 (add-after 'install-scripts 'make-wrapper
1723 (lambda* (#:key inputs outputs #:allow-other-keys)
1724 (let ((out (assoc-ref outputs "out")))
1725 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1726 ;; file name.
1727 (wrap-program (string-append out "/bin/gvhdl")
1728 `("CPLUS_INCLUDE_PATH" ":" prefix
1729 (,(string-append (assoc-ref inputs "gcc-toolchain")
1730 "/include")))
1731 `("LIBRARY_PATH" ":" prefix
1732 (,(string-append (assoc-ref inputs "gcc-toolchain")
1733 "/lib")))
1734 `("PATH" ":" prefix
1735 (,(string-append (assoc-ref inputs "gcc-toolchain")
1736 "/bin")
1737 ,(string-append (assoc-ref inputs "coreutils")
1738 "/bin"))))
1739 (wrap-program (string-append out "/bin/freehdl-config")
1740 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1741 #t)))))
1742 (inputs
1743 `(("coreutils" ,coreutils)
1744 ("gcc-toolchain" ,gcc-toolchain)
1745 ("guile" ,guile-2.2)
1746 ("perl" ,perl)
1747 ("pkg-config" ,pkg-config)
1748 ("libtool" ,libtool)))
1749 (native-inputs
1750 `(("pkg-config-native" ,pkg-config)
1751 ("gcc" ,gcc-5)
1752 ("libtool-native" ,libtool)))
1753 (home-page "http://www.freehdl.seul.org/")
1754 (synopsis "VHDL simulator")
1755 (description
1756 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1757 VHDL'93 as well as VHDL'87 standards are supported.")
1758 (license (list license:gpl2+
1759 license:lgpl2.0+)))) ; freehdl's libraries
1760
1761 (define-public qucs
1762 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1763 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1764 ;; comment and update the package.
1765 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1766 (revision "0"))
1767 (package
1768 (name "qucs")
1769 (version (git-version "0.0.19" revision commit))
1770 (source (origin
1771 (method git-fetch)
1772 (uri (git-reference
1773 (url "https://github.com/Qucs/qucs")
1774 (commit commit)))
1775 (sha256
1776 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1777 (file-name (string-append name "-" version "-checkout"))))
1778 (build-system gnu-build-system)
1779 (arguments
1780 `(#:phases
1781 (modify-phases %standard-phases
1782 (add-before 'bootstrap 'patch-bootstrap
1783 (lambda _
1784 (for-each patch-shebang
1785 '("bootstrap"
1786 "qucs/bootstrap"
1787 "qucs-doc/bootstrap"
1788 "qucs-core/bootstrap"))
1789 #t))
1790 (add-before 'configure 'patch-configure
1791 (lambda* (#:key inputs #:allow-other-keys)
1792 (substitute* "qucs/configure"
1793 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1794 #t))
1795 (add-after 'patch-configure 'patch-scripts
1796 (lambda* (#:key inputs outputs #:allow-other-keys)
1797 (substitute* '("qucs/qucs/qucsdigi"
1798 "qucs/qucs/qucsdigilib"
1799 "qucs/qucs/qucsveri")
1800 (("\\$BINDIR")
1801 (string-append (assoc-ref outputs "out") "/bin"))
1802 (("freehdl-config")
1803 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1804 (("freehdl-v2cc")
1805 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1806 (("cp ")
1807 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1808 (("glibtool")
1809 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1810 (("sed")
1811 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1812 (("iverilog")
1813 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1814 (("vvp")
1815 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1816 #t))
1817 (add-before 'check 'pre-check
1818 (lambda _
1819 ;; The test suite requires a running X server.
1820 (system "Xvfb :1 &")
1821 (setenv "DISPLAY" ":1")
1822 #t))
1823 (add-after 'install 'make-wrapper
1824 (lambda* (#:key inputs outputs #:allow-other-keys)
1825 (let ((out (assoc-ref outputs "out")))
1826 ;; 'qucs' directly invokes gcc, hence this wrapping.
1827 (wrap-program (string-append out "/bin/qucs")
1828 `("CPLUS_INCLUDE_PATH" ":" prefix
1829 (,(string-append (assoc-ref inputs "gcc-toolchain")
1830 "/include")))
1831 `("PATH" ":" prefix
1832 (,(string-append (assoc-ref inputs "gcc-toolchain")
1833 "/bin")))
1834 `("LIBRARY_PATH" ":" prefix
1835 (,(string-append (assoc-ref inputs "gcc-toolchain")
1836 "/lib")))
1837 `("ADMSXMLBINDIR" ":" prefix
1838 (,(string-append (assoc-ref inputs "adms") "/bin")))
1839 `("ASCOBINDIR" ":" prefix
1840 (,(string-append (assoc-ref inputs "asco") "/bin")))
1841 `("QUCS_OCTAVE" ":" prefix
1842 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1843 #t)))
1844 #:parallel-build? #f ; race condition
1845 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1846 (native-inputs
1847 `(("autoconf" ,autoconf)
1848 ("automake" ,automake)
1849 ("bison" ,bison)
1850 ("flex" ,flex)
1851 ("gperf" ,gperf)
1852 ("libtool-native" ,libtool)
1853 ("pkg-config" ,pkg-config)
1854 ("python" ,python-2) ; for tests
1855 ("matplotlib" ,python2-matplotlib) ; for tests
1856 ("numpy" ,python2-numpy) ; for tests
1857 ("xorg-server" ,xorg-server-for-tests))) ; for tests
1858 (inputs
1859 `(("adms" ,adms)
1860 ("asco" ,asco)
1861 ("coreutils" ,coreutils)
1862 ("freehdl" ,freehdl)
1863 ("gcc-toolchain" ,gcc-toolchain)
1864 ("iverilog" ,iverilog)
1865 ("libtool" ,libtool)
1866 ("octave" ,octave-cli)
1867 ("qt4" ,qt-4)
1868 ("sed" ,sed)))
1869 (home-page "http://qucs.sourceforge.net/")
1870 (synopsis "Circuit simulator with graphical user interface")
1871 (description
1872 "Qucs is a circuit simulator with graphical user interface. The software
1873 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1874 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1875 simulations are also supported.")
1876 (license license:gpl2+))))
1877
1878 (define-public qucs-s
1879 (package
1880 (name "qucs-s")
1881 (version "0.0.21")
1882 (source (origin
1883 (method url-fetch)
1884 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1885 version ".tar.gz"))
1886 (file-name (string-append name "-" version ".tar.gz"))
1887 (sha256
1888 (base32
1889 "12m1jwhb9qwvb141qzyskbxnw3wn1x22d02z4b4862p7xvccl5h7"))))
1890 (build-system cmake-build-system)
1891 (arguments
1892 `(#:tests? #f ; no tests
1893 #:phases
1894 (modify-phases %standard-phases
1895 (add-before 'configure 'patch-scripts
1896 (lambda* (#:key inputs #:allow-other-keys)
1897 (substitute* '("qucs/qucsdigi"
1898 "qucs/qucsdigilib"
1899 "qucs/qucsveri")
1900 (("\\$BINDIR")
1901 (string-append (assoc-ref inputs "qucs") "/bin"))
1902 (("freehdl-config")
1903 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1904 (("freehdl-v2cc")
1905 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1906 (("cp ")
1907 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1908 (("glibtool")
1909 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1910 (("sed")
1911 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1912 (("iverilog")
1913 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1914 (("vvp")
1915 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1916 #t))
1917 (add-after 'patch-scripts 'patch-paths
1918 (lambda* (#:key inputs #:allow-other-keys)
1919 (substitute* "qucs/main.cpp"
1920 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1921 "\\+ \"qucsator\" \\+ executableSuffix"))
1922 (string-append "}{ QucsSettings.Qucsator = \""
1923 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1924 (((string-append "QucsSettings\\.XyceExecutable = "
1925 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1926 (string-append "}{ QucsSettings.XyceExecutable = \""
1927 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1928 (((string-append "else QucsSettings\\.XyceParExecutable = "
1929 "\"mpirun -np %p /usr/local"
1930 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1931 (string-append "QucsSettings.XyceParExecutable = \""
1932 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1933 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1934 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1935 (string-append "QucsSettings.NgspiceExecutable = " "\""
1936 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1937 (substitute* "qucs/extsimkernels/ngspice.cpp"
1938 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
1939 (substitute* "qucs/qucs_actions.cpp"
1940 (("qucstrans")
1941 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1942 (("qucsattenuator")
1943 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1944 (("qucsrescodes")
1945 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1946 #t))
1947 (add-after 'install 'install-scripts
1948 (lambda* (#:key inputs outputs #:allow-other-keys)
1949 (for-each
1950 (lambda (script)
1951 (let ((file (string-append "../qucs_s-" ,version
1952 "/qucs/" script))
1953 (out (assoc-ref outputs "out")))
1954 (install-file file (string-append out "/bin"))
1955 (chmod (string-append out "/bin/" script) #o555)))
1956 '("qucsdigi" "qucsdigilib" "qucsveri"))
1957 #t))
1958 (add-after 'install-scripts 'make-wrapper
1959 (lambda* (#:key inputs outputs #:allow-other-keys)
1960 (let* ((out (assoc-ref outputs "out"))
1961 (file (string-append out "/bin/qucs-s"))
1962 (qucs (assoc-ref inputs "qucs"))
1963 (qucsator (string-append qucs "/bin/qucsator")))
1964 (wrap-program file
1965 `("CPLUS_INCLUDE_PATH" ":" prefix
1966 (,(string-append (assoc-ref inputs "gcc-toolchain")
1967 "/include")))
1968 `("PATH" ":" prefix
1969 (,(string-append (assoc-ref inputs "gcc-toolchain")
1970 "/bin")))
1971 `("LIBRARY_PATH" ":" prefix
1972 (,(string-append (assoc-ref inputs "gcc-toolchain")
1973 "/lib")))
1974 `("QUCSATOR" ":" prefix (,qucsator))
1975 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1976 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1977 "/bin")))
1978 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1979 "/bin")))
1980 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1981 "/bin/octave"))))
1982 (symlink qucsator (string-append out "/bin/qucsator"))
1983 #t))))))
1984 (native-inputs
1985 `(("libtool-native" ,libtool)))
1986 (inputs
1987 `(("adms" ,adms)
1988 ("asco" ,asco)
1989 ("coreutils" ,coreutils)
1990 ("freehdl" ,freehdl)
1991 ("gcc-toolchain" ,gcc-toolchain)
1992 ("iverilog" ,iverilog)
1993 ("libtool" ,libtool)
1994 ("mpi" ,openmpi)
1995 ("ngspice" ,ngspice)
1996 ("octave" ,octave-cli)
1997 ("qt4" ,qt-4)
1998 ("qucs" ,qucs)
1999 ("sed" ,sed)
2000 ("xyce-serial" ,xyce-serial)
2001 ("xyce-parallel" ,xyce-parallel)))
2002 (home-page "https://ra3xdh.github.io/")
2003 (synopsis "Circuit simulator with graphical user interface")
2004 (description
2005 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
2006 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
2007 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
2008 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
2009 (license license:gpl2+)))
2010
2011 (define-public librepcb
2012 (package
2013 (name "librepcb")
2014 (version "0.1.3")
2015 (source
2016 (origin
2017 (method url-fetch)
2018 (uri (string-append "https://download.librepcb.org/releases/"
2019 version "/librepcb-" version "-source.zip"))
2020 (sha256
2021 (base32 "1ich849dsx2hmcwlwbry4mkg374n940l3hy6srh4qms2rm7vd7x0"))))
2022 (build-system gnu-build-system)
2023 (inputs
2024 `(("qtbase" ,qtbase)
2025 ("zlib" ,zlib)))
2026 (native-inputs
2027 `(("qttools" ,qttools) ; for lrelease
2028 ("unzip" ,unzip)))
2029 (arguments
2030 `(#:phases
2031 (modify-phases %standard-phases
2032 (replace 'configure
2033 (lambda* (#:key inputs outputs #:allow-other-keys)
2034 (mkdir-p "build")
2035 (chdir "build")
2036 (let ((lrelease (string-append (assoc-ref inputs "qttools")
2037 "/bin/lrelease"))
2038 (out (assoc-ref outputs "out")))
2039 (invoke "qmake"
2040 (string-append "QMAKE_LRELEASE=" lrelease)
2041 (string-append "PREFIX=" out)
2042 "../librepcb.pro")))))))
2043 (home-page "https://librepcb.org/")
2044 (synopsis "Electronic Design Automation tool")
2045 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
2046 software to develop printed circuit boards. It features human readable file
2047 formats and complete project management with library, schematic and board
2048 editors.")
2049 (license (list license:gpl3+
2050 license:boost1.0 ; libs/clipper,
2051 ; libs/optional/tests/catch.hpp,
2052 ; libs/sexpresso/tests/catch.hpp
2053 license:expat ; libs/delaunay-triangulation,
2054 ; libs/parseagle, libs/type_safe
2055 license:asl2.0 ; libs/fontobene, libs/googletest,
2056 ; libs/parseagle
2057 license:isc ; libs/hoedown
2058 license:cc0 ; libs/optional, libs/sexpresso
2059 license:bsd-2 ; libs/optional/tests/catch.hpp
2060 license:lgpl2.1+)))) ; libs/quazip
2061
2062 (define-public gpx
2063 (package
2064 (name "gpx")
2065 (version "2.5.2")
2066 (source (origin
2067 (method git-fetch)
2068 (uri (git-reference
2069 (url "https://github.com/markwal/GPX.git")
2070 (commit version)))
2071 (file-name (git-file-name name version))
2072 (sha256
2073 (base32
2074 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
2075 (build-system gnu-build-system)
2076 (home-page "https://github.com/markwal/GPX")
2077 (synopsis "Converting gcode to x3g files for 3D printing")
2078 (description
2079 "GPX is a post processing utility for converting gcode output from 3D
2080 slicing software to x3g files for standalone 3D printing on common 3D
2081 printers.")
2082 (license license:gpl2+)))
2083
2084 (define-public gnucap
2085 (package
2086 (name "gnucap")
2087 (version "20171003")
2088 (source
2089 (origin
2090 (method url-fetch)
2091 (uri (string-append "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/gnucap-"
2092 version ".tar.gz"))
2093 (sha256
2094 (base32
2095 "16m09xa685qhj5fqq3bcgakrwnb74xhf5f7rpqkkf9fg8plzbb1g"))))
2096 (build-system gnu-build-system)
2097 (inputs
2098 `(("readline" ,readline)))
2099 (arguments
2100 `(#:phases
2101 (modify-phases %standard-phases
2102 (replace 'configure
2103 (lambda* (#:key outputs #:allow-other-keys)
2104 (let ((out (assoc-ref outputs "out")))
2105 ;; Set correct rpath so that gnucap finds libgnucap.so.
2106 (substitute* (list "apps/configure" "lib/configure"
2107 "main/configure" "modelgen/configure")
2108 (("LDFLAGS =")
2109 (string-append "LDFLAGS = -Wl,-rpath=" out "/lib")))
2110 ;; gnucap uses a hand-written configure script that expects the
2111 ;; --prefix argument to be the first argument passed to it.
2112 (invoke "./configure" (string-append "--prefix=" out)))))
2113 (replace 'check
2114 (lambda* (#:key outputs #:allow-other-keys)
2115 (let ((out (assoc-ref outputs "out"))
2116 (libpath "../lib/O:../apps/O"))
2117 (with-directory-excursion "tests"
2118 ;; Make test return non-zero exit code when a test fails.
2119 (substitute* "test"
2120 (("/bin/sh") "/bin/sh -e")
2121 (("\\|\\| echo \"\\*\\*\\*\\* \\$ii fails \\*\\*\\*\\*\"") ""))
2122 ;; Fix expected plugin search path for test c_attach.1.gc
2123 (substitute* "==out/c_attach.1.gc.out"
2124 (("/usr/local/lib/gnucap")
2125 (string-append libpath ":" out "/lib/gnucap")))
2126 ;; Set library path so that gnucap can find libgnucap.so
2127 ;; while running the tests.
2128 (setenv "LD_LIBRARY_PATH" libpath)
2129 (invoke "./test" "../main/O/gnucap" "" "test-output" "==out"))))))))
2130 (home-page "https://www.gnu.org/software/gnucap/")
2131 (synopsis "Mixed analog and digital circuit simulator")
2132 (description "GNUcap is a circuit analysis package. It offers a general
2133 purpose circuit simulator and can perform DC and transient analyses, fourier
2134 analysis and AC analysis. The engine is designed to do true mixed-mode
2135 simulation.")
2136 (license license:gpl3+)))
2137
2138 (define-public cutter
2139 (package
2140 (name "cutter")
2141 (version "1.10.1")
2142 (source
2143 (origin
2144 (method git-fetch)
2145 (uri (git-reference
2146 (url "https://github.com/radareorg/cutter")
2147 (commit (string-append "v" version))))
2148 (file-name (git-file-name name version))
2149 (sha256
2150 (base32
2151 "1gvsrcskcdd1hxrjpkpc657anmfs25f174vxk4wzvn385rnmrxd3"))))
2152 (build-system gnu-build-system)
2153 (arguments
2154 `(#:phases
2155 (modify-phases %standard-phases
2156 (replace 'configure
2157 (lambda* (#:key inputs outputs #:allow-other-keys)
2158 (let ((out (assoc-ref outputs "out"))
2159 (radare2 (assoc-ref inputs "radare2")))
2160 ;; fix pkg-config detection ./src/lib_radare2.pri:PREFIX=/usr/lib
2161 ;; override `qmake PREFIX=`
2162 (substitute* "./src/lib_radare2.pri"
2163 (("PREFIX") "R2PREFIX")
2164 (("R2PREFIX=/usr") (string-append "R2PREFIX=" radare2)))
2165 (invoke "qmake"
2166 (string-append "PREFIX=" out)
2167 "./src/Cutter.pro")))))))
2168 (native-inputs
2169 `(("pkg-config" ,pkg-config)))
2170 (inputs
2171 `(("qtbase" ,qtbase)
2172 ("qtsvg" ,qtsvg)
2173 ("openssl" ,openssl)
2174 ("radare2" ,radare2)))
2175 (home-page "https://github.com/radareorg/cutter")
2176 (synopsis "GUI for radare2 reverse engineering framework")
2177 (description "Cutter is a GUI for radare2 reverse engineering framework.
2178 Its goal is making an advanced andcustomizable reverse-engineering platform
2179 while keeping the user experience at mind. Cutter is created by reverse
2180 engineers for reverse engineers.")
2181 (license (list license:cc-by-sa3.0 ;the "Iconic" icon set
2182 license:gpl3+)))) ;everything else
2183
2184 (define-public lib3mf
2185 (package
2186 (name "lib3mf")
2187 (version "1.8.1")
2188 (source
2189 (origin
2190 (method git-fetch)
2191 (uri (git-reference (url "https://github.com/3MFConsortium/lib3mf.git")
2192 (commit (string-append "v" version))))
2193 (file-name (git-file-name name version))
2194 (sha256
2195 (base32
2196 "11wpk6n9ga2p57h1dcrp37w77mii0r7r6mlrgmykf7rvii1rzgqd"))))
2197 (build-system cmake-build-system)
2198 (native-inputs
2199 `(("googletest-source" ,(package-source googletest))))
2200 (inputs
2201 `(("libuuid" ,util-linux)))
2202 (arguments
2203 `(#:phases
2204 (modify-phases %standard-phases
2205 (add-after 'unpack 'unpack-googletest
2206 (lambda* (#:key inputs #:allow-other-keys)
2207 (copy-recursively (assoc-ref inputs "googletest-source")
2208 "UnitTests/googletest")
2209 #t)))))
2210 (synopsis "Implementation of the 3D Manufacturing Format (3MF) file standard")
2211 (description
2212 "Lib3MF is a C++ implementation of the 3D Manufacturing Format (3MF) file
2213 standard. It offers a way to integrate 3MF reading and writing capabilities, as
2214 well as conversion and validation tools for input and output data. The
2215 specification can be downloaded at @url{http://3mf.io/specification/}.")
2216 (home-page "https://3mf.io/")
2217 (license license:bsd-2)))
2218
2219 (define-public openscad
2220 (package
2221 (name "openscad")
2222 (version "2019.05")
2223 (source
2224 (origin
2225 (method url-fetch)
2226 (uri (string-append "https://files.openscad.org/openscad-" version
2227 ".src.tar.gz"))
2228 (sha256
2229 (base32
2230 "0nbgk5q5pgnw53la0kccdcpz2f4xf6d6076rkn0q08z57hkc85ha"))))
2231 (build-system cmake-build-system)
2232 (inputs
2233 `(("boost" ,boost)
2234 ("cgal" ,cgal)
2235 ("double-conversion" ,double-conversion)
2236 ("eigen" ,eigen)
2237 ("fontconfig" ,fontconfig)
2238 ("glew" ,glew)
2239 ("gmp" ,gmp)
2240 ("harfbuzz" ,harfbuzz)
2241 ("lib3mf" ,lib3mf)
2242 ("libxml2" ,libxml2)
2243 ("libzip" ,libzip)
2244 ("mpfr" ,mpfr)
2245 ("opencsg" ,opencsg)
2246 ("qscintilla" ,qscintilla)
2247 ("qtbase" ,qtbase)
2248 ("qtmultimedia" ,qtmultimedia)))
2249 (native-inputs
2250 `(("bison" ,bison)
2251 ("flex" ,flex)
2252 ("gettext" ,gettext-minimal)
2253 ("pkg-config" ,pkg-config)
2254 ("which" ,which)
2255 ;; the following are only needed for tests
2256 ("imagemagick" ,imagemagick)
2257 ("ps" ,procps)
2258 ("python" ,python)
2259 ("xvfb" ,xorg-server-for-tests)))
2260 (arguments
2261 `(#:phases
2262 (modify-phases %standard-phases
2263 (replace 'configure
2264 (lambda* (#:key outputs #:allow-other-keys)
2265 (invoke "qmake"
2266 (string-append "PREFIX=" (assoc-ref outputs "out")))
2267 #t))
2268 (replace 'check
2269 (lambda _
2270 (with-directory-excursion "tests"
2271 (invoke "cmake" ".")
2272 (invoke "make")
2273 (invoke "ctest"))
2274 ;; strip python test files since lib dir ends up in out/share
2275 (for-each delete-file
2276 (find-files "libraries/MCAD" ".*\\.py"))
2277 #t)))))
2278 (synopsis "Script-based 3D modeling application")
2279 (description
2280 "OpenSCAD is a 3D Computer-aided Design (CAD) application. Unlike an
2281 interactive modeler, OpenSCAD generates 3D models from a script, giving you
2282 full programmatic control over your models.")
2283 (home-page "https://www.openscad.org/")
2284 (license license:gpl2+)))
2285
2286 (define-public freecad
2287 (package
2288 (name "freecad")
2289 (version "0.18.4")
2290 (source
2291 (origin
2292 (method git-fetch)
2293 (uri (git-reference
2294 (url "https://github.com/FreeCAD/FreeCAD.git")
2295 (commit version)))
2296 (file-name (git-file-name name version))
2297 (sha256
2298 (base32
2299 "170hk1kgrvsddrwykp24wyj0cha78zzmzbf50gn98x7ngqqs395s"))))
2300 (build-system qt-build-system)
2301 (native-inputs
2302 `(("doxygen" ,doxygen)
2303 ("graphviz" ,graphviz)
2304 ("qttools" ,qttools)
2305 ("pkg-config" ,pkg-config)
2306 ("swig" ,swig)))
2307 (inputs
2308 `(("boost" ,boost)
2309 ("coin3D" ,coin3D)
2310 ("eigen" ,eigen)
2311 ("freetype" ,freetype)
2312 ("glew" ,glew)
2313 ("hdf5" ,hdf5-1.10)
2314 ("libarea" ,libarea)
2315 ("libmedfile" ,libmedfile)
2316 ("libspnav" ,libspnav)
2317 ("libxi" ,libxi)
2318 ("libxmu" ,libxmu)
2319 ("openmpi" ,openmpi)
2320 ("opencascade-occt" ,opencascade-occt)
2321 ("python-matplotlib" ,python-matplotlib)
2322 ("python-pyside-2" ,python-pyside-2)
2323 ("python-pyside-2-tools" ,python-pyside-2-tools)
2324 ("python-shiboken-2" ,python-shiboken-2)
2325 ("python-wrapper" ,python-wrapper)
2326 ("qtbase" ,qtbase)
2327 ("qtsvg" ,qtsvg)
2328 ("qtx11extras" ,qtx11extras)
2329 ("qtxmlpatterns" ,qtxmlpatterns)
2330 ;; qtwebkit is optional. We remove it currently, because it takes
2331 ;; much time to compile and substitutes are often unavailable
2332 ;;("qtwebkit" ,qtwebkit)
2333 ("tbb" ,tbb)
2334 ("vtk" ,vtk)
2335 ("xerces-c" ,xerces-c)
2336 ("zlib" ,zlib)))
2337 (arguments
2338 `(#:tests? #f
2339 #:configure-flags
2340 (list
2341 "-DBUILD_QT5=ON"
2342 (string-append "-DCMAKE_INSTALL_LIBDIR="
2343 (assoc-ref %outputs "out") "/lib"))
2344 #:phases
2345 (modify-phases %standard-phases
2346 (add-before 'configure 'restore-pythonpath
2347 (lambda _
2348 (substitute* "src/Main/MainGui.cpp"
2349 (("_?putenv\\(\"PYTHONPATH=\"\\);") ""))
2350 #t))
2351 (add-after 'install 'wrap-pythonpath
2352 (lambda* (#:key outputs #:allow-other-keys)
2353 (let ((out (assoc-ref outputs "out")))
2354 (wrap-program (string-append out "/bin/FreeCAD")
2355 (list "PYTHONPATH"
2356 'prefix (list (getenv "PYTHONPATH")))))
2357 #t)))))
2358 (home-page "https://www.freecadweb.org/")
2359 (synopsis "Your Own 3D Parametric Modeler")
2360 (description
2361 "FreeCAD is a general purpose feature-based, parametric 3D modeler for
2362 CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering and
2363 product design but also fits a wider range of uses in engineering, such as
2364 architecture or other engineering specialties. It is 100% Open Source (LGPL2+
2365 license) and extremely modular, allowing for very advanced extension and
2366 customization.")
2367 (license
2368 (list
2369 license:lgpl2.1+
2370 license:lgpl2.0+
2371 license:gpl3+
2372 license:bsd-3))))
2373
2374 (define-public libmedfile
2375 (package
2376 (name "libmedfile")
2377 (version "4.0.0")
2378 (source
2379 (origin
2380 (method url-fetch)
2381 (uri (string-append
2382 "https://files.salome-platform.org/Salome/other/med-"
2383 version ".tar.gz"))
2384 (sha256
2385 (base32
2386 "017h9p0x533fm4gn6pwc8kmp72rvqmcn6vznx72nkkl2b05yjx54"))))
2387 (build-system cmake-build-system)
2388 (inputs `(("hdf5" ,hdf5-1.10)))
2389 (arguments
2390 `(#:phases
2391 (modify-phases %standard-phases
2392 (add-after 'install 'remove-test-output
2393 (lambda* (#:key outputs #:allow-other-keys)
2394 (let ((out (assoc-ref outputs "out")))
2395 (delete-file-recursively
2396 (string-append out "/bin/testc"))
2397 #t))))))
2398 (home-page "https://www.salome-platform.org")
2399 (synopsis "Library to read and write MED files")
2400 (description
2401 "The purpose of the MED module is to provide a standard for storing and
2402 recovering computer data associated to numerical meshes and fields, and to
2403 facilitate the exchange between codes and solvers.
2404
2405 The persistent data storage is based upon HDF format (like CGNS, a standard
2406 developed by Boeing and NASA in the area of Computational Fluid Dynamic).
2407
2408 MED also provides structures to hold data on meshes and fields. These
2409 structures are exchanged between solvers, hide the communication level (CORBA
2410 or MPI), and offer persistence (read/write in .med files).
2411
2412 The main benefit of a common exchange format is reduced complexity of code
2413 coupling. It also allows sharing such high level functionalities as
2414 computation of nodal connectivity of sub-elements (faces and edges),
2415 arithmetic operations on fields, entity location functionalities, and
2416 interpolation toolkit.")
2417 (license license:gpl3+)))
2418
2419 (define-public libarea
2420 (let ((revision "1")
2421 (commit "8f8bac811c10f1f01fda0d742a18591f61dd76ee"))
2422 (package
2423 (name "libarea")
2424 (version (git-version "0" revision commit))
2425 (source
2426 (origin
2427 (method git-fetch)
2428 (uri (git-reference (url "https://github.com/Heeks/libarea.git")
2429 (commit commit)))
2430 (file-name (git-file-name name version))
2431 (sha256
2432 (base32 "0pvqz6cabxqdz5y26wnj6alkn8v5d7gkx0d3h8xmg4lvy9r3kh3g"))))
2433 (build-system gnu-build-system)
2434 (inputs `(("boost" ,boost)
2435 ("python-wrapper" ,python-wrapper)))
2436 (native-inputs
2437 `(("cmake" ,cmake-minimal)))
2438 (arguments
2439 `(#:tests? #f
2440 #:phases
2441 (modify-phases %standard-phases
2442 (add-after 'configure 'cmake-configure
2443 (lambda* (#:key inputs outputs #:allow-other-keys)
2444 (let ((out (assoc-ref outputs "out"))
2445 (cmake (assoc-ref inputs "cmake")))
2446 (mkdir-p "build")
2447 (invoke "cmake"
2448 (string-append "-DCMAKE_INSTALL_PREFIX=" out)))))
2449 (delete 'configure))))
2450 (home-page "https://github.com/Heeks/libarea")
2451 (synopsis
2452 "Library and python module for pocketing and profiling operations")
2453 (description
2454 "Area is a CAM-related software for pocketing operation.
2455
2456 This project provides library and associated python-module to compute pocket
2457 operations.")
2458 (license (list
2459 license:bsd-3
2460 license:gpl3+)))))
2461
2462 (define-public libspnav
2463 (package
2464 (name "libspnav")
2465 (version "0.2.3")
2466 (source (origin
2467 (method git-fetch)
2468 (uri (git-reference
2469 (url "https://github.com/FreeSpacenav/libspnav.git")
2470 (commit (string-append "libspnav-" version))))
2471 (sha256
2472 (base32
2473 "098h1jhlj87axpza5zgy58prp0zn94wyrbch6x0s7q4mzh7dc8ba"))
2474 (file-name (git-file-name name version))))
2475 (build-system gnu-build-system)
2476 (inputs
2477 `(("libx11" ,libx11)))
2478 (arguments `(#:tests? #f))
2479 (home-page "http://spacenav.sourceforge.net/")
2480 (synopsis
2481 "Library for communicating with spacenavd or 3dxsrv")
2482 (description
2483 "The libspnav library is provided as a replacement of the magellan
2484 library. It provides a cleaner, and more orthogonal interface. libspnav
2485 supports both the original X11 protocol for communicating with the driver, and
2486 the new alternative non-X protocol. Programs that choose to use the X11
2487 protocol, are automatically compatible with either the free spacenavd driver
2488 or the official 3dxserv, as if they were using the magellan SDK.
2489
2490 Also, libspnav provides a magellan API wrapper on top of the new API. So, any
2491 applications that were using the magellan library, can switch to libspnav
2492 without any changes. And programmers that are familiar with the magellan API
2493 can continue using it with a free library without the restrictions of the
2494 official SDK.")
2495 (license license:bsd-3)))