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