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