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