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