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