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