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