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