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