Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / engineering.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org>
8 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
9 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages engineering)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix gexp)
30 #:use-module (guix git-download)
31 #:use-module (guix monads)
32 #:use-module (guix store)
33 #:use-module (guix utils)
34 #:use-module ((srfi srfi-1) #:hide (zip))
35 #:use-module ((guix licenses) #:prefix license:)
36 #:use-module (guix build-system cmake)
37 #:use-module (guix build-system gnu)
38 #:use-module (guix build-system python)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages algebra)
41 #:use-module (gnu packages autotools)
42 #:use-module (gnu packages base)
43 #:use-module (gnu packages bison)
44 #:use-module (gnu packages boost)
45 #:use-module (gnu packages check)
46 #:use-module (gnu packages commencement)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages flex)
50 #:use-module (gnu packages fontutils)
51 #:use-module (gnu packages fpga)
52 #:use-module (gnu packages freedesktop)
53 #:use-module (gnu packages gcc)
54 #:use-module (gnu packages gd)
55 #:use-module (gnu packages gettext)
56 #:use-module (gnu packages ghostscript)
57 #:use-module (gnu packages gl)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gnome)
60 #:use-module (gnu packages gperf)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages guile)
63 #:use-module (gnu packages image)
64 #:use-module (gnu packages imagemagick)
65 #:use-module (gnu packages linux) ;FIXME: for pcb
66 #:use-module (gnu packages m4)
67 #:use-module (gnu packages maths)
68 #:use-module (gnu packages multiprecision)
69 #:use-module (gnu packages mpi)
70 #:use-module (gnu packages ncurses)
71 #:use-module (gnu packages perl)
72 #:use-module (gnu packages pkg-config)
73 #:use-module (gnu packages python)
74 #:use-module (gnu packages qt)
75 #:use-module (gnu packages readline)
76 #:use-module (gnu packages swig)
77 #:use-module (gnu packages tcl)
78 #:use-module (gnu packages tls)
79 #:use-module (gnu packages tex)
80 #:use-module (gnu packages wxwidgets)
81 #:use-module (gnu packages xorg))
82
83 (define-public librecad
84 (package
85 (name "librecad")
86 (version "2.1.3")
87 (source (origin
88 (method url-fetch)
89 (uri (string-append
90 "https://github.com/LibreCAD/LibreCAD/archive/"
91 version ".tar.gz"))
92 (file-name (string-append name "-" version ".tar.gz"))
93 (sha256
94 (base32
95 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
96 (build-system gnu-build-system)
97 (arguments
98 '(#:phases
99 (modify-phases %standard-phases
100 ;; Without this patch boost complains that "make_array" is not a
101 ;; member of "boost::serialization".
102 (add-after 'unpack 'patch-boost-error
103 (lambda _
104 (substitute* "librecad/src/lib/math/lc_quadratic.h"
105 (("#include \"rs_vector.h\"" line)
106 (string-append line
107 "\n#include <boost/serialization/array_wrapper.hpp>")))
108 (substitute* "librecad/src/lib/math/rs_math.cpp"
109 (("#include <boost/numeric/ublas/matrix.hpp>" line)
110 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
111 line)))
112 #t))
113 (add-after 'unpack 'patch-paths
114 (lambda* (#:key outputs #:allow-other-keys)
115 (let ((out (assoc-ref outputs "out")))
116 (substitute* "librecad/src/lib/engine/rs_system.cpp"
117 (("/usr/share") (string-append out "/share"))))))
118 (replace 'configure
119 (lambda* (#:key inputs #:allow-other-keys)
120 (system* "qmake" (string-append "BOOST_DIR="
121 (assoc-ref inputs "boost")))))
122 (replace 'install
123 (lambda* (#:key outputs #:allow-other-keys)
124 (let* ((out (assoc-ref outputs "out"))
125 (bin (string-append out "/bin"))
126 (share (string-append out "/share/librecad")))
127 (mkdir-p bin)
128 (install-file "unix/librecad" bin)
129 (mkdir-p share)
130 (copy-recursively "unix/resources" share))
131 #t))
132 ;; Ensure that icons are found at runtime
133 (add-after 'install 'wrap-executable
134 (lambda* (#:key inputs outputs #:allow-other-keys)
135 (let* ((out (assoc-ref outputs "out"))
136 (qt '("qtbase" "qtsvg")))
137 (wrap-program (string-append out "/bin/librecad")
138 `("QT_PLUGIN_PATH" ":" prefix
139 ,(map (lambda (label)
140 (string-append (assoc-ref inputs label)
141 "/lib/qt5/plugins/"))
142 qt)))
143 #t))))))
144 (inputs
145 `(("boost" ,boost)
146 ("muparser" ,muparser)
147 ("freetype" ,freetype)
148 ("qtbase" ,qtbase)
149 ("qtsvg" ,qtsvg)))
150 (native-inputs
151 `(("pkg-config" ,pkg-config)
152 ("which" ,which)))
153 (home-page "http://librecad.org/")
154 (synopsis "Computer-aided design (CAD) application")
155 (description
156 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
157 plans and designs.")
158 (license license:gpl2)))
159
160 (define-public geda-gaf
161 (package
162 (name "geda-gaf")
163 (version "1.9.2")
164 (source (origin
165 (method url-fetch)
166 (uri (string-append
167 "http://ftp.geda-project.org/geda-gaf/unstable/v"
168 (version-major+minor version) "/"
169 version "/geda-gaf-" version ".tar.gz"))
170 (sha256
171 (base32
172 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
173 (build-system gnu-build-system)
174 (arguments
175 '(#:phases
176 (modify-phases %standard-phases
177 ;; tests require a writable HOME
178 (add-before 'check 'set-home
179 (lambda _
180 (setenv "HOME" (getenv "TMPDIR"))
181 #t))
182 ;; FIXME: These two tests fail for unknown reasons. They return "2"
183 ;; when they should return "1".
184 (add-after 'unpack 'disable-failing-tests
185 (lambda _
186 (substitute* "utils/tests/gxyrs/tests.list"
187 (("^do_nothing.*") ""))
188 #t)))
189 #:configure-flags
190 (let ((pcb (assoc-ref %build-inputs "pcb")))
191 (list (string-append "--with-pcb-datadir=" pcb "/share")
192 (string-append "--with-pcb-lib-path="
193 pcb "/share/pcb/pcblib-newlib:"
194 pcb "/share/pcb/newlib")))))
195 (inputs
196 `(("glib" ,glib)
197 ("gtk" ,gtk+-2)
198 ("guile" ,guile-2.0)
199 ("desktop-file-utils" ,desktop-file-utils)
200 ("shared-mime-info" ,shared-mime-info)
201 ("m4" ,m4)
202 ("pcb" ,pcb)))
203 (native-inputs
204 `(("pkg-config" ,pkg-config)
205 ("perl" ,perl))) ; for tests
206 (home-page "http://geda-project.org/")
207 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
208 (description
209 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
210 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
211 which currently includes: gschem, a schematic capture program; gnetlist, a
212 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
213 gattrib, a spreadsheet programm that manipulates the properties of symbols of
214 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
215 tool to forward annotation from your schematic to layout using PCB; some minor
216 utilities.")
217 (license license:gpl2+)))
218
219 (define-public pcb
220 (package
221 (name "pcb")
222 (version "4.0.2")
223 (source (origin
224 (method url-fetch)
225 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
226 "/pcb-" version ".tar.gz"))
227 (sha256
228 (base32
229 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
230 (build-system gnu-build-system)
231 (arguments
232 `(#:phases
233 (modify-phases %standard-phases
234 (add-after 'unpack 'use-wish8.6
235 (lambda _
236 (substitute* "configure"
237 (("wish85") "wish8.6"))
238 #t))
239 ;; It checks for "xhost", which we don't have. This shouldn't
240 ;; matter, because the test is supposed to be skipped, but it causes
241 ;; "run_tests.sh" (and thus the "check" phase) to fail.
242 (add-after 'unpack 'fix-check-for-display
243 (lambda _
244 (substitute* "tests/run_tests.sh"
245 (("have_display=no") "have_display=yes"))
246 #t))
247 (add-after 'install 'wrap
248 (lambda* (#:key inputs outputs #:allow-other-keys)
249 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
250 ;; fix of the mesa package we wrap the pcb executable such that
251 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
252 (let* ((out (assoc-ref outputs "out"))
253 (path (string-append (assoc-ref inputs "udev") "/lib")))
254 (wrap-program (string-append out "/bin/pcb")
255 `("LD_LIBRARY_PATH" ":" prefix (,path))))
256 #t))
257 (add-before 'check 'pre-check
258 (lambda _
259 (system "Xvfb :1 &")
260 (setenv "DISPLAY" ":1")
261 #t)))))
262 (inputs
263 `(("dbus" ,dbus)
264 ("mesa" ,mesa)
265 ("udev" ,eudev) ;FIXME: required by mesa
266 ("glu" ,glu)
267 ("gd" ,gd)
268 ("gtk" ,gtk+-2)
269 ("gtkglext" ,gtkglext)
270 ("desktop-file-utils" ,desktop-file-utils)
271 ("shared-mime-info" ,shared-mime-info)
272 ("tk" ,tk)))
273 (native-inputs
274 `(("pkg-config" ,pkg-config)
275 ("intltool" ,intltool)
276 ("bison" ,bison)
277 ("flex" ,flex)
278 ;; For tests
279 ("imagemagick" ,imagemagick)
280 ("gerbv" ,gerbv)
281 ("ghostscript" ,ghostscript)
282 ("xvfb" ,xorg-server)))
283 (home-page "http://pcb.geda-project.org/")
284 (synopsis "Design printed circuit board layouts")
285 (description
286 "GNU PCB is an interactive tool for editing printed circuit board
287 layouts. It features a rats-nest implementation, schematic/netlist import,
288 and design rule checking. It also includes an autorouter and a trace
289 optimizer; and it can produce photorealistic and design review images.")
290 (license license:gpl2+)))
291
292 (define-public pcb-rnd
293 (package (inherit pcb)
294 (name "pcb-rnd")
295 (version "1.1.3")
296 (source (origin
297 (method url-fetch)
298 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
299 "pcb-rnd-" version ".tar.gz"))
300 (sha256
301 (base32
302 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
303 (arguments
304 `(#:tests? #f ; no check target
305 #:phases
306 (modify-phases %standard-phases
307 (add-after 'unpack 'cc-is-gcc
308 (lambda _ (setenv "CC" "gcc") #t))
309 (replace 'configure
310 ;; The configure script doesn't tolerate most of our configure flags.
311 (lambda* (#:key outputs #:allow-other-keys)
312 (zero? (system* "sh" "configure"
313 (string-append "--prefix="
314 (assoc-ref outputs "out")))))))))
315 (home-page "http://repo.hu/projects/pcb-rnd/")
316 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
317 featuring various improvements and bug fixes.")))
318
319 (define-public fastcap
320 (package
321 (name "fastcap")
322 (version "2.0-18Sep92")
323 (source (origin
324 (method url-fetch/tarbomb)
325 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
326 name "-" version ".tgz"))
327 (sha256
328 (base32
329 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
330 (snippet
331 ;; Remove a non-free file.
332 '(begin
333 (delete-file "doc/psfig.sty")
334 #t))
335 (patches (search-patches "fastcap-mulSetup.patch"
336 "fastcap-mulGlobal.patch"))))
337 (build-system gnu-build-system)
338 (native-inputs
339 ;; FIXME: with texlive-tiny citation references are rendered as question
340 ;; marks. During the build warnings like these are printed:
341 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
342 `(("texlive" ,texlive-tiny)
343 ("ghostscript" ,ghostscript)))
344 (arguments
345 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
346 #:parallel-build? #f
347 #:tests? #f ;; no tests-suite
348 #:modules ((srfi srfi-1)
349 ,@%gnu-build-system-modules)
350 #:phases
351 (modify-phases %standard-phases
352 (add-after 'build 'make-doc
353 (lambda _
354 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
355 "manual"))))
356 (add-before 'make-doc 'fix-doc
357 (lambda _
358 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
359 (substitute* (find-files "doc" "\\.tex")
360 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
361 all file scale)
362 (string-append "\\includegraphics[scale=" scale "]{"
363 file "}"))
364 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
365 all file width)
366 (string-append "\\includegraphics[width=" width "]{"
367 file "}"))
368 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
369 all file height)
370 (string-append "\\includegraphics[height=" height "]{"
371 file "}"))
372 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
373 (string-append "\\includegraphics{" file "}")))
374 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
375 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
376 all options class)
377 (string-append "\\documentclass[" options "]{"
378 class "}\n"
379 "\\usepackage{graphicx}\n"
380 "\\usepackage{robinspace}"))
381 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
382 (string-append "%" all))
383 (("\\\\setstretch\\{.*\\}" all)
384 (string-append "%" all)))
385 #t))
386 (delete 'configure)
387 (add-before 'install 'clean-bin
388 (lambda _
389 (delete-file (string-append (getcwd) "/bin/README"))
390 #t))
391 (add-before 'install 'make-pdf
392 (lambda _
393 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
394 (with-directory-excursion "doc"
395 (and
396 (every (lambda (file)
397 (zero? (system* "dvips" file "-o")))
398 (find-files "." "\\.dvi"))
399 (every (lambda (file)
400 (zero? (system* "ps2pdf" file)))
401 '("mtt.ps" "ug.ps" "tcad.ps"))
402 (zero? (system* "make" "clean"))))))
403 (replace 'install
404 (lambda* (#:key outputs #:allow-other-keys)
405 (let* ((out (assoc-ref outputs "out"))
406 (data (string-append out "/share"))
407 (bin (string-append out "/bin"))
408 (doc (string-append data "/doc/" ,name "-" ,version))
409 (examples (string-append doc "/examples")))
410 (with-directory-excursion "bin"
411 (for-each (lambda (f)
412 (install-file f bin))
413 (find-files "." ".*")))
414 (copy-recursively "doc" doc)
415 (copy-recursively "examples" examples)
416 #t))))))
417 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
418 (synopsis "Multipole-accelerated capacitance extraction program")
419 (description
420 "Fastcap is a capacitance extraction program based on a
421 multipole-accelerated algorithm.")
422 (license (license:non-copyleft #f "See fastcap.c."))))
423
424 (define-public fasthenry
425 (package
426 (name "fasthenry")
427 (version "3.0-12Nov96")
428 (source (origin
429 (method url-fetch)
430 (file-name (string-append name "-" version ".tar.gz"))
431 (uri (string-append
432 "http://www.rle.mit.edu/cpg/codes/" name
433 "-" version ".tar.z"))
434 (sha256
435 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
436 (patches (search-patches "fasthenry-spAllocate.patch"
437 "fasthenry-spBuild.patch"
438 "fasthenry-spUtils.patch"
439 "fasthenry-spSolve.patch"
440 "fasthenry-spFactor.patch"))))
441 (build-system gnu-build-system)
442 (arguments
443 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
444 #:parallel-build? #f
445 #:tests? #f ;; no tests-suite
446 #:modules ((srfi srfi-1)
447 ,@%gnu-build-system-modules)
448 #:phases
449 (modify-phases %standard-phases
450 (delete 'configure)
451 (replace 'install
452 (lambda* (#:key outputs #:allow-other-keys)
453 (let* ((out (assoc-ref outputs "out"))
454 (data (string-append out "/share"))
455 (bin (string-append out "/bin"))
456 (doc (string-append data "/doc/" ,name "-" ,version))
457 (examples (string-append doc "/examples")))
458 (with-directory-excursion "bin"
459 (for-each (lambda (f)
460 (install-file f bin))
461 (find-files "." ".*")))
462 (copy-recursively "doc" doc)
463 (copy-recursively "examples" examples)
464 #t))))))
465 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
466 (synopsis "Multipole-accelerated inductance analysis program")
467 (description
468 "Fasthenry is an inductance extraction program based on a
469 multipole-accelerated algorithm.")
470 (license (license:non-copyleft #f "See induct.c."))))
471
472 (define-public fritzing
473 (package
474 (name "fritzing")
475 (version "0.9.2b")
476 (source (origin
477 (method url-fetch)
478 (uri (string-append "https://github.com/fritzing/"
479 "fritzing-app/archive/" version ".tar.gz"))
480 (file-name (string-append name "-" version ".tar.gz"))
481 (sha256
482 (base32
483 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
484 (build-system gnu-build-system)
485 (arguments
486 `(#:phases
487 (modify-phases %standard-phases
488 (replace 'configure
489 (lambda* (#:key inputs outputs #:allow-other-keys)
490 (and (zero? (system* "tar"
491 "-xvf" (assoc-ref inputs "fritzing-parts-db")
492 "-C" "parts"))
493 (zero? (system* "qmake"
494 (string-append "PREFIX="
495 (assoc-ref outputs "out"))
496 "phoenix.pro"))))))))
497 (inputs
498 `(("qtbase" ,qtbase)
499 ("qtserialport" ,qtserialport)
500 ("qtsvg" ,qtsvg)
501 ("boost" ,boost)
502 ("zlib" ,zlib)
503 ("fritzing-parts-db"
504 ,(origin
505 (method url-fetch)
506 (uri (string-append "https://github.com/fritzing/"
507 "fritzing-parts/archive/" version ".tar.gz"))
508 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
509 (sha256
510 (base32
511 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
512 (home-page "http://fritzing.org")
513 (synopsis "Electronic circuit design")
514 (description
515 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
516 software with a low entry barrier, suited for the needs of makers and
517 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
518 library with many commonly used high-level components. Fritzing makes it very
519 easy to communicate about circuits, as well as to turn them into PCB layouts
520 ready for production.")
521 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
522 ;; released under GPLv3+.
523 (license (list license:gpl3+ license:cc-by-sa3.0))))
524
525 (define-public gerbv
526 (package
527 (name "gerbv")
528 (version "2.6.1")
529 (source (origin
530 (method url-fetch)
531 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
532 version "/gerbv-" version ".tar.gz"))
533 (sha256
534 (base32
535 "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
536 (build-system gnu-build-system)
537 (arguments
538 `(#:phases
539 (modify-phases %standard-phases
540 (add-after 'unpack 'autoconf
541 (lambda _
542 ;; Build rules contain references to Russian translation, but the
543 ;; needed files are missing; see
544 ;; http://sourceforge.net/p/gerbv/bugs/174/
545 (delete-file "po/LINGUAS")
546 (substitute* "man/Makefile.am"
547 (("PO_FILES= gerbv.ru.1.in.po") "")
548 (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
549 (zero? (system* "autoreconf" "-vfi")))))))
550 (native-inputs
551 `(("autoconf" ,autoconf)
552 ("automake" ,automake)
553 ("libtool" ,libtool)
554 ("gettext" ,gettext-minimal)
555 ("po4a" ,po4a)
556 ("pkg-config" ,pkg-config)))
557 (inputs
558 `(("cairo" ,cairo)
559 ("gtk" ,gtk+-2)
560 ("desktop-file-utils" ,desktop-file-utils)))
561 (home-page "http://gerbv.geda-project.org/")
562 (synopsis "Gerber file viewer")
563 (description
564 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
565 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
566 you load several files on top of each other, do measurements on the displayed
567 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
568 as well as pick-place files.")
569 (license license:gpl2+)))
570
571 (define-public ao
572 (let ((commit "fb288c945aa7e30d9be10a564edad7e1b6a6c1ae")
573 (revision "1"))
574 (package
575 (name "ao-cad") ;XXX: really "ao", but it collides with libao
576 (version (git-version "0" revision commit))
577 (source (origin
578 (method git-fetch)
579 (uri (git-reference
580 (url "https://github.com/mkeeter/ao")
581 (commit commit)))
582 (sha256
583 (base32
584 "0syplfqiq7ng7md44yriq5cz41jp8q9z3pl2iwkkllds6p9ylyal"))
585 (file-name (git-file-name name version))
586 (patches (search-patches "ao-cad-aarch64-support.patch"))
587 (modules '((guix build utils)))
588 (snippet
589 ;; Remove bundled libraries: Eigen, glm, and catch. TODO:
590 ;; Unbundle efsw <https://github.com/diegostamigni/efsw>.
591 '(begin
592 (delete-file-recursively "vendor")
593
594 ;; Use #include <catch.hpp>.
595 (substitute* (find-files "." "\\.[ch]pp$")
596 (("catch/catch\\.hpp")
597 "catch.hpp"))
598 #t))))
599 (build-system cmake-build-system)
600 (arguments
601 `(;; Have the RUNPATH of libao.so point to $libdir, where libefsw.so
602 ;; lives.
603 #:configure-flags (list (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
604 "-Wl,-rpath="
605 (assoc-ref %outputs "out")
606 "/lib"))
607
608 #:phases
609 (modify-phases %standard-phases
610 (add-after 'unpack 'remove-native-compilation
611 (lambda _
612 (substitute* "CMakeLists.txt" (("-march=native") ""))
613 #t))
614 (add-before 'build 'add-eigen-to-search-path
615 (lambda* (#:key inputs #:allow-other-keys)
616 ;; Allow things to find our own Eigen and Catch.
617 (let ((eigen (assoc-ref inputs "eigen")))
618 (setenv "CPLUS_INCLUDE_PATH"
619 (string-append eigen "/include/eigen3:"
620 (getenv "CPLUS_INCLUDE_PATH")))
621 #t)))
622 (add-after 'install 'install-guile-bindings
623 (lambda* (#:key inputs outputs #:allow-other-keys)
624 ;; Install the Guile bindings (the build system only installs
625 ;; libao.so.)
626 (let* ((out (assoc-ref outputs "out"))
627 (moddir (string-append out "/share/guile/site/2.0")))
628 (install-file "bind/libao.so"
629 (string-append out "/lib"))
630
631 ;; Go to the source directory.
632 (with-directory-excursion ,(string-append "../"
633 name "-" version
634 "-checkout")
635 (substitute* "bind/guile/ao/sys/libao.scm"
636 (("\\(define libao \\(dynamic-link .*$")
637 (string-append "(define libao (dynamic-link \""
638 out "/lib/libao\")) ;")))
639
640 (copy-recursively "bind/guile/ao" (string-append moddir "/ao"))
641
642 (substitute* "bin/ao-guile"
643 (("\\(add-to-load-path .*")
644 (string-append "(add-to-load-path \"" moddir "\")")))
645
646 (install-file "bin/ao-guile"
647 (string-append out "/bin"))
648
649 ;; Allow Ao to dlopen the relevant GL libraries. Otherwise
650 ;; it fails with:
651 ;; Couldn't find current GLX or EGL context.
652 (let ((mesa (assoc-ref inputs "mesa")))
653 (wrap-program (string-append out "/bin/ao-guile")
654 `("LD_LIBRARY_PATH" ":" prefix
655 (,(string-append mesa "/lib")))))
656 #t)))))))
657 (native-inputs
658 `(("pkg-config" ,pkg-config)))
659 (inputs
660 `(("boost" ,boost)
661 ("catch" ,catch-framework)
662 ("libpng" ,libpng)
663 ("glfw" ,glfw)
664 ("libepoxy" ,libepoxy)
665 ("mesa" ,mesa)
666 ("eigen" ,eigen)
667 ("glm" ,glm)
668 ("guile" ,guile-2.0)))
669 (home-page "http://www.mattkeeter.com/projects/ao/")
670 (synopsis "Tool for programmatic computer-aided design")
671 (description
672 "Ao is a tool for programmatic computer-aided design (CAD). In Ao,
673 solid models are defined as Scheme scripts, and there are no opaque function
674 calls into the geometry kernel: everything is visible to the user. Even
675 fundamental, primitive shapes are represented as code in the user-level
676 language.")
677 (license (list license:lgpl2.1+ ;library
678 license:gpl2+))))) ;Guile bindings
679
680 ;; We use kicad from a git commit, because support for boost 1.61.0 has been
681 ;; recently added.
682 (define-public kicad
683 (let ((commit "5f4599fb56da4dd748845ab10abec02961d477f3")
684 (revision "2"))
685 (package
686 (name "kicad")
687 (version (string-append "4.0-" revision "."
688 (string-take commit 7)))
689 (source
690 (origin
691 (method git-fetch)
692 (uri (git-reference
693 (url "https://git.launchpad.net/kicad")
694 (commit commit)))
695 (sha256
696 (base32 "1833pln2975gmc5s18xf7s8m9vg834lmxxdjk0wlk3lq7bvjjnff"))
697 (file-name (string-append name "-" version "-checkout"))))
698 (build-system cmake-build-system)
699 (arguments
700 `(#:out-of-source? #t
701 #:tests? #f ; no tests
702 #:build-type "Release"
703 #:configure-flags
704 (list "-DKICAD_STABLE_VERSION=ON"
705 "-DKICAD_REPO_NAME=stable"
706 ,(string-append "-DKICAD_BUILD_VERSION=4.0-"
707 (string-take commit 7))
708 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
709 "-DKICAD_SCRIPTING=ON"
710 "-DKICAD_SCRIPTING_MODULES=ON"
711 "-DKICAD_SCRIPTING_WXPYTHON=ON"
712 ;; Has to be set explicitely, as we don't have the wxPython
713 ;; headers in the wxwidgets store item, but in wxPython.
714 (string-append "-DCMAKE_CXX_FLAGS=-I"
715 (assoc-ref %build-inputs "wxpython")
716 "/include/wx-3.0")
717 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
718 "-DKICAD_SPICE=TRUE"
719 ;; TODO: Enable this when CA certs are working with curl.
720 "-DBUILD_GITHUB_PLUGIN=OFF")
721 #:phases
722 (modify-phases %standard-phases
723 (add-after 'install 'wrap-program
724 ;; Ensure correct Python at runtime.
725 (lambda* (#:key inputs outputs #:allow-other-keys)
726 (let* ((out (assoc-ref outputs "out"))
727 (python (assoc-ref inputs "python"))
728 (file (string-append out "/bin/kicad"))
729 (path (string-append
730 out
731 "/lib/python2.7/site-packages:"
732 (getenv "PYTHONPATH"))))
733 (wrap-program file
734 `("PYTHONPATH" ":" prefix (,path))
735 `("PATH" ":" prefix
736 (,(string-append python "/bin:")))))
737 #t)))))
738 (native-inputs
739 `(("boost" ,boost)
740 ("gettext" ,gnu-gettext)
741 ("pkg-config" ,pkg-config)
742 ("swig" ,swig)
743 ("zlib" ,zlib)))
744 (inputs
745 `(("cairo" ,cairo)
746 ("curl" ,curl)
747 ("desktop-file-utils" ,desktop-file-utils)
748 ("glew" ,glew)
749 ("glm" ,glm)
750 ("hicolor-icon-theme" ,hicolor-icon-theme)
751 ("libngspice" ,libngspice)
752 ("libsm" ,libsm)
753 ("mesa" ,mesa)
754 ("openssl" ,openssl)
755 ("python" ,python-2)
756 ("wxwidgets" ,wxwidgets-gtk2)
757 ("wxpython" ,python2-wxpython)))
758 (home-page "http://kicad-pcb.org/")
759 (synopsis "Electronics Design Automation Suite")
760 (description "Kicad is a program for the formation of printed circuit
761 boards and electrical circuits. The software has a number of programs that
762 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
763 electrical diagrams), gerbview (viewing Gerber files) and others.")
764 (license license:gpl3+))))
765
766 (define-public kicad-library
767 (let ((version "4.0.6"))
768 (package
769 (name "kicad-library")
770 (version version)
771 (source (origin
772 (method url-fetch)
773 (uri (string-append
774 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
775 version ".tar.gz"))
776 (sha256
777 (base32
778 "16f47pd6f0ddsdxdrp327nr9v05gl8c24d0qypq2aqx5hdjmkp7f"))))
779 (build-system cmake-build-system)
780 (arguments
781 `(#:out-of-source? #t
782 #:tests? #f ; no tests
783 #:phases
784 (modify-phases %standard-phases
785 (add-after 'install 'install-footprints ; from footprints tarball
786 (lambda* (#:key inputs outputs #:allow-other-keys)
787 (zero? (system* "tar" "xvf"
788 (assoc-ref inputs "kicad-footprints")
789 "-C" (string-append (assoc-ref outputs "out")
790 "/share/kicad/modules")
791 "--strip-components=1"))))
792 ;; We change the default global footprint file, which is generated if
793 ;; it doesn't exist in user's home directory, from the one using the
794 ;; github plugin, to the one using the KISYSMOD environment path.
795 (add-after 'install-footprints 'use-pretty-footprint-table
796 (lambda* (#:key outputs #:allow-other-keys)
797 (let* ((out (assoc-ref outputs "out"))
798 (template-dir (string-append out "/share/kicad/template"))
799 (fp-lib-table (string-append template-dir "/fp-lib-table")))
800 (delete-file fp-lib-table)
801 (copy-file (string-append fp-lib-table ".for-pretty")
802 fp-lib-table))
803 #t)))))
804 (native-search-paths
805 (list (search-path-specification
806 (variable "KISYSMOD") ; footprint path
807 (files '("share/kicad/modules")))
808 (search-path-specification
809 (variable "KISYS3DMOD") ; 3D model path
810 (files '("share/kicad/modules/packages3d")))))
811 ;; Kicad distributes footprints in a separate tarball
812 (native-inputs
813 `(("kicad-footprints"
814 ,(origin
815 (method url-fetch)
816 (uri (string-append
817 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
818 version ".tar.gz"))
819 (sha256
820 (base32
821 "0vmgqhdw05k5fdnqv42grnvlz7v75g9md82jp2d3dvw2zw050lfb"))))))
822 (home-page "http://kicad-pcb.org/")
823 (synopsis "Libraries for kicad")
824 (description "This package provides Kicad component, footprint and 3D
825 render model libraries.")
826 (license license:lgpl2.0+))))
827
828 (define-public linsmith
829 (package
830 (name "linsmith")
831 (version "0.99.30")
832 (source (origin
833 (method url-fetch)
834 (uri (string-append
835 "mirror://sourceforge/linsmith/linsmith/linsmith-"
836 version "/linsmith-" version ".tar.gz"))
837 (sha256
838 (base32
839 "18qslhr2r45rhpj4v6bjcqx189vs0bflvsj271wr7w8kvh69qwvn"))))
840 (build-system gnu-build-system)
841 (native-inputs
842 `(("pkg-config" ,pkg-config)
843 ("gtk" ,gtk+-2)
844 ("libgnome" ,libgnomeui)))
845 (home-page "http://jcoppens.com/soft/linsmith/index.en.php")
846 (synopsis "Smith Charting program")
847 (description "LinSmith is a Smith Charting program, mainly designed for
848 educational use. As such, there is an emphasis on capabilities that improve
849 the 'showing the effect of'-style of operation.")
850 (license license:gpl2+)))
851
852 (define-public volk
853 (package
854 (name "volk")
855 (version "1.3")
856 (source
857 (origin
858 (method url-fetch)
859 (uri (string-append "http://libvolk.org/releases/volk-"
860 version ".tar.gz"))
861 (sha256
862 (base32
863 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
864 (build-system cmake-build-system)
865 (inputs
866 `(("boost" ,boost)))
867 (native-inputs
868 `(("python-2" ,python-2)
869 ("python2-cheetah" ,python2-cheetah)))
870 (home-page "http://libvolk.org/")
871 (synopsis "Vector-Optimized Library of Kernels")
872 (description
873 "@code{volk} contains procedures with machine-specific optimizations
874 for mathematical functions. It also provides an machine-independent
875 interface to select the best such procedures to use on a given system.")
876 (license license:gpl3+)))
877
878 (define-public minicom
879 (package
880 (name "minicom")
881 (version "2.7.1")
882 (source
883 (origin
884 (method url-fetch)
885 (uri (string-append "https://alioth.debian.org/frs/download.php/"
886 "file/4215/" name "-" version ".tar.gz"))
887 (sha256
888 (base32
889 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
890 (build-system gnu-build-system)
891 (arguments
892 `(#:configure-flags '("--enable-lock-dir=/var/lock")
893 #:phases
894 (modify-phases %standard-phases
895 (add-after 'unpack 'patch-lock-check
896 (lambda _
897 (substitute* "configure"
898 (("test -d [$]UUCPLOCK") "true"))
899 #t)))))
900 (inputs
901 `(("ncurses" ,ncurses)))
902 (home-page "https://alioth.debian.org/projects/minicom/")
903 (synopsis "Serial terminal emulator")
904 (description "@code{minicom} is a serial terminal emulator.")
905 (license license:gpl2+)))
906
907 (define-public harminv
908 (package
909 (name "harminv")
910 (version "1.4.1")
911 (source (origin
912 (method url-fetch)
913 (uri
914 (string-append "https://github.com/stevengj/harminv/"
915 "releases/download/v" version "/"
916 name "-" version ".tar.gz"))
917 (sha256
918 (base32
919 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
920 (build-system gnu-build-system)
921 (arguments
922 `(#:phases
923 (modify-phases %standard-phases
924 (add-before 'configure 'fix-tests
925 (lambda _
926 (substitute* "./sines-test.sh"
927 ; change test frequency range - default fails
928 (("0\\.15") "0.16"))
929 #t)))))
930 (native-inputs
931 `(("fortran" ,gfortran)))
932 (inputs
933 `(("lapack" ,lapack)))
934 (home-page "https://github.com/stevengj/harminv")
935 (synopsis "Harmonic inversion solver")
936 (description
937 "Harminv is a free program (and accompanying library) to solve the problem of
938 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
939 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
940 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
941 (license license:gpl2+)))
942
943 (define-public guile-libctl
944 (package
945 (name "guile-libctl")
946 (version "3.2.2")
947 (source (origin
948 (method url-fetch)
949 (uri
950 (string-append
951 "http://ab-initio.mit.edu/libctl/libctl-"
952 version ".tar.gz"))
953 (sha256
954 (base32
955 "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
956 (build-system gnu-build-system)
957 (native-inputs
958 `(("fortran" ,gfortran)))
959 (inputs
960 `(("guile" ,guile-2.2)))
961 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
962 (synopsis "Flexible control files implementation for scientific simulations")
963 (description
964 "Libctl is a Guile-based library implementing flexible control files
965 for scientific simulations.")
966 (license license:gpl2+)))
967
968 (define-public mpb
969 (package
970 (name "mpb")
971 (version "1.5")
972 (source (origin
973 (method url-fetch)
974 (uri
975 (string-append
976 "http://ab-initio.mit.edu/mpb/mpb-"
977 version ".tar.gz"))
978 (sha256
979 (base32
980 "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
981 (build-system gnu-build-system)
982 (arguments
983 `(#:configure-flags
984 (list (string-append "--with-libctl="
985 (assoc-ref %build-inputs "libctl")
986 "/share/libctl"))))
987 (native-inputs
988 `(("fortran" ,gfortran)
989 ("pkg-config" ,pkg-config)
990 ("swig" ,swig)))
991 (inputs
992 `(("fftw" ,fftw)
993 ("gsl" ,gsl)
994 ("guile" ,guile-2.2)
995 ("hdf5" ,hdf5)
996 ("lapack" ,lapack)
997 ("libctl" ,guile-libctl)
998 ("readline" ,readline)
999 ("zlib" ,zlib)))
1000 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1001 (synopsis "Computes band structures and electromagnetic modes of dielectric
1002 structures")
1003 (description
1004 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1005 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1006 fully-vectorial and three-dimensional methods.")
1007 (license license:gpl2+)))
1008
1009 (define-public meep
1010 (package
1011 (name "meep")
1012 (version "1.3")
1013 (source (origin
1014 (method url-fetch)
1015 (uri
1016 (string-append
1017 "http://ab-initio.mit.edu/meep/meep-"
1018 version ".tar.gz"))
1019 (sha256
1020 (base32
1021 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
1022 (build-system gnu-build-system)
1023 (arguments
1024 `(#:configure-flags
1025 (list (string-append "--with-libctl="
1026 (assoc-ref %build-inputs "libctl")
1027 "/share/libctl"))))
1028 (native-inputs
1029 `(("fortran" ,gfortran)
1030 ("pkg-config" ,pkg-config)
1031 ("swig" ,swig)))
1032 (inputs
1033 `(("fftw" ,fftw)
1034 ("gsl" ,gsl)
1035 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
1036 ("harminv" ,harminv)
1037 ("hdf5" ,hdf5)
1038 ("lapack" ,lapack)
1039 ("libctl" ,guile-libctl)
1040 ("mpb" ,mpb)
1041 ("zlib" ,zlib)))
1042 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1043 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1044 (description
1045 "Meep is a finite-difference time-domain (FDTD) simulation software package
1046 developed at MIT to model electromagnetic systems.")
1047 (license license:gpl2+)))
1048
1049 (define-public adms
1050 (package
1051 (name "adms")
1052 (version "2.3.6")
1053 (source (origin
1054 (method url-fetch)
1055 (uri
1056 (string-append
1057 "mirror://sourceforge/mot-adms/adms-source/"
1058 (version-major+minor version) "/adms-" version ".tar.gz"))
1059 (sha256
1060 (base32
1061 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1062 (build-system gnu-build-system)
1063 (native-inputs
1064 `(("flex" ,flex)
1065 ("bison" ,bison)))
1066 (home-page "https://sourceforge.net/projects/mot-adms")
1067 (synopsis "Automatic device model synthesizer")
1068 (description
1069 "ADMS is a code generator that converts electrical compact device models
1070 specified in high-level description language into ready-to-compile C code for
1071 the API of spice simulators. Based on transformations specified in XML
1072 language, ADMS transforms Verilog-AMS code into other target languages.")
1073 (license license:gpl3)))
1074
1075 (define-public capstone
1076 (package
1077 (name "capstone")
1078 (version "3.0.5-rc2")
1079 (source (origin
1080 (method url-fetch)
1081 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1082 version ".tar.gz"))
1083 (file-name (string-append name "-" version ".tar.gz"))
1084 (sha256
1085 (base32
1086 "1cqms9r2p43aiwp5spd84zaccp16ih03r7sjhrv16nddahj0jz2q"))))
1087 (build-system gnu-build-system)
1088 (arguments
1089 `(#:tests? #f
1090 #:make-flags (list (string-append "PREFIX=" %output)
1091 "CC=gcc")
1092 #:phases
1093 (modify-phases %standard-phases
1094 (delete 'configure)
1095 ;; cstool's Makefile overrides LDFLAGS, so we cannot pass it as a make flag.
1096 (add-before 'build 'fix-cstool-ldflags
1097 (lambda* (#:key outputs #:allow-other-keys)
1098 (substitute* "cstool/Makefile"
1099 (("LDFLAGS =")
1100 (string-append "LDFLAGS = -Wl,-rpath=" (assoc-ref outputs "out")
1101 "/lib")))
1102 #t)))))
1103 (home-page "http://www.capstone-engine.org")
1104 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1105 (description
1106 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1107 framework. Capstone can disassemble machine code for many supported architectures
1108 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1109 bindings for Python, Java, OCaml and more.")
1110 (license license:bsd-3)))
1111
1112 ;; FIXME: This package has a timestamp embedded in
1113 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1114 (define-public python-capstone
1115 (package
1116 (inherit capstone)
1117 (name "python-capstone")
1118 (propagated-inputs
1119 `(("capstone" ,capstone)))
1120 (build-system python-build-system)
1121 (arguments
1122 `(#:phases
1123 (modify-phases %standard-phases
1124 (add-after 'unpack 'chdir-and-fix-setup-py
1125 (lambda _
1126 (chdir "bindings/python")
1127 ;; Do not build the library again, because we already have it.
1128 (substitute* "setup.py" ((".* build_libraries.*") ""))
1129 ;; This substitution tells python-capstone where to find the
1130 ;; library.
1131 (substitute* "capstone/__init__.py"
1132 (("pkg_resources.resource_filename.*")
1133 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1134 #t)))))))
1135
1136 (define-public python2-capstone
1137 (package-with-python2 python-capstone))
1138
1139 (define-public radare2
1140 (package
1141 (name "radare2")
1142 (version "1.6.0")
1143 (source (origin
1144 (method url-fetch)
1145 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1146 name "-" version ".tar.gz"))
1147 (sha256
1148 (base32
1149 "16ggsk40zz6hyvclvqj1r4bh4hb78jf0d6ppry1jk4r0j30wm7cm"))
1150 (modules '((guix build utils)))
1151 (snippet
1152 '(begin
1153 (substitute* "libr/asm/p/Makefile"
1154 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1155 (substitute* "libr/parse/p/Makefile"
1156 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1157 (substitute* "libr/bin/p/Makefile"
1158 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1159 #t))))
1160 (build-system gnu-build-system)
1161 (arguments
1162 '(#:tests? #f; tests require git and network access
1163 #:phases
1164 (modify-phases %standard-phases
1165 (add-before 'configure 'mklibdir
1166 (lambda* (#:key inputs #:allow-other-keys)
1167 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1168 #t)))
1169 #:configure-flags
1170 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1171 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1172 #:make-flags
1173 (list "CC=gcc")))
1174 (inputs
1175 `(("openssl" ,openssl)
1176 ("zip" ,zip)
1177 ("gmp" ,gmp)
1178 ("capstone" ,capstone)))
1179 (native-inputs
1180 `(("pkg-config" ,pkg-config)))
1181 (home-page "https://radare.org/")
1182 (synopsis "Portable reversing framework")
1183 (description
1184 "Radare project started as a forensics tool, a scriptable commandline
1185 hexadecimal editor able to open disk files, but later support for analyzing
1186 binaries, disassembling code, debugging programs, attaching to remote gdb
1187 servers, ...")
1188 (license license:lgpl3)))
1189
1190 (define-public asco
1191 (package
1192 (name "asco")
1193 (version "0.4.10")
1194 (source (origin
1195 (method url-fetch)
1196 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1197 version ".tar.gz"))
1198 (sha256
1199 (base32
1200 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1201 (build-system gnu-build-system)
1202 (arguments
1203 `(#:tests? #f ; no tests
1204 #:make-flags '("all" "asco-mpi")
1205 #:phases
1206 (modify-phases %standard-phases
1207 (delete 'configure)
1208 (add-before 'build 'fix-paths
1209 (lambda* (#:key inputs #:allow-other-keys)
1210 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1211 (substitute* '("errfunc.c" "asco.c")
1212 (("cp ")
1213 (string-append coreutils "/bin/cp "))
1214 (("nice")
1215 (string-append coreutils "/bin/nice")))
1216 (substitute* "Makefile"
1217 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1218 #t)))
1219 (replace 'install ; no install target
1220 (lambda* (#:key outputs #:allow-other-keys)
1221 (for-each (lambda (file)
1222 (install-file file (string-append
1223 (assoc-ref outputs "out")
1224 "/bin")))
1225 '("asco" "asco-mpi" "asco-test"
1226 "tools/alter/alter" "tools/log/log"))
1227 #t)))))
1228 (native-inputs
1229 `(("mpi" ,openmpi)))
1230 (inputs
1231 `(("coreutils-minimal" ,coreutils-minimal)))
1232 (home-page "http://asco.sourceforge.net/")
1233 (synopsis "SPICE circuit optimizer")
1234 (description
1235 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1236 high-performance parallel differential evolution (DE) optimization algorithm.")
1237 (license license:gpl2+)))
1238
1239 (define-public libngspice
1240 ;; Note: The ngspice's build system does not allow us to build both the
1241 ;; library and the executables in one go. Thus, we have two packages.
1242 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1243 (package
1244 (name "libngspice")
1245 (version "26")
1246 (source (origin
1247 (method url-fetch)
1248 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1249 version "/ngspice-" version ".tar.gz"))
1250 (sha256
1251 (base32
1252 "02019ndcl057nq9z41nxycqba7wxlb081ibvfj9jv010nz431qji"))
1253 (modules '((guix build utils)))
1254 ;; We remove the non-free cider and build without it.
1255 (snippet
1256 '(begin
1257 (delete-file-recursively "src/ciderlib")
1258 (delete-file "src/ciderinit")
1259 (substitute* "configure"
1260 (("src/ciderlib/Makefile") "")
1261 (("src/ciderlib/input/Makefile") "")
1262 (("src/ciderlib/support/Makefile") "")
1263 (("src/ciderlib/oned/Makefile") "")
1264 (("src/ciderlib/twod/Makefile") ""))
1265 #t))))
1266 (build-system gnu-build-system)
1267 (arguments
1268 `(;; No tests for libngspice exist.
1269 ;; The transient tests for ngspice fail.
1270 #:tests? #f
1271 #:phases
1272 (modify-phases %standard-phases
1273 (add-after 'unpack 'patch-timestamps
1274 (lambda _
1275 (substitute* "configure"
1276 (("`date`") "Do 1. Jan 00:00:00 UTC 1970"))
1277 #t))
1278 (add-after 'unpack 'delete-program-manuals
1279 (lambda _
1280 (substitute* "man/man1/Makefile.in"
1281 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1282 "man_MANS = "))
1283 #t))
1284 (add-after 'install 'delete-script-files
1285 (lambda* (#:key outputs #:allow-other-keys)
1286 (delete-file-recursively
1287 (string-append (assoc-ref outputs "out")
1288 "/share/ngspice/scripts")))))
1289 #:configure-flags
1290 (list "--enable-openmp"
1291 "--enable-xspice"
1292 "--with-ngshared"
1293 "--with-readline=yes")))
1294 (native-inputs
1295 `(("bison" ,bison)
1296 ("flex" ,flex)))
1297 (inputs
1298 `(("libxaw" ,libxaw)
1299 ("mpi" ,openmpi)
1300 ("readline" ,readline)))
1301 (home-page "http://ngspice.sourceforge.net/")
1302 (synopsis "Mixed-level/mixed-signal circuit simulator")
1303 (description
1304 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1305 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1306 provides code modeling support and simulation of digital components through
1307 an embedded event driven algorithm.")
1308 (license (list license:lgpl2.0+ ; code in frontend/numparam
1309 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1310 license:public-domain)))) ; xspice
1311
1312 (define-public ngspice
1313 ;; The ngspice executables (see libngpsice above.)
1314 (package (inherit libngspice)
1315 (name "ngspice")
1316 (arguments
1317 (substitute-keyword-arguments (package-arguments libngspice)
1318 ((#:configure-flags flags)
1319 `(delete "--with-ngshared" ,flags))
1320 ((#:phases phases)
1321 `(modify-phases ,phases
1322 (add-after 'unpack 'delete-include-files
1323 (lambda _
1324 (substitute* "src/Makefile.in"
1325 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1326 "SUBDIRS = misc maths frontend spicelib"))
1327 #t))
1328 (add-after 'install 'delete-cmpp-dlmain
1329 (lambda* (#:key outputs #:allow-other-keys)
1330 (for-each (lambda (file)
1331 (delete-file
1332 (string-append (assoc-ref outputs "out")
1333 file)))
1334 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1335 #t))
1336 (delete 'delete-program-manuals)
1337 (delete 'delete-script-files)))))
1338 (inputs
1339 `(("libngspice" ,libngspice)
1340 ("readline" ,readline)))))
1341
1342 (define trilinos-serial-xyce
1343 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1344 ;; keep it private. See
1345 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1346 ;; TODO: Remove when we have modular Trilinos packages?
1347 (package
1348 (name "trilinos-serial-xyce")
1349 (version "12.6.3")
1350 (source
1351 (origin (method url-fetch)
1352 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1353 version "-Source.tar.gz"))
1354 (sha256
1355 (base32
1356 "07jd1qpsbf31cmbyyngr4l67xzwyan24dyx5wlcahgbw7x6my3wn"))))
1357 (build-system cmake-build-system)
1358 (arguments
1359 `(#:out-of-source? #t
1360 #:configure-flags
1361 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1362 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1363 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1364 "-DTrilinos_ENABLE_NOX=ON"
1365 "-DNOX_ENABLE_LOCA=ON"
1366 "-DTrilinos_ENABLE_EpetraExt=ON"
1367 "-DEpetraExt_BUILD_BTF=ON"
1368 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1369 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1370 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1371 "-DTrilinos_ENABLE_Ifpack=ON"
1372 "-DTrilinos_ENABLE_Isorropia=ON"
1373 "-DTrilinos_ENABLE_AztecOO=ON"
1374 "-DTrilinos_ENABLE_Belos=ON"
1375 "-DTrilinos_ENABLE_Teuchos=ON"
1376 "-DTeuchos_ENABLE_COMPLEX=ON"
1377 "-DTrilinos_ENABLE_Amesos=ON"
1378 "-DAmesos_ENABLE_KLU=ON"
1379 "-DAmesos_ENABLE_UMFPACK=ON"
1380 "-DTrilinos_ENABLE_Sacado=ON"
1381 "-DTrilinos_ENABLE_Kokkos=OFF"
1382 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1383 "-DTPL_ENABLE_AMD=ON"
1384 "-DTPL_ENABLE_UMFPACK=ON"
1385 "-DTPL_ENABLE_BLAS=ON"
1386 "-DTPL_ENABLE_LAPACK=ON")))
1387 (native-inputs
1388 `(("fortran" ,gfortran)
1389 ("swig" ,swig)))
1390 (inputs
1391 `(("boost" ,boost)
1392 ("lapack" ,lapack-3.5)
1393 ("suitesparse" ,suitesparse)))
1394 (home-page "https://trilinos.org")
1395 (synopsis "Engineering and scientific problems algorithms")
1396 (description
1397 "The Trilinos Project is an effort to develop algorithms and enabling
1398 technologies within an object-oriented software framework for the solution of
1399 large-scale, complex multi-physics engineering and scientific problems. A
1400 unique design feature of Trilinos is its focus on packages.")
1401 (license (list license:lgpl2.1+
1402 license:bsd-3))))
1403
1404 (define-public xyce-serial
1405 (package
1406 (name "xyce-serial")
1407 (version "6.7")
1408 (source
1409 (origin (method url-fetch)
1410 (uri (string-append "https://archive.org/download/Xyce-"
1411 version "/Xyce-" version ".tar.gz"))
1412 (sha256
1413 (base32
1414 "02k952mnvrnc5kv7r65fdrn7khwq1lbyhwyvd7jznafzdpsvgm4x"))))
1415 (build-system gnu-build-system)
1416 (arguments
1417 `(#:tests? #f
1418 #:configure-flags
1419 (list
1420 "CXXFLAGS=-O3 -std=c++11"
1421 (string-append "ARCHDIR="
1422 (assoc-ref %build-inputs "trilinos")))))
1423 (native-inputs
1424 `(("bison" ,bison)
1425 ("flex" ,flex)
1426 ("fortran" ,gfortran)))
1427 (inputs
1428 `(("fftw" ,fftw)
1429 ("suitesparse" ,suitesparse)
1430 ("lapack" ,lapack-3.5)
1431 ("trilinos" ,trilinos-serial-xyce)))
1432 (home-page "https://xyce.sandia.gov/")
1433 (synopsis "High-performance analog circuit simulator")
1434 (description
1435 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1436 capable of solving extremely large circuit problems by supporting large-scale
1437 parallel computing platforms. It also supports serial execution.")
1438 (license license:gpl3+)))
1439
1440 (define trilinos-parallel-xyce
1441 (package (inherit trilinos-serial-xyce)
1442 (name "trilinos-parallel-xyce")
1443 (arguments
1444 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1445 ((#:configure-flags flags)
1446 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1447 "-DTrilinos_ENABLE_Zoltan=ON"
1448 "-DTPL_ENABLE_MPI=ON")
1449 ,flags)))))
1450 (inputs
1451 `(("mpi" ,openmpi)
1452 ,@(package-inputs trilinos-serial-xyce)))))
1453
1454 (define-public xyce-parallel
1455 (package (inherit xyce-serial)
1456 (name "xyce-parallel")
1457 (arguments
1458 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1459 ((#:configure-flags flags)
1460 `(list "CXXFLAGS=-O3 -std=c++11"
1461 "CXX=mpiCC"
1462 "CC=mpicc"
1463 "F77=mpif77"
1464 "--enable-mpi"
1465 "--enable-isorropia=no"
1466 "--enable-zoltan=no"
1467 (string-append
1468 "ARCHDIR="
1469 (assoc-ref %build-inputs "trilinos")))))))
1470 (propagated-inputs
1471 `(("mpi" ,openmpi)))
1472 (inputs
1473 `(("trilinos" ,trilinos-parallel-xyce)
1474 ,@(alist-delete "trilinos"
1475 (package-inputs xyce-serial))))))
1476
1477 (define-public freehdl
1478 (package
1479 (name "freehdl")
1480 (version "0.0.8")
1481 (source (origin
1482 (method url-fetch)
1483 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1484 version ".tar.gz"))
1485 (sha256
1486 (base32
1487 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1488 (build-system gnu-build-system)
1489 (arguments
1490 `(#:phases
1491 (modify-phases %standard-phases
1492 (add-before 'configure 'patch-pkg-config
1493 (lambda* (#:key inputs #:allow-other-keys)
1494 (substitute* "freehdl/freehdl-config"
1495 (("pkg-config")
1496 (string-append (assoc-ref inputs "pkg-config")
1497 "/bin/pkg-config"))
1498 (("cat")
1499 (string-append (assoc-ref inputs "coreutils")
1500 "/bin/cat")))
1501 #t))
1502 (add-after 'patch-pkg-config 'setenv
1503 (lambda* (#:key inputs #:allow-other-keys)
1504 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1505 "/bin/g++"))
1506 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1507 "/bin/libtool"))
1508 #t))
1509 (add-after 'setenv 'patch-gvhdl
1510 (lambda _
1511 (substitute* "v2cc/gvhdl.in"
1512 (("--mode=link") "--mode=link --tag=CXX")
1513 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1514 #t))
1515 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1516 (lambda* (#:key inputs #:allow-other-keys)
1517 (substitute* "freehdl/freehdl-gennodes.in"
1518 (("guile")
1519 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1520 (("\\(debug") ";(debug")
1521 (("\\(@ ") "(apply-emit")
1522 (("\\(@@ ") "(apply-mini-format"))
1523 #t))
1524 (add-after 'configure 'patch-freehdl-pc
1525 (lambda* (#:key inputs #:allow-other-keys)
1526 (substitute* "freehdl.pc"
1527 (("=g\\+\\+")
1528 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1529 "/bin/g++"))
1530 (("=libtool")
1531 (string-append "=" (assoc-ref inputs "libtool")
1532 "/bin/libtool")))
1533 #t))
1534 (add-after 'install-scripts 'make-wrapper
1535 (lambda* (#:key inputs outputs #:allow-other-keys)
1536 (let ((out (assoc-ref outputs "out")))
1537 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1538 ;; file name.
1539 (wrap-program (string-append out "/bin/gvhdl")
1540 `("CPLUS_INCLUDE_PATH" ":" prefix
1541 (,(string-append (assoc-ref inputs "gcc-toolchain")
1542 "/include")))
1543 `("LIBRARY_PATH" ":" prefix
1544 (,(string-append (assoc-ref inputs "gcc-toolchain")
1545 "/lib")))
1546 `("PATH" ":" prefix
1547 (,(string-append (assoc-ref inputs "gcc-toolchain")
1548 "/bin")
1549 ,(string-append (assoc-ref inputs "coreutils")
1550 "/bin"))))
1551 (wrap-program (string-append out "/bin/freehdl-config")
1552 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1553 #t)))))
1554 (inputs
1555 `(("coreutils" ,coreutils)
1556 ("gcc-toolchain" ,gcc-toolchain)
1557 ("guile" ,guile-2.2)
1558 ("perl" ,perl)
1559 ("pkg-config" ,pkg-config)
1560 ("libtool" ,libtool)))
1561 (native-inputs
1562 `(("pkg-config-native" ,pkg-config)
1563 ("libtool-native" ,libtool)))
1564 (home-page "http://www.freehdl.seul.org/")
1565 (synopsis "VHDL simulator")
1566 (description
1567 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1568 VHDL'93 as well as VHDL'87 standards are supported.")
1569 (license (list license:gpl2+
1570 license:lgpl2.0+)))) ; freehdl's libraries
1571
1572 (define-public qucs
1573 (package
1574 (name "qucs")
1575 (version "0.0.19")
1576 (source (origin
1577 (method url-fetch)
1578 (uri
1579 (string-append
1580 "https://sourceforge.net/projects/qucs/files/qucs/" version
1581 "/qucs-" version ".tar.gz"))
1582 (sha256
1583 (base32
1584 "0giv9gfyfdizvjhq56x2pdncrlyv3k15lrsh6pk37i94vr7l7ij5"))))
1585 (build-system gnu-build-system)
1586 (arguments
1587 `(#:phases
1588 (modify-phases %standard-phases
1589 (add-before 'configure 'patch-configure
1590 (lambda* (#:key inputs #:allow-other-keys)
1591 (substitute* "qucs/configure"
1592 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1593 #t))
1594 (add-after 'patch-configure 'patch-scripts
1595 (lambda* (#:key inputs outputs #:allow-other-keys)
1596 (substitute* '("qucs/qucs/qucsdigi"
1597 "qucs/qucs/qucsdigilib"
1598 "qucs/qucs/qucsveri")
1599 (("\\$BINDIR")
1600 (string-append (assoc-ref outputs "out") "/bin"))
1601 (("freehdl-config")
1602 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1603 (("freehdl-v2cc")
1604 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1605 (("cp ")
1606 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1607 (("glibtool")
1608 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1609 (("sed")
1610 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1611 (("iverilog")
1612 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1613 (("vvp")
1614 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1615 #t))
1616 (add-before 'check 'pre-check
1617 (lambda _
1618 ;; The test suite requires a running X server.
1619 (system "Xvfb :1 &")
1620 (setenv "DISPLAY" ":1")
1621 #t))
1622 (add-after 'install 'make-wrapper
1623 (lambda* (#:key inputs outputs #:allow-other-keys)
1624 (let ((out (assoc-ref outputs "out")))
1625 ;; 'qucs' directly invokes gcc, hence this wrapping.
1626 (wrap-program (string-append out "/bin/qucs")
1627 `("CPLUS_INCLUDE_PATH" ":" prefix
1628 (,(string-append (assoc-ref inputs "gcc-toolchain")
1629 "/include")))
1630 `("PATH" ":" prefix
1631 (,(string-append (assoc-ref inputs "gcc-toolchain")
1632 "/bin")))
1633 `("LIBRARY_PATH" ":" prefix
1634 (,(string-append (assoc-ref inputs "gcc-toolchain")
1635 "/lib")))
1636 `("ADMSXMLBINDIR" ":" prefix
1637 (,(string-append (assoc-ref inputs "adms") "/bin")))
1638 `("ASCOBINDIR" ":" prefix
1639 (,(string-append (assoc-ref inputs "asco") "/bin")))
1640 `("QUCS_OCTAVE" ":" prefix
1641 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1642 #t)))
1643 #:parallel-build? #f ; race condition
1644 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1645 (native-inputs
1646 `(("gperf" ,gperf)
1647 ("libtool-native" ,libtool)
1648 ("python" ,python-2) ; for tests
1649 ("matplotlib" ,python2-matplotlib) ; for tests
1650 ("numpy" ,python2-numpy) ; for tests
1651 ("xorg-server" ,xorg-server))) ; for tests
1652 (inputs
1653 `(("adms" ,adms)
1654 ("asco" ,asco)
1655 ("coreutils" ,coreutils)
1656 ("freehdl" ,freehdl)
1657 ("gcc-toolchain" ,gcc-toolchain)
1658 ("iverilog" ,iverilog)
1659 ("libtool" ,libtool)
1660 ("octave" ,octave)
1661 ("qt4" ,qt-4)
1662 ("sed" ,sed)))
1663 (home-page "http://qucs.sourceforge.net/")
1664 (synopsis "Circuit simulator with graphical user interface")
1665 (description
1666 "Qucs is a circuit simulator with graphical user interface. The software
1667 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1668 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1669 simulations are also supported.")
1670 (license license:gpl2+)))
1671
1672 (define-public qucs-s
1673 (package
1674 (name "qucs-s")
1675 (version "0.0.19S")
1676 (source (origin
1677 (method url-fetch)
1678 (uri (string-append "https://github.com/ra3xdh/qucs/releases/download/"
1679 version "/qucs-" version ".tar.gz"))
1680 (sha256
1681 (base32
1682 "1bhahvdqmayaw0306fxz1ghmjhd4fq05yk3rk7zi0z703w5imgjv"))))
1683 (build-system cmake-build-system)
1684 (arguments
1685 `(#:tests? #f ; no tests
1686 #:phases
1687 (modify-phases %standard-phases
1688 (add-before 'configure 'patch-scripts
1689 (lambda* (#:key inputs #:allow-other-keys)
1690 (substitute* '("qucs/qucsdigi"
1691 "qucs/qucsdigilib"
1692 "qucs/qucsveri")
1693 (("\\$BINDIR")
1694 (string-append (assoc-ref inputs "qucs") "/bin"))
1695 (("freehdl-config")
1696 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1697 (("freehdl-v2cc")
1698 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1699 (("cp ")
1700 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1701 (("glibtool")
1702 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1703 (("sed")
1704 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1705 (("iverilog")
1706 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1707 (("vvp")
1708 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1709 #t))
1710 (add-after 'patch-scripts 'patch-paths
1711 (lambda* (#:key inputs #:allow-other-keys)
1712 (substitute* "qucs/main.cpp"
1713 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1714 "\\+ \"qucsator\" \\+ executableSuffix"))
1715 (string-append "}{ QucsSettings.Qucsator = \""
1716 (assoc-ref inputs "qucs") "/bin/qucsator\""))
1717 (((string-append "else QucsSettings\\.XyceExecutable = "
1718 "\"/usr/local/Xyce-Release-6.2.0-OPENSOURCE/bin/runxyce"))
1719 (string-append "QucsSettings.XyceExecutable = \""
1720 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1721 (((string-append "else QucsSettings\\.XyceParExecutable = \"/usr/local"
1722 "/Xyce-Release-6.2.0-OPENMPI-OPENSOURCE/bin/xmpirun"))
1723 (string-append "QucsSettings.XyceParExecutable = \""
1724 (assoc-ref inputs "mpi") "/bin/mpirun"))
1725 (("%p")
1726 (string-append "%p "(assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1727 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1728 (string-append "QucsSettings.NgspiceExecutable = " "\""
1729 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1730 (substitute* "qucs/qucs_actions.cpp"
1731 (("qucstrans")
1732 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1733 (("qucsattenuator")
1734 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1735 (("qucsrescodes")
1736 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1737 #t))
1738 (add-after 'install 'install-scripts
1739 (lambda* (#:key inputs outputs #:allow-other-keys)
1740 (for-each
1741 (lambda (script)
1742 (let ((file (string-append "../qucs-" ,version
1743 "/qucs/" script))
1744 (out (assoc-ref outputs "out")))
1745 (install-file file (string-append out "/bin"))
1746 (chmod (string-append out "/bin/" script) #o555)))
1747 '("qucsdigi" "qucsdigilib" "qucsveri"))
1748 #t))
1749 (add-after 'install-scripts 'make-wrapper
1750 (lambda* (#:key inputs outputs #:allow-other-keys)
1751 (let* ((out (assoc-ref outputs "out"))
1752 (file (string-append out "/bin/qucs-s"))
1753 (qucs (assoc-ref inputs "qucs"))
1754 (qucsator (string-append qucs "/bin/qucsator")))
1755 (wrap-program file
1756 `("CPLUS_INCLUDE_PATH" ":" prefix
1757 (,(string-append (assoc-ref inputs "gcc-toolchain")
1758 "/include")))
1759 `("PATH" ":" prefix
1760 (,(string-append (assoc-ref inputs "gcc-toolchain")
1761 "/bin")))
1762 `("LIBRARY_PATH" ":" prefix
1763 (,(string-append (assoc-ref inputs "gcc-toolchain")
1764 "/lib")))
1765 `("QUCSATOR" ":" prefix (,qucsator))
1766 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1767 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1768 "/bin")))
1769 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1770 "/bin")))
1771 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1772 "/bin/octave"))))
1773 (symlink qucsator (string-append out "/bin/qucsator"))
1774 #t))))))
1775 (native-inputs
1776 `(("libtool-native" ,libtool)))
1777 (inputs
1778 `(("adms" ,adms)
1779 ("asco" ,asco)
1780 ("coreutils" ,coreutils)
1781 ("freehdl" ,freehdl)
1782 ("gcc-toolchain" ,gcc-toolchain)
1783 ("iverilog" ,iverilog)
1784 ("libtool" ,libtool)
1785 ("mpi" ,openmpi)
1786 ("ngspice" ,ngspice)
1787 ("octave" ,octave)
1788 ("qt4" ,qt-4)
1789 ("qucs" ,qucs)
1790 ("sed" ,sed)
1791 ("xyce-serial" ,xyce-serial)
1792 ("xyce-parallel" ,xyce-parallel)))
1793 (home-page "https://ra3xdh.github.io/")
1794 (synopsis "Circuit simulator with graphical user interface")
1795 (description
1796 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1797 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1798 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1799 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1800 (license license:gpl2+)))