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