gnu: nnn: Don't use NAME in source URI.
[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 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
11 ;;; Copyright © 2018 Jonathan Brielmaier <jonathan.brielmaier@web.de>
12 ;;; 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 cmake)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system python)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages algebra)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages base)
47 #:use-module (gnu packages bison)
48 #:use-module (gnu packages boost)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages commencement)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages curl)
53 #:use-module (gnu packages flex)
54 #:use-module (gnu packages fontutils)
55 #:use-module (gnu packages fpga)
56 #:use-module (gnu packages freedesktop)
57 #:use-module (gnu packages gcc)
58 #:use-module (gnu packages gd)
59 #:use-module (gnu packages gettext)
60 #:use-module (gnu packages ghostscript)
61 #:use-module (gnu packages gl)
62 #:use-module (gnu packages glib)
63 #:use-module (gnu packages gnome)
64 #:use-module (gnu packages gperf)
65 #:use-module (gnu packages groff)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages guile)
68 #:use-module (gnu packages image)
69 #:use-module (gnu packages imagemagick)
70 #:use-module (gnu packages linux) ;FIXME: for pcb
71 #:use-module (gnu packages m4)
72 #:use-module (gnu packages maths)
73 #:use-module (gnu packages multiprecision)
74 #:use-module (gnu packages mpi)
75 #:use-module (gnu packages ncurses)
76 #:use-module (gnu packages perl)
77 #:use-module (gnu packages pkg-config)
78 #:use-module (gnu packages python)
79 #:use-module (gnu packages python-xyz)
80 #:use-module (gnu packages qt)
81 #:use-module (gnu packages readline)
82 #:use-module (gnu packages swig)
83 #:use-module (gnu packages tcl)
84 #:use-module (gnu packages texinfo)
85 #:use-module (gnu packages tls)
86 #:use-module (gnu packages tex)
87 #:use-module (gnu packages wxwidgets)
88 #:use-module (gnu packages xorg))
89
90 (define-public librecad
91 (package
92 (name "librecad")
93 (version "2.1.3")
94 (source (origin
95 (method url-fetch)
96 (uri (string-append
97 "https://github.com/LibreCAD/LibreCAD/archive/"
98 version ".tar.gz"))
99 (file-name (string-append name "-" version ".tar.gz"))
100 (sha256
101 (base32
102 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
103 (build-system gnu-build-system)
104 (arguments
105 '(#:phases
106 (modify-phases %standard-phases
107 ;; Without this patch boost complains that "make_array" is not a
108 ;; member of "boost::serialization".
109 (add-after 'unpack 'patch-boost-error
110 (lambda _
111 (substitute* "librecad/src/lib/math/lc_quadratic.h"
112 (("#include \"rs_vector.h\"" line)
113 (string-append line
114 "\n#include <boost/serialization/array_wrapper.hpp>")))
115 (substitute* "librecad/src/lib/math/rs_math.cpp"
116 (("#include <boost/numeric/ublas/matrix.hpp>" line)
117 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
118 line)))
119 #t))
120 ;; Fix build against Qt 5.11.
121 (add-after 'unpack 'add-missing-headers
122 (lambda _
123 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
124 (("#include <QPushButton>") "#include <QPushButton>
125 #include <QActionGroup>"))
126 #t))
127 (add-after 'unpack 'patch-paths
128 (lambda* (#:key outputs #:allow-other-keys)
129 (let ((out (assoc-ref outputs "out")))
130 (substitute* "librecad/src/lib/engine/rs_system.cpp"
131 (("/usr/share") (string-append out "/share"))))))
132 (replace 'configure
133 (lambda* (#:key inputs #:allow-other-keys)
134 (system* "qmake" (string-append "BOOST_DIR="
135 (assoc-ref inputs "boost")))))
136 (replace 'install
137 (lambda* (#:key outputs #:allow-other-keys)
138 (let* ((out (assoc-ref outputs "out"))
139 (bin (string-append out "/bin"))
140 (share (string-append out "/share/librecad")))
141 (mkdir-p bin)
142 (install-file "unix/librecad" bin)
143 (mkdir-p share)
144 (copy-recursively "unix/resources" share))
145 #t))
146 ;; Ensure that icons are found at runtime
147 (add-after 'install 'wrap-executable
148 (lambda* (#:key inputs outputs #:allow-other-keys)
149 (let* ((out (assoc-ref outputs "out"))
150 (qt '("qtbase" "qtsvg")))
151 (wrap-program (string-append out "/bin/librecad")
152 `("QT_PLUGIN_PATH" ":" prefix
153 ,(map (lambda (label)
154 (string-append (assoc-ref inputs label)
155 "/lib/qt5/plugins/"))
156 qt)))
157 #t))))))
158 (inputs
159 `(("boost" ,boost)
160 ("muparser" ,muparser)
161 ("freetype" ,freetype)
162 ("qtbase" ,qtbase)
163 ("qtsvg" ,qtsvg)))
164 (native-inputs
165 `(("pkg-config" ,pkg-config)
166 ("which" ,which)))
167 (home-page "http://librecad.org/")
168 (synopsis "Computer-aided design (CAD) application")
169 (description
170 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
171 plans and designs.")
172 (license license:gpl2)))
173
174 (define-public geda-gaf
175 (package
176 (name "geda-gaf")
177 (version "1.9.2")
178 (source (origin
179 (method url-fetch)
180 (uri (string-append
181 "http://ftp.geda-project.org/geda-gaf/unstable/v"
182 (version-major+minor version) "/"
183 version "/geda-gaf-" version ".tar.gz"))
184 (sha256
185 (base32
186 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
187 (build-system gnu-build-system)
188 (arguments
189 '(#:phases
190 (modify-phases %standard-phases
191 ;; tests require a writable HOME
192 (add-before 'check 'set-home
193 (lambda _
194 (setenv "HOME" (getenv "TMPDIR"))
195 #t))
196 ;; FIXME: These two tests fail for unknown reasons. They return "2"
197 ;; when they should return "1".
198 (add-after 'unpack 'disable-failing-tests
199 (lambda _
200 (substitute* "utils/tests/gxyrs/tests.list"
201 (("^do_nothing.*") ""))
202 #t)))
203 #:configure-flags
204 (let ((pcb (assoc-ref %build-inputs "pcb")))
205 (list (string-append "--with-pcb-datadir=" pcb "/share")
206 (string-append "--with-pcb-lib-path="
207 pcb "/share/pcb/pcblib-newlib:"
208 pcb "/share/pcb/newlib")))))
209 (inputs
210 `(("glib" ,glib)
211 ("gtk" ,gtk+-2)
212 ("guile" ,guile-2.0)
213 ("desktop-file-utils" ,desktop-file-utils)
214 ("shared-mime-info" ,shared-mime-info)
215 ("m4" ,m4)
216 ("pcb" ,pcb)))
217 (native-inputs
218 `(("pkg-config" ,pkg-config)
219 ("perl" ,perl))) ; for tests
220 (home-page "http://geda-project.org/")
221 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
222 (description
223 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
224 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
225 which currently includes: gschem, a schematic capture program; gnetlist, a
226 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
227 gattrib, a spreadsheet programm that manipulates the properties of symbols of
228 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
229 tool to forward annotation from your schematic to layout using PCB; some minor
230 utilities.")
231 (license license:gpl2+)))
232
233 (define-public lepton-eda
234 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
235 ;; keep and to extend Guile support.
236 (package
237 (inherit geda-gaf)
238 (name "lepton-eda")
239 (version "1.9.5-20180820")
240 (home-page "https://github.com/lepton-eda/lepton-eda")
241 (source (origin
242 (method git-fetch)
243 (uri (git-reference (url home-page) (commit version)))
244 (sha256
245 (base32
246 "1ayaccvw18zh4g7a4x5jf6yxkphi5xafb0hpc732g59qkgwfcmlr"))
247 (file-name (git-file-name name version))))
248 (native-inputs
249 `(("autoconf" ,autoconf)
250 ("automake" ,automake)
251 ("libtool" ,libtool)
252 ("gettext" ,gnu-gettext)
253 ("texinfo" ,texinfo)
254 ("groff" ,groff)
255 ("which" ,which)
256 ,@(package-native-inputs geda-gaf)))
257 ;; For now it's Guile 2.0, not 2.2.
258 (arguments
259 (substitute-keyword-arguments (package-arguments geda-gaf)
260 ((#:configure-flags flags ''())
261 ;; When running "make", the POT files are built with the build time as
262 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
263 ;; files were updated and goes on to run "msgmerge"; as a result, the
264 ;; non-deterministic POT-Creation-Date finds its way into .po files,
265 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
266 ;; never runs. See <https://bugs.debian.org/792687>.
267 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
268 ((#:phases phases '%standard-phases)
269 `(modify-phases ,phases
270 (add-before 'bootstrap 'prepare
271 (lambda _
272 ;; Some of the scripts there are invoked by autogen.sh.
273 (for-each patch-shebang (find-files "build-tools"))
274
275 ;; Make sure 'msgmerge' can modify the PO files.
276 (for-each (lambda (po)
277 (chmod po #o666))
278 (find-files "." "\\.po$"))
279
280 ;; This would normally be created by invoking 'git', but it
281 ;; doesn't work here.
282 (call-with-output-file "version.h"
283 (lambda (port)
284 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
285 ,(string-drop version
286 (+ 1 (string-index version #\-))))
287 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
288 ,(string-take version
289 (string-index version #\-)))
290 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
291 #t))))))
292 (description
293 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
294 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
295 design, schematic capture, simulation, prototyping, and production. Lepton
296 EDA includes tools for schematic capture, attribute management, bill of
297 materials (BOM) generation, netlisting into over 20 netlist formats, analog
298 and digital simulation, and printed circuit board (PCB) layout, and many other
299 features.")))
300
301 (define-public pcb
302 (package
303 (name "pcb")
304 (version "4.0.2")
305 (source (origin
306 (method url-fetch)
307 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
308 "/pcb-" version ".tar.gz"))
309 (sha256
310 (base32
311 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
312 (build-system gnu-build-system)
313 (arguments
314 `(#:phases
315 (modify-phases %standard-phases
316 (add-after 'unpack 'use-wish8.6
317 (lambda _
318 (substitute* "configure"
319 (("wish85") "wish8.6"))
320 #t))
321 ;; It checks for "xhost", which we don't have. This shouldn't
322 ;; matter, because the test is supposed to be skipped, but it causes
323 ;; "run_tests.sh" (and thus the "check" phase) to fail.
324 (add-after 'unpack 'fix-check-for-display
325 (lambda _
326 (substitute* "tests/run_tests.sh"
327 (("have_display=no") "have_display=yes"))
328 #t))
329 (add-after 'install 'wrap
330 (lambda* (#:key inputs outputs #:allow-other-keys)
331 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
332 ;; fix of the mesa package we wrap the pcb executable such that
333 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
334 (let* ((out (assoc-ref outputs "out"))
335 (path (string-append (assoc-ref inputs "udev") "/lib")))
336 (wrap-program (string-append out "/bin/pcb")
337 `("LD_LIBRARY_PATH" ":" prefix (,path))))
338 #t))
339 (add-before 'check 'pre-check
340 (lambda _
341 (system "Xvfb :1 &")
342 (setenv "DISPLAY" ":1")
343 #t)))))
344 (inputs
345 `(("dbus" ,dbus)
346 ("mesa" ,mesa)
347 ("udev" ,eudev) ;FIXME: required by mesa
348 ("glu" ,glu)
349 ("gd" ,gd)
350 ("gtk" ,gtk+-2)
351 ("gtkglext" ,gtkglext)
352 ("desktop-file-utils" ,desktop-file-utils)
353 ("shared-mime-info" ,shared-mime-info)
354 ("tk" ,tk)))
355 (native-inputs
356 `(("pkg-config" ,pkg-config)
357 ("intltool" ,intltool)
358 ("bison" ,bison)
359 ("flex" ,flex)
360 ;; For tests
361 ("imagemagick" ,imagemagick)
362 ("gerbv" ,gerbv)
363 ("ghostscript" ,ghostscript)
364 ("xvfb" ,xorg-server)))
365 (home-page "http://pcb.geda-project.org/")
366 (synopsis "Design printed circuit board layouts")
367 (description
368 "GNU PCB is an interactive tool for editing printed circuit board
369 layouts. It features a rats-nest implementation, schematic/netlist import,
370 and design rule checking. It also includes an autorouter and a trace
371 optimizer; and it can produce photorealistic and design review images.")
372 (license license:gpl2+)))
373
374 (define-public pcb-rnd
375 (package (inherit pcb)
376 (name "pcb-rnd")
377 (version "1.1.3")
378 (source (origin
379 (method url-fetch)
380 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
381 "pcb-rnd-" version ".tar.gz"))
382 (sha256
383 (base32
384 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
385 (arguments
386 `(#:tests? #f ; no check target
387 #:phases
388 (modify-phases %standard-phases
389 (add-after 'unpack 'cc-is-gcc
390 (lambda _ (setenv "CC" "gcc") #t))
391 (replace 'configure
392 ;; The configure script doesn't tolerate most of our configure flags.
393 (lambda* (#:key outputs #:allow-other-keys)
394 (invoke "sh" "configure"
395 (string-append "--prefix="
396 (assoc-ref outputs "out"))))))))
397 (home-page "http://repo.hu/projects/pcb-rnd/")
398 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
399 featuring various improvements and bug fixes.")))
400
401 (define-public fastcap
402 (package
403 (name "fastcap")
404 (version "2.0-18Sep92")
405 (source (origin
406 (method url-fetch/tarbomb)
407 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
408 name "-" version ".tgz"))
409 (sha256
410 (base32
411 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
412 (snippet
413 ;; Remove a non-free file.
414 '(begin
415 (delete-file "doc/psfig.sty")
416 #t))
417 (patches (search-patches "fastcap-mulSetup.patch"
418 "fastcap-mulGlobal.patch"))))
419 (build-system gnu-build-system)
420 (native-inputs
421 ;; FIXME: with texlive-tiny citation references are rendered as question
422 ;; marks. During the build warnings like these are printed:
423 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
424 `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts)))
425 ("ghostscript" ,ghostscript)))
426 (arguments
427 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
428 #:parallel-build? #f
429 #:tests? #f ;; no tests-suite
430 #:modules ((srfi srfi-1)
431 ,@%gnu-build-system-modules)
432 #:phases
433 (modify-phases %standard-phases
434 (add-after 'build 'make-doc
435 (lambda _
436 (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
437 (add-before 'make-doc 'fix-doc
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))
467 (delete 'configure)
468 (add-before 'install 'clean-bin
469 (lambda _
470 (delete-file (string-append (getcwd) "/bin/README"))
471 #t))
472 (add-before 'install 'make-pdf
473 (lambda _
474 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
475 (with-directory-excursion "doc"
476 (and
477 (for-each (lambda (file)
478 (invoke "dvips" file "-o"))
479 (find-files "." "\\.dvi"))
480 (for-each (lambda (file)
481 (invoke "ps2pdf" file))
482 '("mtt.ps" "ug.ps" "tcad.ps"))
483 (invoke "make" "clean")))))
484 (replace 'install
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))))))
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
502 multipole-accelerated algorithm.")
503 (license (license:non-copyleft #f "See fastcap.c."))))
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"))
517 (patches (search-patches "fasthenry-spAllocate.patch"
518 "fasthenry-spBuild.patch"
519 "fasthenry-spUtils.patch"
520 "fasthenry-spSolve.patch"
521 "fasthenry-spFactor.patch"))))
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"
540 (for-each (lambda (f)
541 (install-file f bin))
542 (find-files "." ".*")))
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
550 multipole-accelerated algorithm.")
551 (license (license:non-copyleft #f "See induct.c."))))
552
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
564 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
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
579 `(("qtbase" ,qtbase)
580 ("qtserialport" ,qtserialport)
581 ("qtsvg" ,qtsvg)
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)
597 software with a low entry barrier, suited for the needs of makers and
598 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
599 library with many commonly used high-level components. Fritzing makes it very
600 easy to communicate about circuits, as well as to turn them into PCB layouts
601 ready 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
606 (define-public gerbv
607 (package
608 (name "gerbv")
609 (version "2.6.2")
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
616 "1cw8k6ni0q8kswad03kha86fk7n06vq8p0wzsfhcnalsdshrn17i"))))
617 (build-system gnu-build-system)
618 (native-inputs
619 `(("pkg-config" ,pkg-config)))
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
628 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
629 you load several files on top of each other, do measurements on the displayed
630 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
631 as well as pick-place files.")
632 (license license:gpl2+)))
633
634 (define-public libfive
635 (let ((commit "9d857d1923abecb0e5935b9287d22661f6efaac5")
636 (revision "2"))
637 (package
638 (name "libfive")
639 (version (git-version "0" revision commit))
640 (source (origin
641 (method git-fetch)
642 (uri (git-reference
643 (url "https://github.com/libfive/libfive")
644 (commit commit)))
645 (sha256
646 (base32
647 "1r40kyx30wz31cwwlfvfh7fgqkxq3n8dxhswpi9qpf4r5h3l8wsn"))
648 (file-name (git-file-name name version))
649 (snippet
650 ;; Remove bundled catch since we provide our own.
651 '(begin
652 (delete-file "libfive/test/catch.hpp")
653 #t))))
654 (build-system cmake-build-system)
655 (arguments
656 `(#:test-target "libfive-test"
657 #:phases
658 (modify-phases %standard-phases
659 (add-after 'unpack 'remove-native-compilation
660 (lambda _
661 (substitute* "CMakeLists.txt" (("-march=native") ""))
662 #t)))))
663 (native-inputs
664 `(("pkg-config" ,pkg-config)))
665 (inputs
666 `(("boost" ,boost)
667 ("catch" ,catch-framework)
668 ("libpng" ,libpng)
669 ("qtbase" ,qtbase)
670 ("eigen" ,eigen)
671 ("guile" ,guile-2.2)))
672 (home-page "https://libfive.com")
673 (synopsis "Tool for programmatic computer-aided design")
674 (description
675 "Libfive is a tool for programmatic computer-aided design (CAD). In
676 libfive, solid models are defined as Scheme scripts, and there are no opaque
677 function calls into the geometry kernel: everything is visible to the user.
678 Even fundamental, primitive shapes are represented as code in the user-level
679 language.")
680 (license (list license:lgpl2.1+ ;library
681 license:gpl2+))))) ;Guile bindings and GUI
682
683 (define-public ao
684 (deprecated-package "ao-cad" libfive))
685
686 (define-public kicad
687 (package
688 (name "kicad")
689 (version "5.0.0")
690 (source
691 (origin
692 (method url-fetch)
693 (file-name (string-append name "-" version ".tar.xz"))
694 (uri (string-append
695 "https://launchpad.net/kicad/" (version-major+minor version)
696 "/" version "/+download/" name "-" version ".tar.xz"))
697 (sha256
698 (base32 "17nqjszyvd25wi6550j981whlnb1wxzmlanljdjihiki53j84x9p"))))
699 (build-system cmake-build-system)
700 (arguments
701 `(#:out-of-source? #t
702 #:tests? #f ; no tests
703 #:build-type "Release"
704 #:configure-flags
705 (list "-DKICAD_STABLE_VERSION=ON"
706 "-DKICAD_REPO_NAME=stable"
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")
715 "/include/wx-"
716 ,(version-major+minor
717 (package-version python2-wxpython)))
718 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
719 "-DKICAD_SPICE=TRUE"
720 ;; TODO: Enable this when CA certs are working with curl.
721 "-DBUILD_GITHUB_PLUGIN=OFF")
722 #:phases
723 (modify-phases %standard-phases
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))
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
739 "/lib/python"
740 ,(version-major+minor
741 (package-version python))
742 "/site-packages:"
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)
762 ("libngspice" ,libngspice)
763 ("libsm" ,libsm)
764 ("mesa" ,mesa)
765 ("opencascade-oce" ,opencascade-oce)
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
773 boards and electrical circuits. The software has a number of programs that
774 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
775 electrical diagrams), gerbview (viewing Gerber files) and others.")
776 (license license:gpl3+)))
777
778 (define-public kicad-library
779 (let ((version "4.0.7"))
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
790 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
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)
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")))
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")))))
823 ;; Kicad distributes footprints in a separate tarball.
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
833 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
834 (home-page "http://kicad-pcb.org/")
835 (synopsis "Libraries for kicad")
836 (description "This package provides Kicad component, footprint and 3D
837 render model libraries.")
838 (license license:lgpl2.0+))))
839
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
859 libraries 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
864 (define-public linsmith
865 (package
866 (name "linsmith")
867 (version "0.99.31")
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
875 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
876 (build-system gnu-build-system)
877 (native-inputs
878 `(("pkg-config" ,pkg-config)
879 ("gtk" ,gtk+-2)
880 ("libgnome" ,libgnomeui)))
881 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
882 (synopsis "Smith Charting program")
883 (description "LinSmith is a Smith Charting program, mainly designed for
884 educational use. As such, there is an emphasis on capabilities that improve
885 the 'showing the effect of'-style of operation.")
886 (license license:gpl2+)))
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
904 `(("python-2" ,python-2)
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
910 for mathematical functions. It also provides an machine-independent
911 interface to select the best such procedures to use on a given system.")
912 (license license:gpl3+)))
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+)))
942
943 (define-public harminv
944 (package
945 (name "harminv")
946 (version "1.4.1")
947 (source (origin
948 (method url-fetch)
949 (uri
950 (string-append "https://github.com/stevengj/harminv/"
951 "releases/download/v" version "/"
952 name "-" version ".tar.gz"))
953 (sha256
954 (base32
955 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
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)))
970 (home-page "https://github.com/stevengj/harminv")
971 (synopsis "Harmonic inversion solver")
972 (description
973 "Harminv is a free program (and accompanying library) to solve the problem of
974 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
975 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
976 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
977 (license license:gpl2+)))
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
1001 for scientific simulations.")
1002 (license license:gpl2+)))
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
1038 structures")
1039 (description
1040 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1041 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1042 fully-vectorial and three-dimensional methods.")
1043 (license license:gpl2+)))
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)
1071 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
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
1082 developed at MIT to model electromagnetic systems.")
1083 (license license:gpl2+)))
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
1106 specified in high-level description language into ready-to-compile C code for
1107 the API of spice simulators. Based on transformations specified in XML
1108 language, ADMS transforms Verilog-AMS code into other target languages.")
1109 (license license:gpl3)))
1110
1111 (define-public capstone
1112 (package
1113 (name "capstone")
1114 (version "3.0.5")
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
1122 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
1123 (build-system gnu-build-system)
1124 (arguments
1125 `(#:tests? #f
1126 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1127 "CC=gcc")
1128 #:phases
1129 (modify-phases %standard-phases
1130 (delete 'configure) ; no configure script
1131 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1132 (add-before 'build 'fix-cstool-ldflags
1133 (lambda* (#:key outputs #:allow-other-keys)
1134 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1135 (assoc-ref outputs "out") "/lib"))
1136 #t)))))
1137 (home-page "https://www.capstone-engine.org")
1138 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1139 (description
1140 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1141 framework. Capstone can disassemble machine code for many supported architectures
1142 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1143 bindings for Python, Java, OCaml and more.")
1144 (license license:bsd-3)))
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))
1172
1173 (define-public radare2
1174 (package
1175 (name "radare2")
1176 (version "2.5.0")
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
1183 "17h4ba5qqahfi8mi4x2dcvq87cqpir5v2dlaqbvmay6vby4zh4v7"))
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"
1192 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1193 #t))))
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
1219 hexadecimal editor able to open disk files, but later support for analyzing
1220 binaries, disassembling code, debugging programs, attaching to remote gdb
1221 servers, ...")
1222 (license license:lgpl3)))
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
1270 high-performance parallel differential evolution (DE) optimization algorithm.")
1271 (license license:gpl2+)))
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")
1279 (version "28")
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
1286 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
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") "")
1298 (("src/ciderlib/twod/Makefile") ""))
1299 #t))))
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"
1310 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
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
1340 provides code modeling support and simulation of digital components through
1341 an 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)))))
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")
1383 (version "12.12.1")
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
1390 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1391 (build-system cmake-build-system)
1392 (arguments
1393 `(#:out-of-source? #t
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)))
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)
1436 ("lapack" ,lapack)
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
1442 technologies within an object-oriented software framework for the solution of
1443 large-scale, complex multi-physics engineering and scientific problems. A
1444 unique 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")
1451 (version "6.8")
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
1458 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
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)
1474 ("lapack" ,lapack)
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,
1480 capable of solving extremely large circuit problems by supporting large-scale
1481 parallel computing platforms. It also supports serial execution.")
1482 (license license:gpl3+)))
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"
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))))))
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))
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))
1566 (add-after 'configure 'patch-freehdl-pc
1567 (lambda* (#:key inputs #:allow-other-keys)
1568 (substitute* "freehdl.pc"
1569 (("=g\\+\\+")
1570 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1571 "/bin/g++"))
1572 (("=libtool")
1573 (string-append "=" (assoc-ref inputs "libtool")
1574 "/bin/libtool")))
1575 #t))
1576 (add-after 'install-scripts 'make-wrapper
1577 (lambda* (#:key inputs outputs #:allow-other-keys)
1578 (let ((out (assoc-ref outputs "out")))
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"))))
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)
1598 ("gcc-toolchain" ,gcc-toolchain)
1599 ("guile" ,guile-2.2)
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
1614 (define-public qucs
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
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))
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)
1719 ("octave" ,octave-cli)
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
1726 aims to support all kinds of circuit simulation types---e.g. DC, AC,
1727 S-parameter, transient, noise and harmonic balance analysis. Pure digital
1728 simulations are also supported.")
1729 (license license:gpl2+))))
1730
1731 (define-public qucs-s
1732 (package
1733 (name "qucs-s")
1734 (version "0.0.20")
1735 (source (origin
1736 (method url-fetch)
1737 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1738 version ".tar.gz"))
1739 (file-name (string-append name "-" version ".tar.gz"))
1740 (sha256
1741 (base32
1742 "01dizf4rjciqc8x7bmv3kbhdlz90bm6n9m9fz7dbzqcwvszcs1hx"))))
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\""))
1777 (((string-append "QucsSettings\\.XyceExecutable = "
1778 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1779 (string-append "}{ QucsSettings.XyceExecutable = \""
1780 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
1781 (((string-append "else QucsSettings\\.XyceParExecutable = "
1782 "\"mpirun -np %p /usr/local"
1783 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
1784 (string-append "QucsSettings.XyceParExecutable = \""
1785 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1786 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
1787 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1788 (string-append "QucsSettings.NgspiceExecutable = " "\""
1789 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
1790 (substitute* "qucs/extsimkernels/ngspice.cpp"
1791 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
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)
1804 (let ((file (string-append "../qucs_s-" ,version
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)
1849 ("octave" ,octave-cli)
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.
1859 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1860 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1861 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1862 (license license:gpl2+)))
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)
1900 software to develop printed circuit boards. It features human readable file
1901 formats and complete project management with library, schematic and board
1902 editors.")
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
1915
1916 (define-public gpx
1917 (package
1918 (name "gpx")
1919 (version "2.5.2")
1920 (source (origin
1921 (method git-fetch)
1922 (uri (git-reference
1923 (url "https://github.com/markwal/GPX.git")
1924 (commit version)))
1925 (sha256
1926 (base32
1927 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
1928 (build-system gnu-build-system)
1929 (home-page "https://github.com/markwal/GPX")
1930 (synopsis "Converting gcode to x3g files for 3D printing")
1931 (description
1932 "GPX is a post processing utility for converting gcode output from 3D
1933 slicing software to x3g files for standalone 3D printing on common 3D
1934 printers.")
1935 (license license:gpl2+)))