gnu: Add gamin.
[jackhill/guix/guix.git] / gnu / packages / engineering.scm
CommitLineData
ffb010b5 1;;; GNU Guix --- Functional package management for GNU
a8416e69 2;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
93094501 3;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
917f5ee7 4;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
0de98139 5;;; Copyright © 2016 David Thompson <davet@gnu.org>
8d564b8b 6;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
4f12a62d 7;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <theodoros@foradis.org>
6febda94 8;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
0b2db013 9;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
7c1445f8 10;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
1618c6fe 11;;; Copyright © 2018, 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
356b32b9 12;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
6f8ade6e 13;;; Copyright © 2019 Tim Stahel <swedneck@swedneck.xyz>
5cded306 14;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
2c0040ae 15;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
2895a87f 16;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
ffb010b5
RW
17;;;
18;;; This file is part of GNU Guix.
19;;;
20;;; GNU Guix is free software; you can redistribute it and/or modify it
21;;; under the terms of the GNU General Public License as published by
22;;; the Free Software Foundation; either version 3 of the License, or (at
23;;; your option) any later version.
24;;;
25;;; GNU Guix is distributed in the hope that it will be useful, but
26;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28;;; GNU General Public License for more details.
29;;;
30;;; You should have received a copy of the GNU General Public License
31;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
40fbd52a 33(define-module (gnu packages engineering)
ffb010b5
RW
34 #:use-module (guix packages)
35 #:use-module (guix download)
93094501 36 #:use-module (guix gexp)
ffb010b5 37 #:use-module (guix git-download)
93094501
FB
38 #:use-module (guix monads)
39 #:use-module (guix store)
412726ee 40 #:use-module (guix utils)
91cabd3e 41 #:use-module ((srfi srfi-1) #:hide (zip))
ffb010b5 42 #:use-module ((guix licenses) #:prefix license:)
847768b9 43 #:use-module (guix build-system ant)
befc9ff6 44 #:use-module (guix build-system cmake)
ffb010b5 45 #:use-module (guix build-system gnu)
f70be011 46 #:use-module (guix build-system python)
ffb010b5 47 #:use-module (gnu packages)
4534d85e 48 #:use-module (gnu packages algebra)
95283f3f 49 #:use-module (gnu packages autotools)
5699a3cf 50 #:use-module (gnu packages base)
20500662 51 #:use-module (gnu packages bison)
ffb010b5 52 #:use-module (gnu packages boost)
4534d85e 53 #:use-module (gnu packages check)
2003e837 54 #:use-module (gnu packages cmake)
d3f95898 55 #:use-module (gnu packages commencement)
93094501 56 #:use-module (gnu packages compression)
befc9ff6 57 #:use-module (gnu packages curl)
4cd9de60 58 #:use-module (gnu packages documentation)
20500662 59 #:use-module (gnu packages flex)
ffb010b5 60 #:use-module (gnu packages fontutils)
c31b61ef 61 #:use-module (gnu packages fpga)
324b0040 62 #:use-module (gnu packages freedesktop)
1251c664 63 #:use-module (gnu packages gcc)
20500662 64 #:use-module (gnu packages gd)
95283f3f 65 #:use-module (gnu packages gettext)
93094501 66 #:use-module (gnu packages ghostscript)
20500662 67 #:use-module (gnu packages gl)
412726ee
RW
68 #:use-module (gnu packages glib)
69 #:use-module (gnu packages gnome)
c31b61ef 70 #:use-module (gnu packages gperf)
2316ce51 71 #:use-module (gnu packages graphics)
4cd9de60 72 #:use-module (gnu packages graphviz)
1ca54999 73 #:use-module (gnu packages groff)
412726ee
RW
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages guile)
4534d85e 76 #:use-module (gnu packages image)
4cd9de60 77 #:use-module (gnu packages image-processing)
e981ca36 78 #:use-module (gnu packages imagemagick)
38cf2ba0 79 #:use-module (gnu packages linux) ;FIXME: for pcb
0de98139 80 #:use-module (gnu packages m4)
ffb010b5 81 #:use-module (gnu packages maths)
44669577 82 #:use-module (gnu packages multiprecision)
a6edcfaf 83 #:use-module (gnu packages mpi)
f37f949d 84 #:use-module (gnu packages ncurses)
412726ee 85 #:use-module (gnu packages perl)
ffb010b5 86 #:use-module (gnu packages pkg-config)
befc9ff6 87 #:use-module (gnu packages python)
44d10b1f 88 #:use-module (gnu packages python-xyz)
ffb010b5 89 #:use-module (gnu packages qt)
5e872d4b 90 #:use-module (gnu packages readline)
befc9ff6 91 #:use-module (gnu packages swig)
4cd9de60 92 #:use-module (gnu packages tbb)
20500662 93 #:use-module (gnu packages tcl)
1ca54999 94 #:use-module (gnu packages texinfo)
befc9ff6 95 #:use-module (gnu packages tls)
8f9ac901 96 #:use-module (gnu packages tex)
7cdc7e57 97 #:use-module (gnu packages version-control)
befc9ff6 98 #:use-module (gnu packages wxwidgets)
2316ce51 99 #:use-module (gnu packages xml)
44669577 100 #:use-module (gnu packages xorg))
ffb010b5
RW
101
102(define-public librecad
103 (package
104 (name "librecad")
6e9d5d5f 105 (version "2.1.3")
ffb010b5
RW
106 (source (origin
107 (method url-fetch)
108 (uri (string-append
109 "https://github.com/LibreCAD/LibreCAD/archive/"
110 version ".tar.gz"))
d8a4b932 111 (file-name (string-append name "-" version ".tar.gz"))
ffb010b5
RW
112 (sha256
113 (base32
6e9d5d5f 114 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
ffb010b5
RW
115 (build-system gnu-build-system)
116 (arguments
117 '(#:phases
d694230a 118 (modify-phases %standard-phases
7e3aca2b
RW
119 ;; Without this patch boost complains that "make_array" is not a
120 ;; member of "boost::serialization".
121 (add-after 'unpack 'patch-boost-error
122 (lambda _
123 (substitute* "librecad/src/lib/math/lc_quadratic.h"
124 (("#include \"rs_vector.h\"" line)
125 (string-append line
126 "\n#include <boost/serialization/array_wrapper.hpp>")))
127 (substitute* "librecad/src/lib/math/rs_math.cpp"
128 (("#include <boost/numeric/ublas/matrix.hpp>" line)
129 (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
130 line)))
131 #t))
6cedd611
CL
132 ;; Fix build against Qt 5.11.
133 (add-after 'unpack 'add-missing-headers
134 (lambda _
135 (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
136 (("#include <QPushButton>") "#include <QPushButton>
137#include <QActionGroup>"))
138 #t))
7e3aca2b
RW
139 (add-after 'unpack 'patch-paths
140 (lambda* (#:key outputs #:allow-other-keys)
141 (let ((out (assoc-ref outputs "out")))
142 (substitute* "librecad/src/lib/engine/rs_system.cpp"
143 (("/usr/share") (string-append out "/share"))))))
144 (replace 'configure
145 (lambda* (#:key inputs #:allow-other-keys)
146 (system* "qmake" (string-append "BOOST_DIR="
147 (assoc-ref inputs "boost")))))
148 (replace 'install
149 (lambda* (#:key outputs #:allow-other-keys)
150 (let* ((out (assoc-ref outputs "out"))
151 (bin (string-append out "/bin"))
152 (share (string-append out "/share/librecad")))
153 (mkdir-p bin)
154 (install-file "unix/librecad" bin)
155 (mkdir-p share)
156 (copy-recursively "unix/resources" share))
9cc51d16
RW
157 #t))
158 ;; Ensure that icons are found at runtime
159 (add-after 'install 'wrap-executable
160 (lambda* (#:key inputs outputs #:allow-other-keys)
161 (let* ((out (assoc-ref outputs "out"))
162 (qt '("qtbase" "qtsvg")))
163 (wrap-program (string-append out "/bin/librecad")
164 `("QT_PLUGIN_PATH" ":" prefix
165 ,(map (lambda (label)
166 (string-append (assoc-ref inputs label)
167 "/lib/qt5/plugins/"))
168 qt)))
169 #t))))))
ffb010b5
RW
170 (inputs
171 `(("boost" ,boost)
172 ("muparser" ,muparser)
173 ("freetype" ,freetype)
9fdda0b2
RW
174 ("qtbase" ,qtbase)
175 ("qtsvg" ,qtsvg)))
ffb010b5
RW
176 (native-inputs
177 `(("pkg-config" ,pkg-config)
178 ("which" ,which)))
179 (home-page "http://librecad.org/")
180 (synopsis "Computer-aided design (CAD) application")
181 (description
182 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
183plans and designs.")
184 (license license:gpl2)))
412726ee
RW
185
186(define-public geda-gaf
187 (package
188 (name "geda-gaf")
12356eb8 189 (version "1.9.2")
412726ee
RW
190 (source (origin
191 (method url-fetch)
192 (uri (string-append
12356eb8 193 "http://ftp.geda-project.org/geda-gaf/unstable/v"
412726ee
RW
194 (version-major+minor version) "/"
195 version "/geda-gaf-" version ".tar.gz"))
196 (sha256
197 (base32
12356eb8 198 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
412726ee
RW
199 (build-system gnu-build-system)
200 (arguments
201 '(#:phases
2352c97d
RW
202 (modify-phases %standard-phases
203 ;; tests require a writable HOME
204 (add-before 'check 'set-home
205 (lambda _
206 (setenv "HOME" (getenv "TMPDIR"))
a01d926f
RW
207 #t))
208 ;; FIXME: These two tests fail for unknown reasons. They return "2"
209 ;; when they should return "1".
210 (add-after 'unpack 'disable-failing-tests
211 (lambda _
212 (substitute* "utils/tests/gxyrs/tests.list"
213 (("^do_nothing.*") ""))
2352c97d 214 #t)))
0de98139
DT
215 #:configure-flags
216 (let ((pcb (assoc-ref %build-inputs "pcb")))
217 (list (string-append "--with-pcb-datadir=" pcb "/share")
218 (string-append "--with-pcb-lib-path="
219 pcb "/share/pcb/pcblib-newlib:"
220 pcb "/share/pcb/newlib")))))
412726ee
RW
221 (inputs
222 `(("glib" ,glib)
223 ("gtk" ,gtk+-2)
224 ("guile" ,guile-2.0)
225 ("desktop-file-utils" ,desktop-file-utils)
0de98139
DT
226 ("shared-mime-info" ,shared-mime-info)
227 ("m4" ,m4)
228 ("pcb" ,pcb)))
412726ee
RW
229 (native-inputs
230 `(("pkg-config" ,pkg-config)
231 ("perl" ,perl))) ; for tests
232 (home-page "http://geda-project.org/")
233 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
234 (description
a124bbd2 235 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
412726ee
RW
236suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
237which currently includes: gschem, a schematic capture program; gnetlist, a
238netlist generation program; gsymcheck, a syntax checker for schematic symbols;
239gattrib, a spreadsheet programm that manipulates the properties of symbols of
240a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
241tool to forward annotation from your schematic to layout using PCB; some minor
242utilities.")
243 (license license:gpl2+)))
244
1ca54999
LC
245(define-public lepton-eda
246 ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
247 ;; keep and to extend Guile support.
248 (package
249 (inherit geda-gaf)
250 (name "lepton-eda")
ef0ef831 251 (version "1.9.9-20191003")
1ca54999
LC
252 (home-page "https://github.com/lepton-eda/lepton-eda")
253 (source (origin
254 (method git-fetch)
255 (uri (git-reference (url home-page) (commit version)))
256 (sha256
257 (base32
ef0ef831 258 "08cc3zfk84qq9mrkc9pp4r9jlavvm01wwy0yd9frql68w2zw6mip"))
1ca54999
LC
259 (file-name (git-file-name name version))))
260 (native-inputs
261 `(("autoconf" ,autoconf)
262 ("automake" ,automake)
263 ("libtool" ,libtool)
264 ("gettext" ,gnu-gettext)
265 ("texinfo" ,texinfo)
266 ("groff" ,groff)
267 ("which" ,which)
268 ,@(package-native-inputs geda-gaf)))
ef0ef831
RW
269 (inputs
270 `(("glib" ,glib)
271 ("gtk" ,gtk+-2)
272 ("guile" ,guile-2.2)
273 ("desktop-file-utils" ,desktop-file-utils)
274 ("shared-mime-info" ,shared-mime-info)
275 ("m4" ,m4)
276 ("pcb" ,pcb)))
1ca54999
LC
277 (arguments
278 (substitute-keyword-arguments (package-arguments geda-gaf)
279 ((#:configure-flags flags ''())
280 ;; When running "make", the POT files are built with the build time as
281 ;; their "POT-Creation-Date". Later on, "make" notices that .pot
282 ;; files were updated and goes on to run "msgmerge"; as a result, the
283 ;; non-deterministic POT-Creation-Date finds its way into .po files,
284 ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
285 ;; never runs. See <https://bugs.debian.org/792687>.
286 `(cons "ac_cv_path_MSGMERGE=true" ,flags))
287 ((#:phases phases '%standard-phases)
288 `(modify-phases ,phases
289 (add-before 'bootstrap 'prepare
290 (lambda _
291 ;; Some of the scripts there are invoked by autogen.sh.
292 (for-each patch-shebang (find-files "build-tools"))
293
294 ;; Make sure 'msgmerge' can modify the PO files.
295 (for-each (lambda (po)
296 (chmod po #o666))
297 (find-files "." "\\.po$"))
298
299 ;; This would normally be created by invoking 'git', but it
300 ;; doesn't work here.
301 (call-with-output-file "version.h"
302 (lambda (port)
303 (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
304 ,(string-drop version
305 (+ 1 (string-index version #\-))))
306 (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
307 ,(string-take version
308 (string-index version #\-)))
309 (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
ef0ef831
RW
310 #t))
311 (add-after 'install 'compile-scheme-files
312 (lambda* (#:key outputs #:allow-other-keys)
313 (invoke "make" "precompile")
314 (for-each (lambda (program)
315 (wrap-program program
316 `("GUILE_LOAD_COMPILED_PATH" ":" prefix
317 (,(string-append (assoc-ref outputs "out")
318 "/share/lepton-eda/ccache/")))))
319 (find-files (string-append (assoc-ref outputs "out") "/bin")
320 ".*"))
1ca54999
LC
321 #t))))))
322 (description
323 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
324forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
325design, schematic capture, simulation, prototyping, and production. Lepton
326EDA includes tools for schematic capture, attribute management, bill of
327materials (BOM) generation, netlisting into over 20 netlist formats, analog
328and digital simulation, and printed circuit board (PCB) layout, and many other
329features.")))
330
20500662
RW
331(define-public pcb
332 (package
333 (name "pcb")
88fb1562 334 (version "4.0.2")
20500662
RW
335 (source (origin
336 (method url-fetch)
e981ca36
RW
337 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
338 "/pcb-" version ".tar.gz"))
20500662
RW
339 (sha256
340 (base32
88fb1562 341 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
20500662
RW
342 (build-system gnu-build-system)
343 (arguments
344 `(#:phases
dc1d3cde
KK
345 (modify-phases %standard-phases
346 (add-after 'unpack 'use-wish8.6
347 (lambda _
348 (substitute* "configure"
349 (("wish85") "wish8.6"))
350 #t))
88fb1562
RW
351 ;; It checks for "xhost", which we don't have. This shouldn't
352 ;; matter, because the test is supposed to be skipped, but it causes
353 ;; "run_tests.sh" (and thus the "check" phase) to fail.
354 (add-after 'unpack 'fix-check-for-display
355 (lambda _
356 (substitute* "tests/run_tests.sh"
357 (("have_display=no") "have_display=yes"))
358 #t))
dc1d3cde
KK
359 (add-after 'install 'wrap
360 (lambda* (#:key inputs outputs #:allow-other-keys)
361 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
362 ;; fix of the mesa package we wrap the pcb executable such that
363 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
364 (let* ((out (assoc-ref outputs "out"))
365 (path (string-append (assoc-ref inputs "udev") "/lib")))
366 (wrap-program (string-append out "/bin/pcb")
367 `("LD_LIBRARY_PATH" ":" prefix (,path))))
368 #t))
369 (add-before 'check 'pre-check
370 (lambda _
371 (system "Xvfb :1 &")
372 (setenv "DISPLAY" ":1")
373 #t)))))
20500662
RW
374 (inputs
375 `(("dbus" ,dbus)
376 ("mesa" ,mesa)
377 ("udev" ,eudev) ;FIXME: required by mesa
378 ("glu" ,glu)
379 ("gd" ,gd)
380 ("gtk" ,gtk+-2)
381 ("gtkglext" ,gtkglext)
382 ("desktop-file-utils" ,desktop-file-utils)
383 ("shared-mime-info" ,shared-mime-info)
384 ("tk" ,tk)))
385 (native-inputs
386 `(("pkg-config" ,pkg-config)
387 ("intltool" ,intltool)
388 ("bison" ,bison)
e981ca36
RW
389 ("flex" ,flex)
390 ;; For tests
391 ("imagemagick" ,imagemagick)
392 ("gerbv" ,gerbv)
393 ("ghostscript" ,ghostscript)
ff337525 394 ("xvfb" ,xorg-server-for-tests)))
20500662
RW
395 (home-page "http://pcb.geda-project.org/")
396 (synopsis "Design printed circuit board layouts")
397 (description
398 "GNU PCB is an interactive tool for editing printed circuit board
399layouts. It features a rats-nest implementation, schematic/netlist import,
400and design rule checking. It also includes an autorouter and a trace
401optimizer; and it can produce photorealistic and design review images.")
402 (license license:gpl2+)))
93094501 403
49c2665f
RW
404(define-public pcb-rnd
405 (package (inherit pcb)
406 (name "pcb-rnd")
407 (version "1.1.3")
408 (source (origin
409 (method url-fetch)
410 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
411 "pcb-rnd-" version ".tar.gz"))
412 (sha256
413 (base32
414 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
415 (arguments
416 `(#:tests? #f ; no check target
417 #:phases
418 (modify-phases %standard-phases
419 (add-after 'unpack 'cc-is-gcc
420 (lambda _ (setenv "CC" "gcc") #t))
421 (replace 'configure
422 ;; The configure script doesn't tolerate most of our configure flags.
423 (lambda* (#:key outputs #:allow-other-keys)
a8416e69
RW
424 (invoke "sh" "configure"
425 (string-append "--prefix="
426 (assoc-ref outputs "out"))))))))
49c2665f
RW
427 (home-page "http://repo.hu/projects/pcb-rnd/")
428 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
429featuring various improvements and bug fixes.")))
430
93094501
FB
431(define-public fastcap
432 (package
433 (name "fastcap")
434 (version "2.0-18Sep92")
435 (source (origin
95001d4b 436 (method url-fetch/tarbomb)
93094501
FB
437 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
438 name "-" version ".tgz"))
439 (sha256
440 (base32
441 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
3dac53be
FB
442 (snippet
443 ;; Remove a non-free file.
6cbee49d
MW
444 '(begin
445 (delete-file "doc/psfig.sty")
446 #t))
fc1adab1
AK
447 (patches (search-patches "fastcap-mulSetup.patch"
448 "fastcap-mulGlobal.patch"))))
93094501
FB
449 (build-system gnu-build-system)
450 (native-inputs
697e341e
RW
451 ;; FIXME: with texlive-tiny citation references are rendered as question
452 ;; marks. During the build warnings like these are printed:
453 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
5a23696a 454 `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts)))
fb0b9ff1 455 ("ghostscript" ,ghostscript)))
93094501
FB
456 (arguments
457 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
458 #:parallel-build? #f
459 #:tests? #f ;; no tests-suite
460 #:modules ((srfi srfi-1)
461 ,@%gnu-build-system-modules)
462 #:phases
463 (modify-phases %standard-phases
464 (add-after 'build 'make-doc
697e341e 465 (lambda _
5a23696a 466 (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
93094501 467 (add-before 'make-doc 'fix-doc
697e341e
RW
468 (lambda _
469 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
470 (substitute* (find-files "doc" "\\.tex")
471 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
472 all file scale)
473 (string-append "\\includegraphics[scale=" scale "]{"
474 file "}"))
475 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
476 all file width)
477 (string-append "\\includegraphics[width=" width "]{"
478 file "}"))
479 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
480 all file height)
481 (string-append "\\includegraphics[height=" height "]{"
482 file "}"))
483 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
484 (string-append "\\includegraphics{" file "}")))
485 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
486 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
487 all options class)
488 (string-append "\\documentclass[" options "]{"
489 class "}\n"
490 "\\usepackage{graphicx}\n"
491 "\\usepackage{robinspace}"))
492 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
493 (string-append "%" all))
494 (("\\\\setstretch\\{.*\\}" all)
495 (string-append "%" all)))
496 #t))
93094501
FB
497 (delete 'configure)
498 (add-before 'install 'clean-bin
697e341e
RW
499 (lambda _
500 (delete-file (string-append (getcwd) "/bin/README"))
501 #t))
93094501 502 (add-before 'install 'make-pdf
697e341e
RW
503 (lambda _
504 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
505 (with-directory-excursion "doc"
506 (and
5a23696a
RW
507 (for-each (lambda (file)
508 (invoke "dvips" file "-o"))
509 (find-files "." "\\.dvi"))
510 (for-each (lambda (file)
511 (invoke "ps2pdf" file))
512 '("mtt.ps" "ug.ps" "tcad.ps"))
513 (invoke "make" "clean")))))
93094501 514 (replace 'install
697e341e
RW
515 (lambda* (#:key outputs #:allow-other-keys)
516 (let* ((out (assoc-ref outputs "out"))
517 (data (string-append out "/share"))
518 (bin (string-append out "/bin"))
519 (doc (string-append data "/doc/" ,name "-" ,version))
520 (examples (string-append doc "/examples")))
521 (with-directory-excursion "bin"
522 (for-each (lambda (f)
523 (install-file f bin))
524 (find-files "." ".*")))
525 (copy-recursively "doc" doc)
526 (copy-recursively "examples" examples)
527 #t))))))
93094501
FB
528 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
529 (synopsis "Multipole-accelerated capacitance extraction program")
530 (description
531 "Fastcap is a capacitance extraction program based on a
532multipole-accelerated algorithm.")
533 (license (license:non-copyleft #f "See fastcap.c."))))
23bae7bb
FB
534
535(define-public fasthenry
536 (package
537 (name "fasthenry")
538 (version "3.0-12Nov96")
539 (source (origin
540 (method url-fetch)
541 (file-name (string-append name "-" version ".tar.gz"))
542 (uri (string-append
543 "http://www.rle.mit.edu/cpg/codes/" name
544 "-" version ".tar.z"))
545 (sha256
546 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
fc1adab1
AK
547 (patches (search-patches "fasthenry-spAllocate.patch"
548 "fasthenry-spBuild.patch"
549 "fasthenry-spUtils.patch"
550 "fasthenry-spSolve.patch"
551 "fasthenry-spFactor.patch"))))
23bae7bb
FB
552 (build-system gnu-build-system)
553 (arguments
554 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
555 #:parallel-build? #f
556 #:tests? #f ;; no tests-suite
557 #:modules ((srfi srfi-1)
558 ,@%gnu-build-system-modules)
559 #:phases
560 (modify-phases %standard-phases
561 (delete 'configure)
562 (replace 'install
563 (lambda* (#:key outputs #:allow-other-keys)
564 (let* ((out (assoc-ref outputs "out"))
565 (data (string-append out "/share"))
566 (bin (string-append out "/bin"))
567 (doc (string-append data "/doc/" ,name "-" ,version))
568 (examples (string-append doc "/examples")))
569 (with-directory-excursion "bin"
96c46210
LC
570 (for-each (lambda (f)
571 (install-file f bin))
572 (find-files "." ".*")))
23bae7bb
FB
573 (copy-recursively "doc" doc)
574 (copy-recursively "examples" examples)
575 #t))))))
576 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
577 (synopsis "Multipole-accelerated inductance analysis program")
578 (description
579 "Fasthenry is an inductance extraction program based on a
580multipole-accelerated algorithm.")
581 (license (license:non-copyleft #f "See induct.c."))))
95283f3f 582
3d5fd240
RW
583(define-public fritzing
584 (package
585 (name "fritzing")
7cdc7e57 586 (version "0.9.3b")
3d5fd240 587 (source (origin
7cdc7e57
RW
588 (method git-fetch)
589 (uri (git-reference
590 (url "https://github.com/fritzing/fritzing-app.git")
591 (commit version)))
592 (file-name (git-file-name name version))
3d5fd240
RW
593 (sha256
594 (base32
7cdc7e57 595 "0hpyc550xfhr6gmnc85nq60w00rm0ljm0y744dp0z88ikl04f4s3"))))
3d5fd240
RW
596 (build-system gnu-build-system)
597 (arguments
598 `(#:phases
599 (modify-phases %standard-phases
600 (replace 'configure
601 (lambda* (#:key inputs outputs #:allow-other-keys)
7cdc7e57
RW
602 (copy-recursively (assoc-ref inputs "fritzing-parts-db")
603 "parts")
604 ;; Make compatible with libgit2 > 0.24
605 (substitute* "src/version/partschecker.cpp"
606 (("error = git_remote_connect\\(remote, GIT_DIRECTION_FETCH, &callbacks\\)")
607 "error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks, NULL, NULL)"))
608
609 ;; Use system libgit2 and boost.
610 (substitute* "phoenix.pro"
611 (("^LIBGIT2INCLUDE =.*")
612 (string-append "LIBGIT2INCLUDE="
613 (assoc-ref inputs "libgit2") "/include\n"))
614 (("^ LIBGIT2LIB =.*")
615 (string-append " LIBGIT2LIB="
616 (assoc-ref inputs "libgit2") "/lib\n")))
617 ;; This file checks for old versions of Boost, insisting on
618 ;; having us download the boost sources and placing them in the
619 ;; build directory.
620 (substitute* "pri/utils.pri"
621 (("error\\(") "message("))
622
623 (let ((out (assoc-ref outputs "out")))
624 (invoke "qmake"
625 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib")
626 (string-append "PREFIX=" out)
627 "phoenix.pro")))))))
3d5fd240 628 (inputs
a2b99351
DC
629 `(("qtbase" ,qtbase)
630 ("qtserialport" ,qtserialport)
631 ("qtsvg" ,qtsvg)
7cdc7e57 632 ("libgit2" ,libgit2)
3d5fd240
RW
633 ("boost" ,boost)
634 ("zlib" ,zlib)
635 ("fritzing-parts-db"
636 ,(origin
7cdc7e57
RW
637 (method git-fetch)
638 (uri (git-reference
639 (url "https://github.com/fritzing/fritzing-parts.git")
640 (commit version)))
641 (file-name (git-file-name "fritzing-parts" version))
3d5fd240
RW
642 (sha256
643 (base32
7cdc7e57 644 "1d2v8k7p176j0lczx4vx9n9gbg3vw09n2c4b6w0wj5wqmifywhc1"))))))
3d5fd240
RW
645 (home-page "http://fritzing.org")
646 (synopsis "Electronic circuit design")
647 (description
648 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
649software with a low entry barrier, suited for the needs of makers and
650hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
651library with many commonly used high-level components. Fritzing makes it very
652easy to communicate about circuits, as well as to turn them into PCB layouts
653ready for production.")
654 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
655 ;; released under GPLv3+.
656 (license (list license:gpl3+ license:cc-by-sa3.0))))
657
95283f3f
RW
658(define-public gerbv
659 (package
660 (name "gerbv")
0b2db013 661 (version "2.7.0")
95283f3f
RW
662 (source (origin
663 (method url-fetch)
664 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
665 version "/gerbv-" version ".tar.gz"))
666 (sha256
667 (base32
0b2db013 668 "1d2k43k7i4yvbpi4sw1263a8d0q98z2n7aqhmpinpkih8a681vn5"))))
95283f3f 669 (build-system gnu-build-system)
95283f3f 670 (native-inputs
0b2db013
TGR
671 `(("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
672 ("pkg-config" ,pkg-config)))
95283f3f
RW
673 (inputs
674 `(("cairo" ,cairo)
675 ("gtk" ,gtk+-2)
676 ("desktop-file-utils" ,desktop-file-utils)))
677 (home-page "http://gerbv.geda-project.org/")
678 (synopsis "Gerber file viewer")
679 (description
680 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
681is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
682you load several files on top of each other, do measurements on the displayed
683image, etc. Besides viewing Gerbers, you may also view Excellon drill files
684as well as pick-place files.")
685 (license license:gpl2+)))
4534d85e 686
847768b9
RW
687(define-public translate2geda
688 ;; There has been no formal release yet.
689 (let ((commit "4c19e7eefa338cea8f1ee999ea8b37f8d0698169")
690 (revision "1"))
691 (package
692 (name "translate2geda")
693 (version (git-version "0" revision commit))
694 (source (origin
695 (method git-fetch)
696 (uri (git-reference
697 (url "https://github.com/erichVK5/translate2geda.git")
698 (commit commit)))
699 (file-name (git-file-name name version))
700 (sha256
701 (base32
702 "1h062bbpw8nk0jamkya1k4lsgaia796jyviiz2gkdi6k1bxhwgpa"))))
703 (build-system ant-build-system)
704 (arguments
705 `(#:tests? #f ; there are no tests
706 #:jar-name "translate2geda.jar"
707 #:source-dir "."
708 #:main-class "translate2geda"
709 #:phases
710 (modify-phases %standard-phases
711 (add-after 'install 'install-bin
712 (lambda* (#:key inputs outputs #:allow-other-keys)
713 (let* ((out (assoc-ref outputs "out"))
714 (bin (string-append out "/bin"))
715 (wrapper (string-append bin "/translate2geda")))
716 (mkdir-p bin)
717 (with-output-to-file wrapper
718 (lambda _
719 (format #t "#!/bin/sh~%exec ~a -jar ~a/share/java/translate2geda.jar"
720 (which "java") out)))
721 (chmod wrapper #o555))
722 #t)))))
723 (home-page "https://github.com/erichVK5/translate2geda")
724 (synopsis "Utility for converting symbol and footprint formats to gEDA")
725 (description
726 "This package provides a utility for converting Kicad (@file{.mod},
727@file{.lib}), Eagle (@file{.lbr}), gerber (@file{.gbr}, etc..),
728BXL (@file{.bxl}), IBIS (@file{.ibs}), symdef, LT-Spice (@file{.asc}),
729QUCS (@file{.sch}), and BSDL (@file{.bsd}) symbols and footprints and EggBot
730fonts to gEDA.")
731 (license license:gpl2+))))
732
28f4d56d 733(define-public libfive
6a0b9500
RW
734 (let ((commit "6e39254e57c179459bb929df49ae96a6017a0ed6")
735 (revision "3"))
4534d85e 736 (package
28f4d56d 737 (name "libfive")
007c75f5 738 (version (git-version "0" revision commit))
4534d85e
LC
739 (source (origin
740 (method git-fetch)
741 (uri (git-reference
28f4d56d 742 (url "https://github.com/libfive/libfive")
4534d85e
LC
743 (commit commit)))
744 (sha256
745 (base32
6a0b9500 746 "0ryv2hcbrwqc087w7rrs4a2irkcpmqync00g4dh8n7jn10w2jkim"))
0818c01a
DNB
747 (file-name (git-file-name name version))
748 (snippet
749 ;; Remove bundled catch since we provide our own.
b8a251d7
LC
750 '(begin
751 (delete-file "libfive/test/catch.hpp")
752 #t))))
4534d85e
LC
753 (build-system cmake-build-system)
754 (arguments
0818c01a 755 `(#:test-target "libfive-test"
4534d85e
LC
756 #:phases
757 (modify-phases %standard-phases
007c75f5
EB
758 (add-after 'unpack 'remove-native-compilation
759 (lambda _
760 (substitute* "CMakeLists.txt" (("-march=native") ""))
6a0b9500
RW
761 #t))
762 (add-after 'unpack 'find-catch
763 (lambda* (#:key inputs #:allow-other-keys)
764 (setenv "CPLUS_INCLUDE_PATH"
765 (string-append (assoc-ref inputs "catch")
766 "/include/catch"))
0818c01a 767 #t)))))
4534d85e
LC
768 (native-inputs
769 `(("pkg-config" ,pkg-config)))
770 (inputs
771 `(("boost" ,boost)
6a0b9500 772 ("catch" ,catch-framework2)
4534d85e 773 ("libpng" ,libpng)
28f4d56d 774 ("qtbase" ,qtbase)
4534d85e 775 ("eigen" ,eigen)
28f4d56d
RW
776 ("guile" ,guile-2.2)))
777 (home-page "https://libfive.com")
4534d85e
LC
778 (synopsis "Tool for programmatic computer-aided design")
779 (description
28f4d56d
RW
780 "Libfive is a tool for programmatic computer-aided design (CAD). In
781libfive, solid models are defined as Scheme scripts, and there are no opaque
782function calls into the geometry kernel: everything is visible to the user.
783Even fundamental, primitive shapes are represented as code in the user-level
4534d85e 784language.")
6a0b9500 785 (license (list license:mpl2.0 ;library
28f4d56d
RW
786 license:gpl2+))))) ;Guile bindings and GUI
787
4bd8a9d8
RW
788(define-public ao
789 (deprecated-package "ao-cad" libfive))
befc9ff6 790
befc9ff6 791(define-public kicad
befc9ff6
TF
792 (package
793 (name "kicad")
f648d681 794 (version "5.1.4")
befc9ff6
TF
795 (source
796 (origin
b50658fe
JB
797 (method url-fetch)
798 (file-name (string-append name "-" version ".tar.xz"))
799 (uri (string-append
f648d681
AI
800 "https://launchpad.net/kicad/" (version-major version)
801 ".0/" version "/+download/kicad-" version ".tar.xz"))
befc9ff6 802 (sha256
f648d681 803 (base32 "1r60dgh6aalbpq1wsmpyxkz0nn4ck8ydfdjcrblpl69k5rks5k2j"))))
befc9ff6
TF
804 (build-system cmake-build-system)
805 (arguments
806 `(#:out-of-source? #t
807 #:tests? #f ; no tests
3def739d 808 #:build-type "Release"
befc9ff6 809 #:configure-flags
f648d681
AI
810 (list "-DKICAD_SCRIPTING_PYTHON3=ON"
811 "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
812 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
befc9ff6
TF
813 #:phases
814 (modify-phases %standard-phases
815 (add-after 'install 'wrap-program
816 ;; Ensure correct Python at runtime.
817 (lambda* (#:key inputs outputs #:allow-other-keys)
818 (let* ((out (assoc-ref outputs "out"))
819 (python (assoc-ref inputs "python"))
820 (file (string-append out "/bin/kicad"))
821 (path (string-append
822 out
917f5ee7
EF
823 "/lib/python"
824 ,(version-major+minor
825 (package-version python))
826 "/site-packages:"
befc9ff6
TF
827 (getenv "PYTHONPATH"))))
828 (wrap-program file
829 `("PYTHONPATH" ":" prefix (,path))
830 `("PATH" ":" prefix
831 (,(string-append python "/bin:")))))
832 #t)))))
833 (native-inputs
834 `(("boost" ,boost)
835 ("gettext" ,gnu-gettext)
836 ("pkg-config" ,pkg-config)
837 ("swig" ,swig)
838 ("zlib" ,zlib)))
839 (inputs
840 `(("cairo" ,cairo)
841 ("curl" ,curl)
842 ("desktop-file-utils" ,desktop-file-utils)
843 ("glew" ,glew)
844 ("glm" ,glm)
845 ("hicolor-icon-theme" ,hicolor-icon-theme)
50942a69 846 ("libngspice" ,libngspice)
befc9ff6
TF
847 ("libsm" ,libsm)
848 ("mesa" ,mesa)
b50658fe 849 ("opencascade-oce" ,opencascade-oce)
befc9ff6 850 ("openssl" ,openssl)
f648d681
AI
851 ("python" ,python)
852 ("wxwidgets" ,wxwidgets)
853 ("wxpython" ,python-wxpython)))
befc9ff6
TF
854 (home-page "http://kicad-pcb.org/")
855 (synopsis "Electronics Design Automation Suite")
856 (description "Kicad is a program for the formation of printed circuit
857boards and electrical circuits. The software has a number of programs that
858perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
859electrical diagrams), gerbview (viewing Gerber files) and others.")
b50658fe 860 (license license:gpl3+)))
8f528bd4
TF
861
862(define-public kicad-library
6f832aa0 863 (let ((version "4.0.7"))
8f528bd4
TF
864 (package
865 (name "kicad-library")
866 (version version)
9c476e4d
TGR
867 (source
868 (origin
869 (method url-fetch)
870 (uri (string-append
871 "https://kicad-downloads.s3.cern.ch/libraries/kicad-library-"
872 version ".tar.gz"))
873 (sha256
874 (base32 "1azb7v1y3l6j329r9gg7f4zlg0wz8nh4s4i5i0l9s4yh9r6i9zmv"))))
8f528bd4
TF
875 (build-system cmake-build-system)
876 (arguments
877 `(#:out-of-source? #t
9c476e4d 878 #:tests? #f ; no tests
8f528bd4
TF
879 #:phases
880 (modify-phases %standard-phases
881 (add-after 'install 'install-footprints ; from footprints tarball
882 (lambda* (#:key inputs outputs #:allow-other-keys)
6c08ea6a
TGR
883 (invoke "tar" "xvf"
884 (assoc-ref inputs "kicad-footprints")
885 "-C" (string-append (assoc-ref outputs "out")
886 "/share/kicad/modules")
887 "--strip-components=1")))
8f528bd4
TF
888 ;; We change the default global footprint file, which is generated if
889 ;; it doesn't exist in user's home directory, from the one using the
890 ;; github plugin, to the one using the KISYSMOD environment path.
891 (add-after 'install-footprints 'use-pretty-footprint-table
892 (lambda* (#:key outputs #:allow-other-keys)
893 (let* ((out (assoc-ref outputs "out"))
894 (template-dir (string-append out "/share/kicad/template"))
895 (fp-lib-table (string-append template-dir "/fp-lib-table")))
896 (delete-file fp-lib-table)
897 (copy-file (string-append fp-lib-table ".for-pretty")
9c476e4d 898 fp-lib-table))
8f528bd4
TF
899 #t)))))
900 (native-search-paths
901 (list (search-path-specification
9c476e4d 902 (variable "KISYSMOD") ; footprint path
8f528bd4
TF
903 (files '("share/kicad/modules")))
904 (search-path-specification
9c476e4d 905 (variable "KISYS3DMOD") ; 3D model path
8f528bd4 906 (files '("share/kicad/modules/packages3d")))))
6f832aa0 907 ;; Kicad distributes footprints in a separate tarball.
8f528bd4
TF
908 (native-inputs
909 `(("kicad-footprints"
910 ,(origin
911 (method url-fetch)
912 (uri (string-append
913 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
914 version ".tar.gz"))
915 (sha256
916 (base32
6f832aa0 917 "08qrz5zzsb5127jlnv24j0sgiryd5nqwg3lfnwi8j9a25agqk13j"))))))
8f528bd4
TF
918 (home-page "http://kicad-pcb.org/")
919 (synopsis "Libraries for kicad")
920 (description "This package provides Kicad component, footprint and 3D
921render model libraries.")
922 (license license:lgpl2.0+))))
5f947808 923
47f9fb18
DM
924(define-public kicad-symbols
925 (package
926 (name "kicad-symbols")
c07bc1d2 927 (version "5.1.4")
47f9fb18
DM
928 (source (origin
929 (method git-fetch)
930 (uri (git-reference
931 (url "https://github.com/KiCad/kicad-symbols.git")
932 (commit version)))
a5544621 933 (file-name (git-file-name name version))
47f9fb18
DM
934 (sha256
935 (base32
c07bc1d2 936 "1lna4xlvzrxif3569pkp6mrg7fj62z3a3ri5j97lnmnnzhiddnh3"))))
47f9fb18
DM
937 (build-system cmake-build-system)
938 (arguments
939 `(#:tests? #f)) ; No tests exist
940 (home-page "http://kicad-pcb.org/")
941 (synopsis "Official KiCad schematic symbol libraries for KiCad 5")
942 (description "This package contains the official KiCad schematic symbol
943libraries for KiCad 5.")
944 ;; 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'."
945 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
946 (license license:cc-by-sa4.0)))
947
5f947808
JD
948(define-public linsmith
949 (package
950 (name "linsmith")
d193903e 951 (version "0.99.31")
5f947808
JD
952 (source (origin
953 (method url-fetch)
954 (uri (string-append
955 "mirror://sourceforge/linsmith/linsmith/linsmith-"
956 version "/linsmith-" version ".tar.gz"))
957 (sha256
958 (base32
d193903e 959 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
5f947808
JD
960 (build-system gnu-build-system)
961 (native-inputs
962 `(("pkg-config" ,pkg-config)
963 ("gtk" ,gtk+-2)
964 ("libgnome" ,libgnomeui)))
6e3d48c2 965 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
5f947808
JD
966 (synopsis "Smith Charting program")
967 (description "LinSmith is a Smith Charting program, mainly designed for
968educational use. As such, there is an emphasis on capabilities that improve
969the 'showing the effect of'-style of operation.")
970 (license license:gpl2+)))
2766f9e8
DM
971
972(define-public volk
973 (package
974 (name "volk")
975 (version "1.3")
976 (source
977 (origin
978 (method url-fetch)
979 (uri (string-append "http://libvolk.org/releases/volk-"
980 version ".tar.gz"))
981 (sha256
982 (base32
983 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
984 (build-system cmake-build-system)
985 (inputs
986 `(("boost" ,boost)))
987 (native-inputs
c695fb76 988 `(("python-2" ,python-2)
2766f9e8
DM
989 ("python2-cheetah" ,python2-cheetah)))
990 (home-page "http://libvolk.org/")
991 (synopsis "Vector-Optimized Library of Kernels")
992 (description
993 "@code{volk} contains procedures with machine-specific optimizations
994for mathematical functions. It also provides an machine-independent
995interface to select the best such procedures to use on a given system.")
996 (license license:gpl3+)))
f37f949d
DM
997
998(define-public minicom
999 (package
1000 (name "minicom")
1001 (version "2.7.1")
1002 (source
1003 (origin
1004 (method url-fetch)
1005 (uri (string-append "https://alioth.debian.org/frs/download.php/"
1006 "file/4215/" name "-" version ".tar.gz"))
1007 (sha256
1008 (base32
1009 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
1010 (build-system gnu-build-system)
1011 (arguments
1012 `(#:configure-flags '("--enable-lock-dir=/var/lock")
1013 #:phases
1014 (modify-phases %standard-phases
1015 (add-after 'unpack 'patch-lock-check
1016 (lambda _
1017 (substitute* "configure"
1018 (("test -d [$]UUCPLOCK") "true"))
1019 #t)))))
1020 (inputs
1021 `(("ncurses" ,ncurses)))
1022 (home-page "https://alioth.debian.org/projects/minicom/")
1023 (synopsis "Serial terminal emulator")
1024 (description "@code{minicom} is a serial terminal emulator.")
1025 (license license:gpl2+)))
1251c664
TF
1026
1027(define-public harminv
1028 (package
1029 (name "harminv")
b09c6b55 1030 (version "1.4.1")
1251c664
TF
1031 (source (origin
1032 (method url-fetch)
1033 (uri
b09c6b55
TGR
1034 (string-append "https://github.com/stevengj/harminv/"
1035 "releases/download/v" version "/"
1036 name "-" version ".tar.gz"))
1251c664
TF
1037 (sha256
1038 (base32
b09c6b55 1039 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
1251c664
TF
1040 (build-system gnu-build-system)
1041 (arguments
1618c6fe
JB
1042 `(#:configure-flags '("--enable-shared")
1043 #:phases
1251c664
TF
1044 (modify-phases %standard-phases
1045 (add-before 'configure 'fix-tests
1046 (lambda _
1047 (substitute* "./sines-test.sh"
1048 ; change test frequency range - default fails
1049 (("0\\.15") "0.16"))
1050 #t)))))
1051 (native-inputs
1052 `(("fortran" ,gfortran)))
1053 (inputs
1054 `(("lapack" ,lapack)))
b09c6b55 1055 (home-page "https://github.com/stevengj/harminv")
1251c664
TF
1056 (synopsis "Harmonic inversion solver")
1057 (description
1058 "Harminv is a free program (and accompanying library) to solve the problem of
1059harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
1060of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
1061determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
1062 (license license:gpl2+)))
cbd9568f
TF
1063
1064(define-public guile-libctl
1065 (package
1066 (name "guile-libctl")
a7de5a50 1067 (version "4.2.0")
cbd9568f
TF
1068 (source (origin
1069 (method url-fetch)
1070 (uri
1071 (string-append
a7de5a50
JB
1072 "https://github.com/NanoComp/libctl/releases/download/v"
1073 version "/libctl-" version ".tar.gz"))
cbd9568f
TF
1074 (sha256
1075 (base32
a7de5a50 1076 "0x8r56lpfq83kfbq28vr25icl19xpfd6fjrxzcpdmv30l9pash83"))))
cbd9568f 1077 (build-system gnu-build-system)
a7de5a50
JB
1078 (arguments
1079 `(#:configure-flags '("--enable-shared")))
cbd9568f
TF
1080 (native-inputs
1081 `(("fortran" ,gfortran)))
1082 (inputs
1083 `(("guile" ,guile-2.2)))
1084 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
1085 (synopsis "Flexible control files implementation for scientific simulations")
1086 (description
1087 "Libctl is a Guile-based library implementing flexible control files
1088for scientific simulations.")
1089 (license license:gpl2+)))
5e872d4b
TF
1090
1091(define-public mpb
1092 (package
1093 (name "mpb")
e719562d 1094 (version "1.8.0")
5e872d4b
TF
1095 (source (origin
1096 (method url-fetch)
1097 (uri
1098 (string-append
e719562d
JB
1099 "https://github.com/NanoComp/mpb/releases/download/v"
1100 version "/mpb-" version ".tar.gz"))
5e872d4b
TF
1101 (sha256
1102 (base32
e719562d 1103 "1jgrb7dd6qs6j6y1gnxmdgrh79l2bvqa6nk60a4pw1annsks4brd"))))
5e872d4b
TF
1104 (build-system gnu-build-system)
1105 (arguments
1106 `(#:configure-flags
1107 (list (string-append "--with-libctl="
1108 (assoc-ref %build-inputs "libctl")
e719562d
JB
1109 "/share/libctl")
1110 "--enable-shared")))
5e872d4b
TF
1111 (native-inputs
1112 `(("fortran" ,gfortran)
1113 ("pkg-config" ,pkg-config)
1114 ("swig" ,swig)))
1115 (inputs
1116 `(("fftw" ,fftw)
1117 ("gsl" ,gsl)
1118 ("guile" ,guile-2.2)
1119 ("hdf5" ,hdf5)
1120 ("lapack" ,lapack)
1121 ("libctl" ,guile-libctl)
1122 ("readline" ,readline)
1123 ("zlib" ,zlib)))
1124 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1125 (synopsis "Computes band structures and electromagnetic modes of dielectric
1126structures")
1127 (description
1128 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1129of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1130fully-vectorial and three-dimensional methods.")
1131 (license license:gpl2+)))
28b08d2a
TF
1132
1133(define-public meep
1134 (package
1135 (name "meep")
138950a8 1136 (version "1.8.0")
28b08d2a
TF
1137 (source (origin
1138 (method url-fetch)
1139 (uri
1140 (string-append
138950a8
JB
1141 "https://github.com/NanoComp/meep/releases/download/v"
1142 version "/meep-" version ".tar.gz"))
28b08d2a
TF
1143 (sha256
1144 (base32
138950a8 1145 "14zyxmm3p80j5fz5b89sl7hgkgcisqjny5hjh4pi274ziqjqz8bm"))))
28b08d2a
TF
1146 (build-system gnu-build-system)
1147 (arguments
1148 `(#:configure-flags
1149 (list (string-append "--with-libctl="
1150 (assoc-ref %build-inputs "libctl")
1151 "/share/libctl"))))
1152 (native-inputs
1153 `(("fortran" ,gfortran)
1154 ("pkg-config" ,pkg-config)
1155 ("swig" ,swig)))
1156 (inputs
1157 `(("fftw" ,fftw)
1158 ("gsl" ,gsl)
138950a8 1159 ("guile" ,guile-2.2)
28b08d2a
TF
1160 ("harminv" ,harminv)
1161 ("hdf5" ,hdf5)
1162 ("lapack" ,lapack)
1163 ("libctl" ,guile-libctl)
1164 ("mpb" ,mpb)
1165 ("zlib" ,zlib)))
1166 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1167 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1168 (description
1169 "Meep is a finite-difference time-domain (FDTD) simulation software package
1170developed at MIT to model electromagnetic systems.")
1171 (license license:gpl2+)))
8bca358b
TF
1172
1173(define-public adms
1174 (package
1175 (name "adms")
1176 (version "2.3.6")
1177 (source (origin
1178 (method url-fetch)
1179 (uri
1180 (string-append
1181 "mirror://sourceforge/mot-adms/adms-source/"
1182 (version-major+minor version) "/adms-" version ".tar.gz"))
1183 (sha256
1184 (base32
1185 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1186 (build-system gnu-build-system)
1187 (native-inputs
1188 `(("flex" ,flex)
1189 ("bison" ,bison)))
1190 (home-page "https://sourceforge.net/projects/mot-adms")
1191 (synopsis "Automatic device model synthesizer")
1192 (description
1193 "ADMS is a code generator that converts electrical compact device models
1194specified in high-level description language into ready-to-compile C code for
1195the API of spice simulators. Based on transformations specified in XML
1196language, ADMS transforms Verilog-AMS code into other target languages.")
1197 (license license:gpl3)))
6febda94
JL
1198
1199(define-public capstone
1200 (package
1201 (name "capstone")
a7b14a1b 1202 (version "3.0.5")
6febda94
JL
1203 (source (origin
1204 (method url-fetch)
1205 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1206 version ".tar.gz"))
1207 (file-name (string-append name "-" version ".tar.gz"))
1208 (sha256
1209 (base32
a7b14a1b 1210 "1wbd1g3r32ni6zd9vwrq3kn7fdp9y8qwn9zllrrbk8n5wyaxcgci"))))
6febda94
JL
1211 (build-system gnu-build-system)
1212 (arguments
1213 `(#:tests? #f
a7b14a1b 1214 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
6febda94
JL
1215 "CC=gcc")
1216 #:phases
1217 (modify-phases %standard-phases
a7b14a1b
TGR
1218 (delete 'configure) ; no configure script
1219 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
6febda94
JL
1220 (add-before 'build 'fix-cstool-ldflags
1221 (lambda* (#:key outputs #:allow-other-keys)
a7b14a1b
TGR
1222 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1223 (assoc-ref outputs "out") "/lib"))
6febda94 1224 #t)))))
acf18cb1 1225 (home-page "https://www.capstone-engine.org")
6febda94
JL
1226 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1227 (description
1228 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1229framework. Capstone can disassemble machine code for many supported architectures
1230such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1231bindings for Python, Java, OCaml and more.")
1232 (license license:bsd-3)))
f70be011
JL
1233
1234;; FIXME: This package has a timestamp embedded in
1235;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1236(define-public python-capstone
1237 (package
1238 (inherit capstone)
1239 (name "python-capstone")
1240 (propagated-inputs
1241 `(("capstone" ,capstone)))
1242 (build-system python-build-system)
1243 (arguments
1244 `(#:phases
1245 (modify-phases %standard-phases
1246 (add-after 'unpack 'chdir-and-fix-setup-py
1247 (lambda _
1248 (chdir "bindings/python")
1249 ;; Do not build the library again, because we already have it.
1250 (substitute* "setup.py" ((".* build_libraries.*") ""))
1251 ;; This substitution tells python-capstone where to find the
1252 ;; library.
1253 (substitute* "capstone/__init__.py"
1254 (("pkg_resources.resource_filename.*")
1255 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1256 #t)))))))
1257
1258(define-public python2-capstone
1259 (package-with-python2 python-capstone))
44669577
JL
1260
1261(define-public radare2
1262 (package
1263 (name "radare2")
8dec0cdf 1264 (version "3.5.1")
44669577
JL
1265 (source (origin
1266 (method url-fetch)
a157fb27 1267 (uri (string-append "https://radare.mikelloc.com/get/" version "/"
e605820b 1268 "radare2-" version ".tar.gz"))
44669577
JL
1269 (sha256
1270 (base32
8dec0cdf 1271 "174x5545fw2nyf000gd46hi7rx2bn3bw5bsnvizn9yi99pn7m4mw"))
44669577
JL
1272 (modules '((guix build utils)))
1273 (snippet
8dec0cdf 1274 '(begin
44669577
JL
1275 (substitute* "libr/asm/p/Makefile"
1276 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1277 (substitute* "libr/parse/p/Makefile"
1278 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1279 (substitute* "libr/bin/p/Makefile"
6cbee49d
MW
1280 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1281 #t))))
44669577
JL
1282 (build-system gnu-build-system)
1283 (arguments
8dec0cdf 1284 '(#:tests? #f ; tests require git and network access
44669577
JL
1285 #:phases
1286 (modify-phases %standard-phases
1287 (add-before 'configure 'mklibdir
1288 (lambda* (#:key inputs #:allow-other-keys)
1289 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1290 #t)))
1291 #:configure-flags
1292 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1293 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1294 #:make-flags
1295 (list "CC=gcc")))
1296 (inputs
1297 `(("openssl" ,openssl)
1298 ("zip" ,zip)
1299 ("gmp" ,gmp)
1300 ("capstone" ,capstone)))
1301 (native-inputs
1302 `(("pkg-config" ,pkg-config)))
1303 (home-page "https://radare.org/")
1304 (synopsis "Portable reversing framework")
1305 (description
1306 "Radare project started as a forensics tool, a scriptable commandline
1307hexadecimal editor able to open disk files, but later support for analyzing
1308binaries, disassembling code, debugging programs, attaching to remote gdb
1309servers, ...")
1310 (license license:lgpl3)))
a6edcfaf
TF
1311
1312(define-public asco
1313 (package
1314 (name "asco")
1315 (version "0.4.10")
1316 (source (origin
1317 (method url-fetch)
1318 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1319 version ".tar.gz"))
1320 (sha256
1321 (base32
1322 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1323 (build-system gnu-build-system)
1324 (arguments
1325 `(#:tests? #f ; no tests
1326 #:make-flags '("all" "asco-mpi")
1327 #:phases
1328 (modify-phases %standard-phases
1329 (delete 'configure)
1330 (add-before 'build 'fix-paths
1331 (lambda* (#:key inputs #:allow-other-keys)
1332 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1333 (substitute* '("errfunc.c" "asco.c")
1334 (("cp ")
1335 (string-append coreutils "/bin/cp "))
1336 (("nice")
1337 (string-append coreutils "/bin/nice")))
1338 (substitute* "Makefile"
1339 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1340 #t)))
1341 (replace 'install ; no install target
1342 (lambda* (#:key outputs #:allow-other-keys)
1343 (for-each (lambda (file)
1344 (install-file file (string-append
1345 (assoc-ref outputs "out")
1346 "/bin")))
1347 '("asco" "asco-mpi" "asco-test"
1348 "tools/alter/alter" "tools/log/log"))
1349 #t)))))
1350 (native-inputs
1351 `(("mpi" ,openmpi)))
1352 (inputs
1353 `(("coreutils-minimal" ,coreutils-minimal)))
1354 (home-page "http://asco.sourceforge.net/")
1355 (synopsis "SPICE circuit optimizer")
1356 (description
1357 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1358high-performance parallel differential evolution (DE) optimization algorithm.")
1359 (license license:gpl2+)))
710cc1a4
TF
1360
1361(define-public libngspice
1362 ;; Note: The ngspice's build system does not allow us to build both the
1363 ;; library and the executables in one go. Thus, we have two packages.
1364 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1365 (package
1366 (name "libngspice")
7a83eb37 1367 (version "28")
710cc1a4
TF
1368 (source (origin
1369 (method url-fetch)
1370 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1371 version "/ngspice-" version ".tar.gz"))
1372 (sha256
1373 (base32
7a83eb37 1374 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
710cc1a4
TF
1375 (modules '((guix build utils)))
1376 ;; We remove the non-free cider and build without it.
1377 (snippet
1378 '(begin
1379 (delete-file-recursively "src/ciderlib")
1380 (delete-file "src/ciderinit")
1381 (substitute* "configure"
1382 (("src/ciderlib/Makefile") "")
1383 (("src/ciderlib/input/Makefile") "")
1384 (("src/ciderlib/support/Makefile") "")
1385 (("src/ciderlib/oned/Makefile") "")
6cbee49d
MW
1386 (("src/ciderlib/twod/Makefile") ""))
1387 #t))))
710cc1a4
TF
1388 (build-system gnu-build-system)
1389 (arguments
1390 `(;; No tests for libngspice exist.
1391 ;; The transient tests for ngspice fail.
1392 #:tests? #f
1393 #:phases
1394 (modify-phases %standard-phases
1395 (add-after 'unpack 'patch-timestamps
1396 (lambda _
1397 (substitute* "configure"
ec425ca3 1398 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
710cc1a4
TF
1399 #t))
1400 (add-after 'unpack 'delete-program-manuals
1401 (lambda _
1402 (substitute* "man/man1/Makefile.in"
1403 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1404 "man_MANS = "))
1405 #t))
1406 (add-after 'install 'delete-script-files
1407 (lambda* (#:key outputs #:allow-other-keys)
1408 (delete-file-recursively
1409 (string-append (assoc-ref outputs "out")
1410 "/share/ngspice/scripts")))))
1411 #:configure-flags
1412 (list "--enable-openmp"
1413 "--enable-xspice"
1414 "--with-ngshared"
1415 "--with-readline=yes")))
1416 (native-inputs
1417 `(("bison" ,bison)
1418 ("flex" ,flex)))
1419 (inputs
1420 `(("libxaw" ,libxaw)
1421 ("mpi" ,openmpi)
1422 ("readline" ,readline)))
1423 (home-page "http://ngspice.sourceforge.net/")
1424 (synopsis "Mixed-level/mixed-signal circuit simulator")
1425 (description
1426 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1427@code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1428provides code modeling support and simulation of digital components through
1429an embedded event driven algorithm.")
1430 (license (list license:lgpl2.0+ ; code in frontend/numparam
1431 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1432 license:public-domain)))) ; xspice
1433
1434(define-public ngspice
1435 ;; The ngspice executables (see libngpsice above.)
1436 (package (inherit libngspice)
1437 (name "ngspice")
1438 (arguments
1439 (substitute-keyword-arguments (package-arguments libngspice)
1440 ((#:configure-flags flags)
1441 `(delete "--with-ngshared" ,flags))
1442 ((#:phases phases)
1443 `(modify-phases ,phases
1444 (add-after 'unpack 'delete-include-files
1445 (lambda _
1446 (substitute* "src/Makefile.in"
1447 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1448 "SUBDIRS = misc maths frontend spicelib"))
1449 #t))
1450 (add-after 'install 'delete-cmpp-dlmain
1451 (lambda* (#:key outputs #:allow-other-keys)
1452 (for-each (lambda (file)
1453 (delete-file
1454 (string-append (assoc-ref outputs "out")
1455 file)))
1456 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1457 #t))
1458 (delete 'delete-program-manuals)
1459 (delete 'delete-script-files)))))
1460 (inputs
1461 `(("libngspice" ,libngspice)
1462 ("readline" ,readline)))))
1da02b6a
TF
1463
1464(define trilinos-serial-xyce
1465 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1466 ;; keep it private. See
1467 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1468 ;; TODO: Remove when we have modular Trilinos packages?
1469 (package
1470 (name "trilinos-serial-xyce")
d73482b4 1471 (version "12.12.1")
1da02b6a
TF
1472 (source
1473 (origin (method url-fetch)
1474 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1475 version "-Source.tar.gz"))
1476 (sha256
1477 (base32
d73482b4 1478 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1da02b6a
TF
1479 (build-system cmake-build-system)
1480 (arguments
1481 `(#:out-of-source? #t
d73482b4
TF
1482 #:phases
1483 (modify-phases %standard-phases
1484 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1485 ;; phase to fail.
1486 (add-before 'validate-runpath 'delete-tribits
1487 (lambda* (#:key outputs #:allow-other-keys)
1488 (delete-file-recursively
1489 (string-append (assoc-ref outputs "out")
1490 "/lib/cmake/tribits"))
1491 #t)))
1da02b6a
TF
1492 #:configure-flags
1493 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1494 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1495 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1496 "-DTrilinos_ENABLE_NOX=ON"
1497 "-DNOX_ENABLE_LOCA=ON"
1498 "-DTrilinos_ENABLE_EpetraExt=ON"
1499 "-DEpetraExt_BUILD_BTF=ON"
1500 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1501 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1502 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1503 "-DTrilinos_ENABLE_Ifpack=ON"
1504 "-DTrilinos_ENABLE_Isorropia=ON"
1505 "-DTrilinos_ENABLE_AztecOO=ON"
1506 "-DTrilinos_ENABLE_Belos=ON"
1507 "-DTrilinos_ENABLE_Teuchos=ON"
1508 "-DTeuchos_ENABLE_COMPLEX=ON"
1509 "-DTrilinos_ENABLE_Amesos=ON"
1510 "-DAmesos_ENABLE_KLU=ON"
1511 "-DAmesos_ENABLE_UMFPACK=ON"
1512 "-DTrilinos_ENABLE_Sacado=ON"
1513 "-DTrilinos_ENABLE_Kokkos=OFF"
1514 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1515 "-DTPL_ENABLE_AMD=ON"
1516 "-DTPL_ENABLE_UMFPACK=ON"
1517 "-DTPL_ENABLE_BLAS=ON"
1518 "-DTPL_ENABLE_LAPACK=ON")))
1519 (native-inputs
1520 `(("fortran" ,gfortran)
1521 ("swig" ,swig)))
1522 (inputs
1523 `(("boost" ,boost)
d73482b4 1524 ("lapack" ,lapack)
1da02b6a
TF
1525 ("suitesparse" ,suitesparse)))
1526 (home-page "https://trilinos.org")
1527 (synopsis "Engineering and scientific problems algorithms")
1528 (description
1529 "The Trilinos Project is an effort to develop algorithms and enabling
1530technologies within an object-oriented software framework for the solution of
1531large-scale, complex multi-physics engineering and scientific problems. A
1532unique design feature of Trilinos is its focus on packages.")
1533 (license (list license:lgpl2.1+
1534 license:bsd-3))))
1535
1536(define-public xyce-serial
1537 (package
1538 (name "xyce-serial")
ac04601a 1539 (version "6.8")
1da02b6a
TF
1540 (source
1541 (origin (method url-fetch)
1542 (uri (string-append "https://archive.org/download/Xyce-"
1543 version "/Xyce-" version ".tar.gz"))
1544 (sha256
1545 (base32
ac04601a 1546 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1da02b6a
TF
1547 (build-system gnu-build-system)
1548 (arguments
1549 `(#:tests? #f
1550 #:configure-flags
1551 (list
0fe041bd 1552 "CXXFLAGS=-O3"
1da02b6a
TF
1553 (string-append "ARCHDIR="
1554 (assoc-ref %build-inputs "trilinos")))))
1555 (native-inputs
8d564b8b 1556 `(("bison" ,bison-3.0) ;'configure' fails with Bison 3.4
1da02b6a
TF
1557 ("flex" ,flex)
1558 ("fortran" ,gfortran)))
1559 (inputs
1560 `(("fftw" ,fftw)
1561 ("suitesparse" ,suitesparse)
ac04601a 1562 ("lapack" ,lapack)
1da02b6a
TF
1563 ("trilinos" ,trilinos-serial-xyce)))
1564 (home-page "https://xyce.sandia.gov/")
1565 (synopsis "High-performance analog circuit simulator")
1566 (description
1567 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1568capable of solving extremely large circuit problems by supporting large-scale
1569parallel computing platforms. It also supports serial execution.")
1570 (license license:gpl3+)))
91cabd3e
TF
1571
1572(define trilinos-parallel-xyce
1573 (package (inherit trilinos-serial-xyce)
1574 (name "trilinos-parallel-xyce")
1575 (arguments
1576 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1577 ((#:configure-flags flags)
1578 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1579 "-DTrilinos_ENABLE_Zoltan=ON"
1580 "-DTPL_ENABLE_MPI=ON")
1581 ,flags)))))
1582 (inputs
1583 `(("mpi" ,openmpi)
1584 ,@(package-inputs trilinos-serial-xyce)))))
1585
1586(define-public xyce-parallel
1587 (package (inherit xyce-serial)
1588 (name "xyce-parallel")
1589 (arguments
1590 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1591 ((#:configure-flags flags)
0fe041bd 1592 `(list "CXXFLAGS=-O3"
91cabd3e
TF
1593 "CXX=mpiCC"
1594 "CC=mpicc"
1595 "F77=mpif77"
1596 "--enable-mpi"
91cabd3e
TF
1597 (string-append
1598 "ARCHDIR="
1599 (assoc-ref %build-inputs "trilinos")))))))
1600 (propagated-inputs
1601 `(("mpi" ,openmpi)))
1602 (inputs
1603 `(("trilinos" ,trilinos-parallel-xyce)
1604 ,@(alist-delete "trilinos"
1605 (package-inputs xyce-serial))))))
f26af33a
TF
1606
1607(define-public freehdl
1608 (package
1609 (name "freehdl")
1610 (version "0.0.8")
1611 (source (origin
1612 (method url-fetch)
1613 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1614 version ".tar.gz"))
1615 (sha256
1616 (base32
1617 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1618 (build-system gnu-build-system)
1619 (arguments
1620 `(#:phases
1621 (modify-phases %standard-phases
1622 (add-before 'configure 'patch-pkg-config
1623 (lambda* (#:key inputs #:allow-other-keys)
1624 (substitute* "freehdl/freehdl-config"
1625 (("pkg-config")
1626 (string-append (assoc-ref inputs "pkg-config")
1627 "/bin/pkg-config"))
1628 (("cat")
1629 (string-append (assoc-ref inputs "coreutils")
1630 "/bin/cat")))
1631 #t))
d3f95898
TF
1632 (add-after 'patch-pkg-config 'setenv
1633 (lambda* (#:key inputs #:allow-other-keys)
1634 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1635 "/bin/g++"))
1636 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1637 "/bin/libtool"))
1638 #t))
1639 (add-after 'setenv 'patch-gvhdl
1640 (lambda _
1641 (substitute* "v2cc/gvhdl.in"
1642 (("--mode=link") "--mode=link --tag=CXX")
1643 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1644 #t))
1645 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1646 (lambda* (#:key inputs #:allow-other-keys)
1647 (substitute* "freehdl/freehdl-gennodes.in"
1648 (("guile")
1649 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1650 (("\\(debug") ";(debug")
1651 (("\\(@ ") "(apply-emit")
1652 (("\\(@@ ") "(apply-mini-format"))
1653 #t))
f26af33a
TF
1654 (add-after 'configure 'patch-freehdl-pc
1655 (lambda* (#:key inputs #:allow-other-keys)
1656 (substitute* "freehdl.pc"
1657 (("=g\\+\\+")
d3f95898 1658 (string-append "=" (assoc-ref inputs "gcc-toolchain")
f26af33a
TF
1659 "/bin/g++"))
1660 (("=libtool")
1661 (string-append "=" (assoc-ref inputs "libtool")
1662 "/bin/libtool")))
1663 #t))
1664 (add-after 'install-scripts 'make-wrapper
d3f95898 1665 (lambda* (#:key inputs outputs #:allow-other-keys)
f26af33a 1666 (let ((out (assoc-ref outputs "out")))
d3f95898
TF
1667 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1668 ;; file name.
1669 (wrap-program (string-append out "/bin/gvhdl")
1670 `("CPLUS_INCLUDE_PATH" ":" prefix
1671 (,(string-append (assoc-ref inputs "gcc-toolchain")
1672 "/include")))
1673 `("LIBRARY_PATH" ":" prefix
1674 (,(string-append (assoc-ref inputs "gcc-toolchain")
1675 "/lib")))
1676 `("PATH" ":" prefix
1677 (,(string-append (assoc-ref inputs "gcc-toolchain")
1678 "/bin")
1679 ,(string-append (assoc-ref inputs "coreutils")
1680 "/bin"))))
f26af33a
TF
1681 (wrap-program (string-append out "/bin/freehdl-config")
1682 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1683 #t)))))
1684 (inputs
1685 `(("coreutils" ,coreutils)
40a99ca0 1686 ("gcc-toolchain" ,gcc-toolchain)
d3f95898 1687 ("guile" ,guile-2.2)
f26af33a
TF
1688 ("perl" ,perl)
1689 ("pkg-config" ,pkg-config)
1690 ("libtool" ,libtool)))
1691 (native-inputs
1692 `(("pkg-config-native" ,pkg-config)
1693 ("libtool-native" ,libtool)))
1694 (home-page "http://www.freehdl.seul.org/")
1695 (synopsis "VHDL simulator")
1696 (description
1697 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1698 VHDL'93 as well as VHDL'87 standards are supported.")
1699 (license (list license:gpl2+
1700 license:lgpl2.0+)))) ; freehdl's libraries
1701
c31b61ef 1702(define-public qucs
4f12a62d
TF
1703 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1704 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1705 ;; comment and update the package.
1706 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1707 (revision "0"))
1708 (package
1709 (name "qucs")
1710 (version (git-version "0.0.19" revision commit))
1711 (source (origin
1712 (method git-fetch)
1713 (uri (git-reference
1714 (url "https://github.com/Qucs/qucs")
1715 (commit commit)))
1716 (sha256
1717 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1718 (file-name (string-append name "-" version "-checkout"))))
1719 (build-system gnu-build-system)
1720 (arguments
1721 `(#:phases
1722 (modify-phases %standard-phases
5e881946
DM
1723 (add-before 'bootstrap 'patch-bootstrap
1724 (lambda _
1725 (for-each patch-shebang
1726 '("bootstrap"
1727 "qucs/bootstrap"
1728 "qucs-doc/bootstrap"
1729 "qucs-core/bootstrap"))
1730 #t))
4f12a62d
TF
1731 (add-before 'configure 'patch-configure
1732 (lambda* (#:key inputs #:allow-other-keys)
1733 (substitute* "qucs/configure"
1734 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1735 #t))
1736 (add-after 'patch-configure 'patch-scripts
1737 (lambda* (#:key inputs outputs #:allow-other-keys)
1738 (substitute* '("qucs/qucs/qucsdigi"
1739 "qucs/qucs/qucsdigilib"
1740 "qucs/qucs/qucsveri")
1741 (("\\$BINDIR")
1742 (string-append (assoc-ref outputs "out") "/bin"))
1743 (("freehdl-config")
1744 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1745 (("freehdl-v2cc")
1746 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1747 (("cp ")
1748 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1749 (("glibtool")
1750 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1751 (("sed")
1752 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1753 (("iverilog")
1754 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1755 (("vvp")
1756 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1757 #t))
1758 (add-before 'check 'pre-check
1759 (lambda _
1760 ;; The test suite requires a running X server.
1761 (system "Xvfb :1 &")
1762 (setenv "DISPLAY" ":1")
1763 #t))
1764 (add-after 'install 'make-wrapper
1765 (lambda* (#:key inputs outputs #:allow-other-keys)
1766 (let ((out (assoc-ref outputs "out")))
1767 ;; 'qucs' directly invokes gcc, hence this wrapping.
1768 (wrap-program (string-append out "/bin/qucs")
1769 `("CPLUS_INCLUDE_PATH" ":" prefix
1770 (,(string-append (assoc-ref inputs "gcc-toolchain")
1771 "/include")))
1772 `("PATH" ":" prefix
1773 (,(string-append (assoc-ref inputs "gcc-toolchain")
1774 "/bin")))
1775 `("LIBRARY_PATH" ":" prefix
1776 (,(string-append (assoc-ref inputs "gcc-toolchain")
1777 "/lib")))
1778 `("ADMSXMLBINDIR" ":" prefix
1779 (,(string-append (assoc-ref inputs "adms") "/bin")))
1780 `("ASCOBINDIR" ":" prefix
1781 (,(string-append (assoc-ref inputs "asco") "/bin")))
1782 `("QUCS_OCTAVE" ":" prefix
1783 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1784 #t)))
1785 #:parallel-build? #f ; race condition
1786 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1787 (native-inputs
1788 `(("autoconf" ,autoconf)
1789 ("automake" ,automake)
1790 ("bison" ,bison)
1791 ("flex" ,flex)
1792 ("gperf" ,gperf)
1793 ("libtool-native" ,libtool)
1794 ("pkg-config" ,pkg-config)
1795 ("python" ,python-2) ; for tests
1796 ("matplotlib" ,python2-matplotlib) ; for tests
1797 ("numpy" ,python2-numpy) ; for tests
ff337525 1798 ("xorg-server" ,xorg-server-for-tests))) ; for tests
4f12a62d
TF
1799 (inputs
1800 `(("adms" ,adms)
1801 ("asco" ,asco)
1802 ("coreutils" ,coreutils)
1803 ("freehdl" ,freehdl)
1804 ("gcc-toolchain" ,gcc-toolchain)
1805 ("iverilog" ,iverilog)
1806 ("libtool" ,libtool)
5537603f 1807 ("octave" ,octave-cli)
4f12a62d
TF
1808 ("qt4" ,qt-4)
1809 ("sed" ,sed)))
1810 (home-page "http://qucs.sourceforge.net/")
1811 (synopsis "Circuit simulator with graphical user interface")
1812 (description
1813 "Qucs is a circuit simulator with graphical user interface. The software
c31b61ef
TF
1814aims to support all kinds of circuit simulation types---e.g. DC, AC,
1815S-parameter, transient, noise and harmonic balance analysis. Pure digital
1816simulations are also supported.")
4f12a62d 1817 (license license:gpl2+))))
ef2c6b40
TF
1818
1819(define-public qucs-s
1820 (package
1821 (name "qucs-s")
1c8d6d6d 1822 (version "0.0.21")
ef2c6b40
TF
1823 (source (origin
1824 (method url-fetch)
394b89ae
TF
1825 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
1826 version ".tar.gz"))
1827 (file-name (string-append name "-" version ".tar.gz"))
ef2c6b40
TF
1828 (sha256
1829 (base32
1c8d6d6d 1830 "12m1jwhb9qwvb141qzyskbxnw3wn1x22d02z4b4862p7xvccl5h7"))))
ef2c6b40
TF
1831 (build-system cmake-build-system)
1832 (arguments
1833 `(#:tests? #f ; no tests
1834 #:phases
1835 (modify-phases %standard-phases
1836 (add-before 'configure 'patch-scripts
1837 (lambda* (#:key inputs #:allow-other-keys)
1838 (substitute* '("qucs/qucsdigi"
1839 "qucs/qucsdigilib"
1840 "qucs/qucsveri")
1841 (("\\$BINDIR")
1842 (string-append (assoc-ref inputs "qucs") "/bin"))
1843 (("freehdl-config")
1844 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1845 (("freehdl-v2cc")
1846 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1847 (("cp ")
1848 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1849 (("glibtool")
1850 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1851 (("sed")
1852 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1853 (("iverilog")
1854 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1855 (("vvp")
1856 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1857 #t))
1858 (add-after 'patch-scripts 'patch-paths
1859 (lambda* (#:key inputs #:allow-other-keys)
1860 (substitute* "qucs/main.cpp"
1861 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
1862 "\\+ \"qucsator\" \\+ executableSuffix"))
1863 (string-append "}{ QucsSettings.Qucsator = \""
1864 (assoc-ref inputs "qucs") "/bin/qucsator\""))
394b89ae
TF
1865 (((string-append "QucsSettings\\.XyceExecutable = "
1866 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
1867 (string-append "}{ QucsSettings.XyceExecutable = \""
ef2c6b40 1868 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
394b89ae
TF
1869 (((string-append "else QucsSettings\\.XyceParExecutable = "
1870 "\"mpirun -np %p /usr/local"
1871 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
ef2c6b40 1872 (string-append "QucsSettings.XyceParExecutable = \""
394b89ae
TF
1873 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
1874 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
ef2c6b40
TF
1875 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
1876 (string-append "QucsSettings.NgspiceExecutable = " "\""
1877 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
394b89ae
TF
1878 (substitute* "qucs/extsimkernels/ngspice.cpp"
1879 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
ef2c6b40
TF
1880 (substitute* "qucs/qucs_actions.cpp"
1881 (("qucstrans")
1882 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
1883 (("qucsattenuator")
1884 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
1885 (("qucsrescodes")
1886 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
1887 #t))
1888 (add-after 'install 'install-scripts
1889 (lambda* (#:key inputs outputs #:allow-other-keys)
1890 (for-each
1891 (lambda (script)
394b89ae 1892 (let ((file (string-append "../qucs_s-" ,version
ef2c6b40
TF
1893 "/qucs/" script))
1894 (out (assoc-ref outputs "out")))
1895 (install-file file (string-append out "/bin"))
1896 (chmod (string-append out "/bin/" script) #o555)))
1897 '("qucsdigi" "qucsdigilib" "qucsveri"))
1898 #t))
1899 (add-after 'install-scripts 'make-wrapper
1900 (lambda* (#:key inputs outputs #:allow-other-keys)
1901 (let* ((out (assoc-ref outputs "out"))
1902 (file (string-append out "/bin/qucs-s"))
1903 (qucs (assoc-ref inputs "qucs"))
1904 (qucsator (string-append qucs "/bin/qucsator")))
1905 (wrap-program file
1906 `("CPLUS_INCLUDE_PATH" ":" prefix
1907 (,(string-append (assoc-ref inputs "gcc-toolchain")
1908 "/include")))
1909 `("PATH" ":" prefix
1910 (,(string-append (assoc-ref inputs "gcc-toolchain")
1911 "/bin")))
1912 `("LIBRARY_PATH" ":" prefix
1913 (,(string-append (assoc-ref inputs "gcc-toolchain")
1914 "/lib")))
1915 `("QUCSATOR" ":" prefix (,qucsator))
1916 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
1917 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
1918 "/bin")))
1919 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
1920 "/bin")))
1921 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
1922 "/bin/octave"))))
1923 (symlink qucsator (string-append out "/bin/qucsator"))
1924 #t))))))
1925 (native-inputs
1926 `(("libtool-native" ,libtool)))
1927 (inputs
1928 `(("adms" ,adms)
1929 ("asco" ,asco)
1930 ("coreutils" ,coreutils)
1931 ("freehdl" ,freehdl)
1932 ("gcc-toolchain" ,gcc-toolchain)
1933 ("iverilog" ,iverilog)
1934 ("libtool" ,libtool)
1935 ("mpi" ,openmpi)
1936 ("ngspice" ,ngspice)
5537603f 1937 ("octave" ,octave-cli)
ef2c6b40
TF
1938 ("qt4" ,qt-4)
1939 ("qucs" ,qucs)
1940 ("sed" ,sed)
1941 ("xyce-serial" ,xyce-serial)
1942 ("xyce-parallel" ,xyce-parallel)))
1943 (home-page "https://ra3xdh.github.io/")
1944 (synopsis "Circuit simulator with graphical user interface")
1945 (description
1946 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
1947The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
1948free SPICE circuit simulation kernels with the Qucs GUI. It provides the
1949simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
1950 (license license:gpl2+)))
63b69574
AI
1951
1952(define-public librepcb
1953 (package
1954 (name "librepcb")
7c93edb9 1955 (version "0.1.2")
63b69574
AI
1956 (source
1957 (origin
1958 (method url-fetch)
9be92490
AI
1959 (uri (string-append "https://download.librepcb.org/releases/"
1960 version "/librepcb-" version "-source.zip"))
63b69574
AI
1961 (sha256
1962 (base32
7c93edb9 1963 "1xgk0r3nxdd2cy7d1k165d005gsngnz1v2wbwivacw7gis0i8ip7"))))
63b69574
AI
1964 (build-system gnu-build-system)
1965 (inputs
1966 `(("qtbase" ,qtbase)
1967 ("zlib" ,zlib)))
1968 (native-inputs
1969 `(("qttools" ,qttools) ; for lrelease
1970 ("unzip" ,unzip)))
1971 (arguments
1972 `(#:phases
1973 (modify-phases %standard-phases
1974 (replace 'configure
1975 (lambda* (#:key inputs outputs #:allow-other-keys)
1976 (mkdir-p "build")
1977 (chdir "build")
1978 (let ((lrelease (string-append (assoc-ref inputs "qttools")
1979 "/bin/lrelease"))
1980 (out (assoc-ref outputs "out")))
1981 (invoke "qmake"
1982 (string-append "QMAKE_LRELEASE=" lrelease)
1983 (string-append "PREFIX=" out)
1984 "../librepcb.pro")))))))
1985 (home-page "https://librepcb.org/")
1986 (synopsis "Electronic Design Automation tool")
1987 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
1988software to develop printed circuit boards. It features human readable file
1989formats and complete project management with library, schematic and board
1990editors.")
1991 (license (list license:gpl3+
1992 license:boost1.0 ; libs/clipper,
1993 ; libs/optional/tests/catch.hpp,
1994 ; libs/sexpresso/tests/catch.hpp
1995 license:expat ; libs/delaunay-triangulation,
1996 ; libs/parseagle, libs/type_safe
1997 license:asl2.0 ; libs/fontobene, libs/googletest,
1998 ; libs/parseagle
1999 license:isc ; libs/hoedown
2000 license:cc0 ; libs/optional, libs/sexpresso
2001 license:bsd-2 ; libs/optional/tests/catch.hpp
2002 license:lgpl2.1+)))) ; libs/quazip
6f8ade6e
TS
2003
2004(define-public gpx
2005 (package
2006 (name "gpx")
2007 (version "2.5.2")
2008 (source (origin
2009 (method git-fetch)
2010 (uri (git-reference
2011 (url "https://github.com/markwal/GPX.git")
2012 (commit version)))
f1d4d79f 2013 (file-name (git-file-name name version))
6f8ade6e
TS
2014 (sha256
2015 (base32
2016 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
2017 (build-system gnu-build-system)
2018 (home-page "https://github.com/markwal/GPX")
2019 (synopsis "Converting gcode to x3g files for 3D printing")
2020 (description
2021 "GPX is a post processing utility for converting gcode output from 3D
2022slicing software to x3g files for standalone 3D printing on common 3D
2023printers.")
2024 (license license:gpl2+)))
356b32b9
AI
2025
2026(define-public gnucap
2027 (package
2028 (name "gnucap")
2029 (version "20171003")
2030 (source
2031 (origin
2032 (method url-fetch)
2033 (uri (string-append "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/gnucap-"
2034 version ".tar.gz"))
2035 (sha256
2036 (base32
2037 "16m09xa685qhj5fqq3bcgakrwnb74xhf5f7rpqkkf9fg8plzbb1g"))))
2038 (build-system gnu-build-system)
2039 (inputs
2040 `(("readline" ,readline)))
2041 (arguments
2042 `(#:phases
2043 (modify-phases %standard-phases
2044 (replace 'configure
2045 (lambda* (#:key outputs #:allow-other-keys)
2046 (let ((out (assoc-ref outputs "out")))
2047 ;; Set correct rpath so that gnucap finds libgnucap.so.
2048 (substitute* (list "apps/configure" "lib/configure"
2049 "main/configure" "modelgen/configure")
2050 (("LDFLAGS =")
2051 (string-append "LDFLAGS = -Wl,-rpath=" out "/lib")))
2052 ;; gnucap uses a hand-written configure script that expects the
2053 ;; --prefix argument to be the first argument passed to it.
2054 (invoke "./configure" (string-append "--prefix=" out)))))
2055 (replace 'check
2056 (lambda* (#:key outputs #:allow-other-keys)
2057 (let ((out (assoc-ref outputs "out"))
2058 (libpath "../lib/O:../apps/O"))
2059 (with-directory-excursion "tests"
2060 ;; Make test return non-zero exit code when a test fails.
2061 (substitute* "test"
2062 (("/bin/sh") "/bin/sh -e")
2063 (("\\|\\| echo \"\\*\\*\\*\\* \\$ii fails \\*\\*\\*\\*\"") ""))
2064 ;; Fix expected plugin search path for test c_attach.1.gc
2065 (substitute* "==out/c_attach.1.gc.out"
2066 (("/usr/local/lib/gnucap")
2067 (string-append libpath ":" out "/lib/gnucap")))
2068 ;; Set library path so that gnucap can find libgnucap.so
2069 ;; while running the tests.
2070 (setenv "LD_LIBRARY_PATH" libpath)
2071 (invoke "./test" "../main/O/gnucap" "" "test-output" "==out"))))))))
2072 (home-page "https://www.gnu.org/software/gnucap/")
2073 (synopsis "Mixed analog and digital circuit simulator")
2074 (description "GNUcap is a circuit analysis package. It offers a general
2075purpose circuit simulator and can perform DC and transient analyses, fourier
2076analysis and AC analysis. The engine is designed to do true mixed-mode
2077simulation.")
2078 (license license:gpl3+)))
5cded306
JL
2079
2080(define-public cutter
2081 (package
2082 (name "cutter")
2083 (version "1.8.3")
2084 (source
2085 (origin
2086 (method git-fetch)
2087 (uri (git-reference
2088 (url "https://github.com/radareorg/cutter")
2089 (commit (string-append "v" version))))
2090 (file-name (git-file-name name version))
2091 (sha256
2092 (base32
2093 "03f3cdckh51anx9gd1b0ndb2fg7061hqngvygf32ky29mm2m2lyv"))))
2094 (build-system gnu-build-system)
2095 (arguments
2096 `(#:phases
2097 (modify-phases %standard-phases
2098 (replace 'configure
2099 (lambda* (#:key inputs outputs #:allow-other-keys)
2100 (let ((out (assoc-ref outputs "out"))
2101 (radare2 (assoc-ref inputs "radare2")))
2102 ;; fix pkg-config detection ./src/lib_radare2.pri:PREFIX=/usr/lib
2103 ;; override `qmake PREFIX=`
2104 (substitute* "./src/lib_radare2.pri"
2105 (("PREFIX") "R2PREFIX")
2106 (("R2PREFIX=/usr") (string-append "R2PREFIX=" radare2)))
2107 (invoke "qmake"
2108 (string-append "PREFIX=" out)
2109 "./src/Cutter.pro")))))))
2110 (native-inputs
2111 `(("pkg-config" ,pkg-config)))
2112 (inputs
2113 `(("qtbase" ,qtbase)
2114 ("qtsvg" ,qtsvg)
2115 ("openssl" ,openssl)
2116 ("radare2" ,radare2)))
2117 (home-page "https://github.com/radareorg/cutter")
2118 (synopsis "GUI for radare2 reverse engineering framework")
2119 (description "Cutter is a GUI for radare2 reverse engineering framework.
2120Its goal is making an advanced andcustomizable reverse-engineering platform
2121while keeping the user experience at mind. Cutter is created by reverse
2122engineers for reverse engineers.")
2123 (license (list license:cc-by-sa3.0 ;the "Iconic" icon set
2124 license:gpl3+)))) ;everything else
2c0040ae
SS
2125
2126(define-public lib3mf
2127 (package
2128 (name "lib3mf")
2129 (version "1.8.1")
2130 (source
2131 (origin
2132 (method git-fetch)
2133 (uri (git-reference (url "https://github.com/3MFConsortium/lib3mf.git")
2134 (commit (string-append "v" version))))
2135 (file-name (git-file-name name version))
2136 (sha256
2137 (base32
2138 "11wpk6n9ga2p57h1dcrp37w77mii0r7r6mlrgmykf7rvii1rzgqd"))))
2139 (build-system cmake-build-system)
2140 (native-inputs
2141 `(("googletest-source" ,(package-source googletest))))
2142 (inputs
2143 `(("libuuid" ,util-linux)))
2144 (arguments
2145 `(#:phases
2146 (modify-phases %standard-phases
2147 (add-after 'unpack 'unpack-googletest
2148 (lambda* (#:key inputs #:allow-other-keys)
2149 (copy-recursively (assoc-ref inputs "googletest-source")
2150 "UnitTests/googletest")
2151 #t)))))
2152 (synopsis "Implementation of the 3D Manufacturing Format (3MF) file standard")
2153 (description
2154 "Lib3MF is a C++ implementation of the 3D Manufacturing Format (3MF) file
2155standard. It offers a way to integrate 3MF reading and writing capabilities, as
2156well as conversion and validation tools for input and output data. The
2157specification can be downloaded at @url{http://3mf.io/specification/}.")
2158 (home-page "https://3mf.io/")
2159 (license license:bsd-2)))
2316ce51
SS
2160
2161(define-public openscad
2162 (package
2163 (name "openscad")
2164 (version "2019.05")
2165 (source
2166 (origin
2167 (method url-fetch)
2168 (uri (string-append "https://files.openscad.org/openscad-" version
2169 ".src.tar.gz"))
2170 (sha256
2171 (base32
2172 "0nbgk5q5pgnw53la0kccdcpz2f4xf6d6076rkn0q08z57hkc85ha"))))
2173 (build-system cmake-build-system)
2174 (inputs
2175 `(("boost" ,boost)
2176 ("cgal" ,cgal)
2177 ("double-conversion" ,double-conversion)
2178 ("eigen" ,eigen)
2179 ("fontconfig" ,fontconfig)
2180 ("glew" ,glew)
2181 ("gmp" ,gmp)
2182 ("harfbuzz" ,harfbuzz)
2183 ("lib3mf" ,lib3mf)
2184 ("libxml2" ,libxml2)
2185 ("libzip" ,libzip)
2186 ("mpfr" ,mpfr)
2187 ("opencsg" ,opencsg)
2188 ("qscintilla" ,qscintilla)
2189 ("qtbase" ,qtbase)
2190 ("qtmultimedia" ,qtmultimedia)))
2191 (native-inputs
2192 `(("bison" ,bison)
2193 ("flex" ,flex)
2194 ("gettext" ,gettext-minimal)
2195 ("pkg-config" ,pkg-config)
2196 ("which" ,which)
2197 ;; the following are only needed for tests
2198 ("imagemagick" ,imagemagick)
2199 ("ps" ,procps)
2200 ("python" ,python)
ff337525 2201 ("xvfb" ,xorg-server-for-tests)))
2316ce51
SS
2202 (arguments
2203 `(#:phases
2204 (modify-phases %standard-phases
2205 (replace 'configure
2206 (lambda* (#:key outputs #:allow-other-keys)
2207 (invoke "qmake"
2208 (string-append "PREFIX=" (assoc-ref outputs "out")))
2209 #t))
2210 (replace 'check
2211 (lambda _
2212 (with-directory-excursion "tests"
2213 (invoke "cmake" ".")
2214 (invoke "make")
2215 (invoke "ctest"))
2216 ;; strip python test files since lib dir ends up in out/share
2217 (for-each delete-file
2218 (find-files "libraries/MCAD" ".*\\.py"))
2219 #t)))))
2220 (synopsis "Script-based 3D modeling application")
2221 (description
2222 "OpenSCAD is a 3D Computer-aided Design (CAD) application. Unlike an
2223interactive modeler, OpenSCAD generates 3D models from a script, giving you
2224full programmatic control over your models.")
2225 (home-page "https://www.openscad.org/")
2226 (license license:gpl2+)))
2895a87f 2227
4cd9de60
JS
2228(define-public freecad
2229 (package
2230 (name "freecad")
ae5525c5 2231 (version "0.18.4")
4cd9de60
JS
2232 (source
2233 (origin
2234 (method git-fetch)
2235 (uri (git-reference
2236 (url "https://github.com/FreeCAD/FreeCAD.git")
2237 (commit version)))
2238 (file-name (git-file-name name version))
2239 (sha256
2240 (base32
ae5525c5 2241 "170hk1kgrvsddrwykp24wyj0cha78zzmzbf50gn98x7ngqqs395s"))))
4cd9de60
JS
2242 (build-system cmake-build-system)
2243 (native-inputs
2244 `(("doxygen" ,doxygen)
2245 ("graphviz" ,graphviz)
2246 ("qttools" ,qttools)
2247 ("pkg-config" ,pkg-config)
2248 ("swig" ,swig)))
2249 (inputs
2250 `(("boost" ,boost)
2251 ("coin3D" ,coin3D)
2252 ("eigen" ,eigen)
2253 ("freetype" ,freetype)
2254 ("glew" ,glew)
2255 ("hdf5" ,hdf5-1.10)
2256 ("libarea" ,libarea)
2257 ("libmedfile" ,libmedfile)
2258 ("libspnav" ,libspnav)
2259 ("libxi" ,libxi)
2260 ("libxmu" ,libxmu)
2261 ("openmpi" ,openmpi)
2262 ("opencascade-occt" ,opencascade-occt)
2263 ("python-matplotlib" ,python-matplotlib)
2264 ("python-pyside-2" ,python-pyside-2)
2265 ("python-pyside-2-tools" ,python-pyside-2-tools)
2266 ("python-shiboken-2" ,python-shiboken-2)
2267 ("python-wrapper" ,python-wrapper)
2268 ("qtbase" ,qtbase)
2269 ("qtsvg" ,qtsvg)
2270 ("qtx11extras" ,qtx11extras)
2271 ("qtxmlpatterns" ,qtxmlpatterns)
2272 ;; qtwebkit is optional. We remove it currently, because it takes
2273 ;; much time to compile and substitutes are often unavailable
2274 ;;("qtwebkit" ,qtwebkit)
2275 ("tbb" ,tbb)
2276 ("vtk" ,vtk)
2277 ("xerces-c" ,xerces-c)
2278 ("zlib" ,zlib)))
2279 (arguments
2280 `(#:tests? #f
2281 #:configure-flags
2282 (list
2283 "-DBUILD_QT5=ON"
2284 (string-append "-DCMAKE_INSTALL_LIBDIR="
2285 (assoc-ref %outputs "out") "/lib"))
2286 #:phases
2287 (modify-phases %standard-phases
2288 (add-before 'configure 'restore-pythonpath
2289 (lambda _
2290 (substitute* "src/Main/MainGui.cpp"
2291 (("_?putenv\\(\"PYTHONPATH=\"\\);") ""))
2292 #t))
2293 (add-after 'install 'wrap-pythonpath
2294 (lambda* (#:key outputs #:allow-other-keys)
2295 (let ((out (assoc-ref outputs "out")))
2296 (wrap-program (string-append out "/bin/FreeCAD")
2297 (list "PYTHONPATH"
2298 'prefix (list (getenv "PYTHONPATH")))))
2299 #t)))))
2300 (home-page "https://www.freecadweb.org/")
2301 (synopsis "Your Own 3D Parametric Modeler")
2302 (description
2303 "FreeCAD is a general purpose feature-based, parametric 3D modeler for
2304CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering and
2305product design but also fits a wider range of uses in engineering, such as
2306architecture or other engineering specialties. It is 100% Open Source (LGPL2+
2307license) and extremely modular, allowing for very advanced extension and
2308customization.")
2309 (license
2310 (list
2311 license:lgpl2.1+
2312 license:lgpl2.0+
2313 license:gpl3+
2314 license:bsd-3))))
2315
704853fb
JS
2316(define-public libmedfile
2317 (package
2318 (name "libmedfile")
2319 (version "4.0.0")
2320 (source
2321 (origin
2322 (method url-fetch)
2323 (uri (string-append
2324 "https://files.salome-platform.org/Salome/other/med-"
2325 version ".tar.gz"))
2326 (sha256
2327 (base32
2328 "017h9p0x533fm4gn6pwc8kmp72rvqmcn6vznx72nkkl2b05yjx54"))))
2329 (build-system cmake-build-system)
2330 (inputs `(("hdf5" ,hdf5-1.10)))
2331 (arguments
2332 `(#:phases
2333 (modify-phases %standard-phases
2334 (add-after 'install 'remove-test-output
2335 (lambda* (#:key outputs #:allow-other-keys)
2336 (let ((out (assoc-ref outputs "out")))
2337 (delete-file-recursively
2338 (string-append out "/bin/testc"))
2339 #t))))))
2340 (home-page "https://www.salome-platform.org")
2341 (synopsis "Library to read and write MED files")
2342 (description
2343 "The purpose of the MED module is to provide a standard for storing and
2344recovering computer data associated to numerical meshes and fields, and to
2345facilitate the exchange between codes and solvers.
2346
2347The persistent data storage is based upon HDF format (like CGNS, a standard
2348developed by Boeing and NASA in the area of Computational Fluid Dynamic).
2349
2350MED also provides structures to hold data on meshes and fields. These
2351structures are exchanged between solvers, hide the communication level (CORBA
2352or MPI), and offer persistence (read/write in .med files).
2353
2354The main benefit of a common exchange format is reduced complexity of code
2355coupling. It also allows sharing such high level functionalities as
2356computation of nodal connectivity of sub-elements (faces and edges),
2357arithmetic operations on fields, entity location functionalities, and
2358interpolation toolkit.")
2359 (license license:gpl3+)))
2360
2003e837
JS
2361(define-public libarea
2362 (let ((revision "1")
2363 (commit "8f8bac811c10f1f01fda0d742a18591f61dd76ee"))
2364 (package
2365 (name "libarea")
2366 (version (git-version "0" revision commit))
2367 (source
2368 (origin
2369 (method git-fetch)
2370 (uri (git-reference (url "https://github.com/Heeks/libarea.git")
2371 (commit commit)))
2372 (file-name (git-file-name name version))
2373 (sha256
2374 (base32 "0pvqz6cabxqdz5y26wnj6alkn8v5d7gkx0d3h8xmg4lvy9r3kh3g"))))
2375 (build-system gnu-build-system)
2376 (inputs `(("boost" ,boost)
2377 ("python-wrapper" ,python-wrapper)))
2378 (native-inputs
2379 `(("cmake" ,cmake)))
2380 (arguments
2381 `(#:tests? #f
2382 #:phases
2383 (modify-phases %standard-phases
2384 (add-after 'configure 'cmake-configure
2385 (lambda* (#:key inputs outputs #:allow-other-keys)
2386 (let ((out (assoc-ref outputs "out"))
2387 (cmake (assoc-ref inputs "cmake")))
2388 (mkdir-p "build")
2389 (invoke "cmake"
2390 (string-append "-DCMAKE_INSTALL_PREFIX=" out)))))
2391 (delete 'configure))))
2392 (home-page "https://github.com/Heeks/libarea")
2393 (synopsis
2394 "Library and python module for pocketing and profiling operations")
2395 (description
2396 "Area is a CAM-related software for pocketing operation.
2397
2398This project provides library and associated python-module to compute pocket
2399operations.")
2400 (license (list
2401 license:bsd-3
2402 license:gpl3+)))))
2403
2895a87f
JS
2404(define-public libspnav
2405 (package
2406 (name "libspnav")
2407 (version "0.2.3")
2408 (source (origin
2409 (method git-fetch)
2410 (uri (git-reference
2411 (url "https://github.com/FreeSpacenav/libspnav.git")
2412 (commit (string-append "libspnav-" version))))
2413 (sha256
2414 (base32
2415 "098h1jhlj87axpza5zgy58prp0zn94wyrbch6x0s7q4mzh7dc8ba"))
2416 (file-name (git-file-name name version))))
2417 (build-system gnu-build-system)
2418 (inputs
2419 `(("libx11" ,libx11)))
2420 (arguments `(#:tests? #f))
2421 (home-page "http://spacenav.sourceforge.net/")
2422 (synopsis
2423 "Library for communicating with spacenavd or 3dxsrv")
2424 (description
2425 "The libspnav library is provided as a replacement of the magellan
2426library. It provides a cleaner, and more orthogonal interface. libspnav
2427supports both the original X11 protocol for communicating with the driver, and
2428the new alternative non-X protocol. Programs that choose to use the X11
2429protocol, are automatically compatible with either the free spacenavd driver
2430or the official 3dxserv, as if they were using the magellan SDK.
2431
2432Also, libspnav provides a magellan API wrapper on top of the new API. So, any
2433applications that were using the magellan library, can switch to libspnav
18a69803 2434without any changes. And programmers that are familiar with the magellan API
2895a87f
JS
2435can continue using it with a free library without the restrictions of the
2436official SDK.")
2437 (license license:bsd-3)))