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