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