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