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