Merge branch 'master' into staging
[jackhill/guix/guix.git] / gnu / packages / engineering.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
4 ;;; Copyright © 2016, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <theodoros@foradis.org>
8 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
9 ;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
11 ;;; Copyright © 2018, 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
12 ;;; Copyright © 2018, 2019, 2020 Arun Isaac <arunisaac@systemreboot.net>
13 ;;; Copyright © 2019 Tim Stahel <swedneck@swedneck.xyz>
14 ;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
15 ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
16 ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
17 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
18 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
19 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
20 ;;; Copyright © 2020 Ekaitz Zarraga <ekaitz@elenq.tech>
21 ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
22 ;;; Copyright © 2020 Vinicius Monego <monego@posteo.net>
23 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
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
40 (define-module (gnu packages engineering)
41 #:use-module (guix packages)
42 #:use-module (guix download)
43 #:use-module (guix gexp)
44 #:use-module (guix git-download)
45 #:use-module (guix svn-download)
46 #:use-module (guix monads)
47 #:use-module (guix store)
48 #:use-module (guix utils)
49 #:use-module ((srfi srfi-1) #:hide (zip))
50 #:use-module ((guix licenses) #:prefix license:)
51 #:use-module (guix build-system ant)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system gnu)
54 #:use-module (guix build-system python)
55 #:use-module (guix build-system qt)
56 #:use-module (gnu packages)
57 #:use-module (gnu packages algebra)
58 #:use-module (gnu packages autotools)
59 #:use-module (gnu packages base)
60 #:use-module (gnu packages bdw-gc)
61 #:use-module (gnu packages bison)
62 #:use-module (gnu packages boost)
63 #:use-module (gnu packages check)
64 #:use-module (gnu packages cmake)
65 #:use-module (gnu packages commencement)
66 #:use-module (gnu packages compression)
67 #:use-module (gnu packages curl)
68 #:use-module (gnu packages dejagnu)
69 #:use-module (gnu packages digest)
70 #:use-module (gnu packages documentation)
71 #:use-module (gnu packages flex)
72 #:use-module (gnu packages fontutils)
73 #:use-module (gnu packages fpga)
74 #:use-module (gnu packages freedesktop)
75 #:use-module (gnu packages gcc)
76 #:use-module (gnu packages gd)
77 #:use-module (gnu packages geo)
78 #:use-module (gnu packages gettext)
79 #:use-module (gnu packages ghostscript)
80 #:use-module (gnu packages gl)
81 #:use-module (gnu packages glib)
82 #:use-module (gnu packages gnome)
83 #:use-module (gnu packages gperf)
84 #:use-module (gnu packages graphics)
85 #:use-module (gnu packages graphviz)
86 #:use-module (gnu packages groff)
87 #:use-module (gnu packages gtk)
88 #:use-module (gnu packages guile)
89 #:use-module (gnu packages image)
90 #:use-module (gnu packages image-processing)
91 #:use-module (gnu packages imagemagick)
92 #:use-module (gnu packages libevent)
93 #:use-module (gnu packages linux) ;FIXME: for pcb
94 #:use-module (gnu packages lisp)
95 #:use-module (gnu packages m4)
96 #:use-module (gnu packages maths)
97 #:use-module (gnu packages man)
98 #:use-module (gnu packages multiprecision)
99 #:use-module (gnu packages mpi)
100 #:use-module (gnu packages ncurses)
101 #:use-module (gnu packages parallel)
102 #:use-module (gnu packages pcre)
103 #:use-module (gnu packages perl)
104 #:use-module (gnu packages pkg-config)
105 #:use-module (gnu packages python)
106 #:use-module (gnu packages python-xyz)
107 #:use-module (gnu packages qt)
108 #:use-module (gnu packages readline)
109 #:use-module (gnu packages swig)
110 #:use-module (gnu packages tbb)
111 #:use-module (gnu packages tcl)
112 #:use-module (gnu packages texinfo)
113 #:use-module (gnu packages tls)
114 #:use-module (gnu packages tex)
115 #:use-module (gnu packages version-control)
116 #:use-module (gnu packages web)
117 #:use-module (gnu packages wxwidgets)
118 #:use-module (gnu packages xml)
119 #:use-module (gnu packages openkinect)
120 #:use-module (gnu packages xorg))
121
122 (define-public librecad
123 (package
124 (name "librecad")
125 (version "2.1.3")
126 (source (origin
127 (method url-fetch)
128 (uri (string-append
129 "https://github.com/LibreCAD/LibreCAD/archive/"
130 version ".tar.gz"))
131 (file-name (string-append name "-" version ".tar.gz"))
132 (sha256
133 (base32
134 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
135 (build-system gnu-build-system)
136 (arguments
137 '(#:phases
138 (modify-phases %standard-phases
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))
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))
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))
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))))))
190 (inputs
191 `(("boost" ,boost)
192 ("muparser" ,muparser)
193 ("freetype" ,freetype)
194 ("qtbase" ,qtbase)
195 ("qtsvg" ,qtsvg)))
196 (native-inputs
197 `(("pkg-config" ,pkg-config)
198 ("which" ,which)))
199 (home-page "https://librecad.org/")
200 (synopsis "Computer-aided design (CAD) application")
201 (description
202 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
203 plans and designs.")
204 (license license:gpl2)))
205
206 (define-public geda-gaf
207 (package
208 (name "geda-gaf")
209 (version "1.10.0")
210 (source (origin
211 (method url-fetch)
212 (uri (string-append
213 "http://ftp.geda-project.org/geda-gaf/stable/v"
214 (version-major+minor version) "/"
215 version "/geda-gaf-" version ".tar.gz"))
216 (sha256
217 (base32
218 "06ivgarvwbzjz2wigxzzkm8iszldi2p6x3a6jnlczjyrz4csddsy"))))
219 (build-system gnu-build-system)
220 (arguments
221 '(#:phases
222 (modify-phases %standard-phases
223 ;; tests require a writable HOME
224 (add-before 'check 'set-home
225 (lambda _
226 (setenv "HOME" (getenv "TMPDIR"))
227 #t))
228 (add-after 'unpack 'disable-failing-tests
229 (lambda _
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)))
236 #t)))
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")))))
243 (inputs
244 `(("gamin" ,gamin)
245 ("glib" ,glib)
246 ("gtk" ,gtk+-2)
247 ("guile" ,guile-2.0)
248 ("shared-mime-info" ,shared-mime-info)
249 ("m4" ,m4)
250 ("pcb" ,pcb)
251 ("python" ,python-2))) ; for xorn
252 (native-inputs
253 `(("pkg-config" ,pkg-config)
254 ("desktop-file-utils" ,desktop-file-utils)
255 ("perl" ,perl))) ; for tests
256 (home-page "http://geda-project.org/")
257 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
258 (description
259 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
260 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
261 which currently includes: gschem, a schematic capture program; gnetlist, a
262 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
263 gattrib, a spreadsheet programm that manipulates the properties of symbols of
264 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
265 tool to forward annotation from your schematic to layout using PCB; some minor
266 utilities.")
267 (license license:gpl2+)))
268
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")
275 (version "1.9.11-20200604")
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
282 "091y8h7wcr9smwhb1wf12sj27n5jrannbj3y6qq3q2gwiifiz8sd"))
283 (file-name (git-file-name name version))))
284 (native-inputs
285 `(("autoconf" ,autoconf)
286 ("automake" ,automake)
287 ("desktop-file-utils" ,desktop-file-utils)
288 ("libtool" ,libtool)
289 ("gettext" ,gettext-minimal)
290 ("texinfo" ,texinfo)
291 ("groff" ,groff)
292 ("which" ,which)
293 ,@(package-native-inputs geda-gaf)))
294 (inputs
295 `(("glib" ,glib)
296 ("gtk" ,gtk+-2)
297 ("guile" ,guile-2.2)
298 ("shared-mime-info" ,shared-mime-info)
299 ("m4" ,m4)
300 ("pcb" ,pcb)))
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)
312 `(modify-phases %standard-phases
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\"~%")))
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 ".*"))
345 #t))))))
346 (description
347 "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
348 forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
349 design, schematic capture, simulation, prototyping, and production. Lepton
350 EDA includes tools for schematic capture, attribute management, bill of
351 materials (BOM) generation, netlisting into over 20 netlist formats, analog
352 and digital simulation, and printed circuit board (PCB) layout, and many other
353 features.")))
354
355 (define-public pcb
356 (package
357 (name "pcb")
358 (version "4.0.2")
359 (source (origin
360 (method url-fetch)
361 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
362 "/pcb-" version ".tar.gz"))
363 (sha256
364 (base32
365 "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
366 (build-system gnu-build-system)
367 (arguments
368 `(#:phases
369 (modify-phases %standard-phases
370 (add-after 'unpack 'use-wish8.6
371 (lambda _
372 (substitute* "configure"
373 (("wish85") "wish8.6"))
374 #t))
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))
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)))))
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)
406 ("shared-mime-info" ,shared-mime-info)
407 ("tk" ,tk)))
408 (native-inputs
409 `(("pkg-config" ,pkg-config)
410 ("intltool" ,intltool)
411 ("bison" ,bison)
412 ("desktop-file-utils" ,desktop-file-utils)
413 ("flex" ,flex)
414 ;; For tests
415 ("imagemagick" ,imagemagick)
416 ("gerbv" ,gerbv)
417 ("ghostscript" ,ghostscript)
418 ("xvfb" ,xorg-server-for-tests)))
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
423 layouts. It features a rats-nest implementation, schematic/netlist import,
424 and design rule checking. It also includes an autorouter and a trace
425 optimizer; and it can produce photorealistic and design review images.")
426 (license license:gpl2+)))
427
428 (define-public pcb-rnd
429 (package (inherit pcb)
430 (name "pcb-rnd")
431 (version "2.2.4")
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
438 "06ylc2rd4yvzp3krk62q9dbi13h0yq1x257fbjkh10vfjn0ga5c2"))))
439 (arguments
440 `(#:tests? #f ; no check target
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)
448 (invoke "sh" "configure"
449 (string-append "--prefix="
450 (assoc-ref outputs "out"))))))))
451 (home-page "http://repo.hu/projects/pcb-rnd/")
452 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
453 featuring various improvements and bug fixes.")))
454
455 (define-public fastcap
456 (package
457 (name "fastcap")
458 (version "2.0-18Sep92")
459 (source (origin
460 (method url-fetch/tarbomb)
461 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
462 name "-" version ".tgz"))
463 (sha256
464 (base32
465 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
466 (snippet
467 ;; Remove a non-free file.
468 '(begin
469 (delete-file "doc/psfig.sty")
470 #t))
471 (patches (search-patches "fastcap-mulSetup.patch"
472 "fastcap-mulGlobal.patch"))))
473 (build-system gnu-build-system)
474 (native-inputs
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.
478 `(("texlive" ,(texlive-union (list texlive-fonts-amsfonts)))
479 ("ghostscript" ,ghostscript)))
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
489 (lambda _
490 (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
491 (add-before 'make-doc 'fix-doc
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))
521 (delete 'configure)
522 (add-before 'install 'clean-bin
523 (lambda _
524 (delete-file (string-append (getcwd) "/bin/README"))
525 #t))
526 (add-before 'install 'make-pdf
527 (lambda _
528 (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
529 (with-directory-excursion "doc"
530 (and
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")))))
538 (replace 'install
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))))))
552 (home-page "https://www.rle.mit.edu/cpg/research_codes.htm")
553 (synopsis "Multipole-accelerated capacitance extraction program")
554 (description
555 "Fastcap is a capacitance extraction program based on a
556 multipole-accelerated algorithm.")
557 (license (license:non-copyleft #f "See fastcap.c."))))
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"))
571 (patches (search-patches "fasthenry-spAllocate.patch"
572 "fasthenry-spBuild.patch"
573 "fasthenry-spUtils.patch"
574 "fasthenry-spSolve.patch"
575 "fasthenry-spFactor.patch"))))
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"
594 (for-each (lambda (f)
595 (install-file f bin))
596 (find-files "." ".*")))
597 (copy-recursively "doc" doc)
598 (copy-recursively "examples" examples)
599 #t))))))
600 (home-page "https://www.rle.mit.edu/cpg/research_codes.htm")
601 (synopsis "Multipole-accelerated inductance analysis program")
602 (description
603 "Fasthenry is an inductance extraction program based on a
604 multipole-accelerated algorithm.")
605 (license (license:non-copyleft #f "See induct.c."))))
606
607 (define-public fritzing
608 (package
609 (name "fritzing")
610 (version "0.9.3b")
611 (source (origin
612 (method git-fetch)
613 (uri (git-reference
614 (url "https://github.com/fritzing/fritzing-app")
615 (commit version)))
616 (file-name (git-file-name name version))
617 (sha256
618 (base32
619 "0hpyc550xfhr6gmnc85nq60w00rm0ljm0y744dp0z88ikl04f4s3"))))
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)
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")))))))
652 (inputs
653 `(("qtbase" ,qtbase)
654 ("qtserialport" ,qtserialport)
655 ("qtsvg" ,qtsvg)
656 ("libgit2" ,libgit2)
657 ("boost" ,boost)
658 ("zlib" ,zlib)
659 ("fritzing-parts-db"
660 ,(origin
661 (method git-fetch)
662 (uri (git-reference
663 (url "https://github.com/fritzing/fritzing-parts")
664 (commit version)))
665 (file-name (git-file-name "fritzing-parts" version))
666 (sha256
667 (base32
668 "1d2v8k7p176j0lczx4vx9n9gbg3vw09n2c4b6w0wj5wqmifywhc1"))))))
669 (home-page "https://fritzing.org")
670 (synopsis "Electronic circuit design")
671 (description
672 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
673 software with a low entry barrier, suited for the needs of makers and
674 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
675 library with many commonly used high-level components. Fritzing makes it very
676 easy to communicate about circuits, as well as to turn them into PCB layouts
677 ready 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
682 (define-public gerbv
683 (package
684 (name "gerbv")
685 (version "2.7.0")
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
692 "1d2k43k7i4yvbpi4sw1263a8d0q98z2n7aqhmpinpkih8a681vn5"))))
693 (build-system gnu-build-system)
694 (native-inputs
695 `(("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
696 ("desktop-file-utils" ,desktop-file-utils)
697 ("pkg-config" ,pkg-config)))
698 (inputs
699 `(("cairo" ,cairo)
700 ("gtk" ,gtk+-2)))
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
705 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
706 you load several files on top of each other, do measurements on the displayed
707 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
708 as well as pick-place files.")
709 (license license:gpl2+)))
710
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
721 (url "https://github.com/erichVK5/translate2geda")
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..),
752 BXL (@file{.bxl}), IBIS (@file{.ibs}), symdef, LT-Spice (@file{.asc}),
753 QUCS (@file{.sch}), and BSDL (@file{.bsd}) symbols and footprints and EggBot
754 fonts to gEDA.")
755 (license license:gpl2+))))
756
757 (define-public libfive
758 (let ((commit "8ca1b8685ef3fac7b64e66b10459b8421a3020c6")
759 (revision "4"))
760 (package
761 (name "libfive")
762 (version (git-version "0" revision commit))
763 (source (origin
764 (method git-fetch)
765 (uri (git-reference
766 (url "https://github.com/libfive/libfive")
767 (commit commit)))
768 (sha256
769 (base32
770 "1c762cd70iv2b9av0l9lq0py9138y98wk3dirhdmil7jncdhvq98"))
771 (file-name (git-file-name name version))))
772 (build-system cmake-build-system)
773 (arguments
774 `(#:test-target "libfive-test"
775 #:phases
776 (modify-phases %standard-phases
777 (add-after 'unpack 'remove-native-compilation
778 (lambda _
779 (substitute* "CMakeLists.txt" (("-march=native") ""))
780 #t)))))
781 (native-inputs
782 `(("pkg-config" ,pkg-config)))
783 (inputs
784 `(("boost" ,boost)
785 ("libpng" ,libpng)
786 ("qtbase" ,qtbase)
787 ("eigen" ,eigen)
788 ("guile" ,guile-3.0)))
789 (home-page "https://libfive.com")
790 (synopsis "Tool for programmatic computer-aided design")
791 (description
792 "Libfive is a tool for programmatic computer-aided design (CAD). In
793 libfive, solid models are defined as Scheme scripts, and there are no opaque
794 function calls into the geometry kernel: everything is visible to the user.
795 Even fundamental, primitive shapes are represented as code in the user-level
796 language.")
797 (license (list license:mpl2.0 ;library
798 license:gpl2+))))) ;Guile bindings and GUI
799
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
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))))
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)
840 ("guile" ,guile-3.0)))
841 (propagated-inputs
842 `(("libfive" ,libfive)
843 ("guile-opengl" ,guile3.0-opengl)))
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.
848 The viewer can be used interactively with a REPL (for example Geiser in
849 Emacs).")
850 (license license:gpl3+))))
851
852 ;; TODO Add doc https://gitlab.com/kicad/services/kicad-doc/-/tree/master
853 (define-public kicad
854 (package
855 (name "kicad")
856 (version "5.1.6")
857 (source
858 (origin
859 (method git-fetch)
860 (uri (git-reference
861 (url "https://gitlab.com/kicad/code/kicad.git")
862 (commit version)))
863 (sha256
864 (base32 "1pa3z0h0679jmgxlzc833h6q85b5paxdp69kf2h93vkaryj58622"))
865 (file-name (git-file-name name version))))
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)
879 (copy-recursively (assoc-ref inputs "kicad-i18n")
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)
916 ("gettext" ,gettext-minimal)
917 ("kicad-i18n" ,kicad-i18n)
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
938 boards and electrical circuits. The software has a number of programs that
939 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
940 electrical diagrams), gerbview (viewing Gerber files) and others.")
941 (license license:gpl3+)))
942
943 (define kicad-i18n
944 (package
945 (name "kicad-i18n")
946 (version (package-version kicad))
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
955 "0qryi8xjm23ka363zfl7bbga0v5c31fr3d4nyxp3m168vkv9zhha"))))
956 (build-system cmake-build-system)
957 (arguments
958 `(#:phases
959 (modify-phases %standard-phases
960 (delete 'build)
961 (delete 'check))))
962 (native-inputs
963 `(("gettext" ,gettext-minimal)))
964 (home-page (package-home-page kicad))
965 (synopsis "KiCad GUI translations")
966 (description "This package contains the po files that are used for the GUI
967 translations for KiCad.")
968 (license license:gpl3+)))
969
970 (define-public kicad-i18l
971 (deprecated-package "kicad-i18l" kicad-i18n))
972
973 (define-public kicad-symbols
974 (package
975 (name "kicad-symbols")
976 (version (package-version kicad))
977 (source (origin
978 (method git-fetch)
979 (uri (git-reference
980 (url "https://github.com/KiCad/kicad-symbols")
981 (commit version)))
982 (file-name (git-file-name name version))
983 (sha256
984 (base32
985 "12w3rdy085drlikkpb27n9ni7cyg9l0pqy7hnr86cxjcw3l5wcx6"))))
986 (build-system cmake-build-system)
987 (arguments
988 `(#:tests? #f)) ; no tests exist
989 (home-page (package-home-page kicad))
990 (synopsis "Official KiCad schematic symbol libraries")
991 (description "This package contains the official KiCad schematic symbol
992 libraries.")
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'."
998 ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
999 (license license:cc-by-sa4.0)))
1000
1001 (define-public kicad-footprints
1002 (package
1003 (inherit kicad-symbols)
1004 (name "kicad-footprints")
1005 (version (package-version kicad))
1006 (source (origin
1007 (method git-fetch)
1008 (uri (git-reference
1009 (url "https://github.com/KiCad/kicad-footprints")
1010 (commit version)))
1011 (file-name (git-file-name name version))
1012 (sha256
1013 (base32
1014 "1kmf91a5mmvj9izrv40mkaw1w36yjgn8daczd9rq2wlmd0rdp1zx"))))
1015 (synopsis "Official KiCad footprint libraries")
1016 (description "This package contains the official KiCad footprint libraries.")))
1017
1018 (define-public kicad-packages3d
1019 (package
1020 (inherit kicad-symbols)
1021 (name "kicad-packages3d")
1022 (version (package-version kicad))
1023 (source (origin
1024 (method git-fetch)
1025 (uri (git-reference
1026 (url "https://github.com/KiCad/kicad-packages3d")
1027 (commit version)))
1028 (file-name (git-file-name name version))
1029 (sha256
1030 (base32
1031 "0b9jglf77fy0n0r8xs4yqkv6zvipyfvp0z5dnqlzp32csy5aqpi1"))))
1032 (synopsis "Official KiCad 3D model libraries")
1033 (description "This package contains the official KiCad 3D model libraries.")))
1034
1035 (define-public kicad-templates
1036 (package
1037 (inherit kicad-symbols)
1038 (name "kicad-templates")
1039 (version (package-version kicad))
1040 (source (origin
1041 (method git-fetch)
1042 (uri (git-reference
1043 (url "https://github.com/KiCad/kicad-templates")
1044 (commit version)))
1045 (file-name (git-file-name name version))
1046 (sha256
1047 (base32
1048 "1hppcsrkn4dk6ggby6ckh0q65qxkywrbyxa4lwpaf7pxjyv498xg"))))
1049 (synopsis "Official KiCad project and worksheet templates")
1050 (description "This package contains the official KiCad project and
1051 worksheet templates.")))
1052
1053 (define-public linsmith
1054 (package
1055 (name "linsmith")
1056 (version "0.99.31")
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
1064 "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
1065 (build-system gnu-build-system)
1066 (native-inputs
1067 `(("pkg-config" ,pkg-config)
1068 ("gtk" ,gtk+-2)
1069 ("libgnome" ,libgnomeui)))
1070 (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
1071 (synopsis "Smith Charting program")
1072 (description "LinSmith is a Smith Charting program, mainly designed for
1073 educational use. As such, there is an emphasis on capabilities that improve
1074 the 'showing the effect of'-style of operation.")
1075 (license license:gpl2+)))
1076
1077 (define-public volk
1078 (package
1079 (name "volk")
1080 (version "2.4.0")
1081 (source
1082 (origin
1083 (method git-fetch)
1084 (uri (git-reference
1085 (url "https://github.com/gnuradio/volk")
1086 (commit (string-append "v" version))
1087 (recursive? #t))) ; for cpu_features git submodule
1088 (file-name (git-file-name name version))
1089 (sha256
1090 (base32 "14y0988r5qi1h3yvkivx5ihccn8r15910lq30r8iy71ih190r5m9"))))
1091 (build-system cmake-build-system)
1092 (arguments
1093 `(#:phases
1094 (modify-phases %standard-phases
1095 (add-after 'install 'remove-static-libraries
1096 ;; Remove libcpu_features.a (and any others that might appear).
1097 (lambda* (#:key outputs #:allow-other-keys)
1098 (let* ((out (assoc-ref outputs "out"))
1099 (lib (string-append out "/lib")))
1100 (for-each delete-file (find-files lib "\\.a$"
1101 #:fail-on-error? #t))
1102 #t)))
1103 (add-after 'install 'wrap-pythonpath
1104 (lambda* (#:key inputs outputs #:allow-other-keys)
1105 (let* ((out (assoc-ref outputs "out"))
1106 (python (assoc-ref inputs "python"))
1107 (file (string-append out "/bin/volk_modtool"))
1108 (path (string-append
1109 out
1110 "/lib/python"
1111 ,(version-major+minor
1112 (package-version python))
1113 "/site-packages:"
1114 (getenv "PYTHONPATH"))))
1115 (wrap-program file
1116 `("PYTHONPATH" ":" prefix (,path))
1117 `("PATH" ":" prefix
1118 (,(string-append python "/bin:")))))
1119 #t)))))
1120 (inputs
1121 `(("boost" ,boost)
1122 ("python" ,python-wrapper)
1123 ("python-mako" ,python-mako)))
1124 (home-page "https://www.libvolk.org/")
1125 (synopsis "Vector-Optimized Library of Kernels")
1126 (description
1127 "@acronym{VOLK, Vector-Optimized Library of Kernels} contains procedures
1128 with machine-specific optimizations for mathematical functions. It also
1129 provides a machine-independent interface to select the best such procedures to
1130 use on a given system.")
1131 (license license:gpl3+)))
1132
1133 (define-public libredwg
1134 (package
1135 (name "libredwg")
1136 (version "0.11")
1137 (source
1138 (origin
1139 (method url-fetch)
1140 (uri (string-append "mirror://gnu/libredwg/libredwg-"
1141 version ".tar.xz"))
1142 (sha256
1143 (base32 "1vd7ii32k5447z7k4w9s005hv1ffpj6dyf1w40x6c53qksrblny2"))))
1144 (build-system gnu-build-system)
1145 (arguments
1146 `(#:configure-flags '("--disable-bindings")))
1147 (native-inputs
1148 `(("libxml2" ,libxml2)
1149 ("parallel" ,parallel)
1150 ("pkg-config" ,pkg-config)
1151 ("python" ,python)
1152 ("python-libxml2" ,python-libxml2)))
1153 (inputs
1154 `(("pcre2" ,pcre2)))
1155 (home-page "https://www.gnu.org/software/libredwg/")
1156 (synopsis "C library to handle DWG (CAD-related) files")
1157 (description
1158 "GNU LibreDWG is a C library to handle DWG files. It aims to be a free
1159 replacement for the OpenDWG libraries.")
1160 (license license:gpl3+)))
1161
1162 (define-public minicom
1163 (package
1164 (name "minicom")
1165 (version "2.7.1")
1166 (source
1167 (origin
1168 (method git-fetch)
1169 (uri (git-reference
1170 (url "https://salsa.debian.org/minicom-team/minicom.git")
1171 (commit (string-append "v" version))))
1172 (sha256
1173 (base32 "0f36wv015zpz1x895qv0z6marlynzyh0d5mfkyd7lfyy2xd1i2w0"))
1174 (file-name (git-file-name name version))))
1175 (build-system gnu-build-system)
1176 (arguments
1177 `(#:configure-flags '("--enable-lock-dir=/var/lock")
1178 #:phases
1179 (modify-phases %standard-phases
1180 (replace 'bootstrap
1181 ;; autogen.sh needlessly hard-codes aclocal-1.14.
1182 (lambda _
1183 (invoke "autoreconf" "-vif")
1184 #t))
1185 (add-before 'configure 'patch-lock-check
1186 (lambda _
1187 (substitute* "configure"
1188 (("test -d [$]UUCPLOCK") "true"))
1189 #t)))))
1190 (native-inputs
1191 `(("autoconf" ,autoconf)
1192 ("automake" ,automake)
1193 ("gettext" ,gettext-minimal)
1194 ("pkg-config" ,pkg-config)))
1195 (inputs
1196 `(("ncurses" ,ncurses)))
1197 (home-page "https://salsa.debian.org/minicom-team/minicom")
1198 (synopsis "Serial terminal emulator")
1199 (description "@code{minicom} is a serial terminal emulator.")
1200 (license license:gpl2+)))
1201
1202 (define-public harminv
1203 (package
1204 (name "harminv")
1205 (version "1.4.1")
1206 (source (origin
1207 (method url-fetch)
1208 (uri
1209 (string-append "https://github.com/stevengj/harminv/"
1210 "releases/download/v" version "/"
1211 name "-" version ".tar.gz"))
1212 (sha256
1213 (base32
1214 "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
1215 (build-system gnu-build-system)
1216 (arguments
1217 `(#:configure-flags '("--enable-shared")
1218 #:phases
1219 (modify-phases %standard-phases
1220 (add-before 'configure 'fix-tests
1221 (lambda _
1222 (substitute* "./sines-test.sh"
1223 ; change test frequency range - default fails
1224 (("0\\.15") "0.16"))
1225 #t)))))
1226 (native-inputs
1227 `(("fortran" ,gfortran)))
1228 (inputs
1229 `(("lapack" ,lapack)))
1230 (home-page "https://github.com/stevengj/harminv")
1231 (synopsis "Harmonic inversion solver")
1232 (description
1233 "Harminv is a free program (and accompanying library) to solve the problem of
1234 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
1235 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
1236 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
1237 (license license:gpl2+)))
1238
1239 (define-public guile-libctl
1240 (package
1241 (name "guile-libctl")
1242 (version "4.2.0")
1243 (source (origin
1244 (method url-fetch)
1245 (uri
1246 (string-append
1247 "https://github.com/NanoComp/libctl/releases/download/v"
1248 version "/libctl-" version ".tar.gz"))
1249 (sha256
1250 (base32
1251 "0x8r56lpfq83kfbq28vr25icl19xpfd6fjrxzcpdmv30l9pash83"))))
1252 (build-system gnu-build-system)
1253 (arguments
1254 `(#:configure-flags '("--enable-shared")))
1255 (native-inputs
1256 `(("fortran" ,gfortran)))
1257 (inputs
1258 `(("guile" ,guile-2.2)))
1259 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
1260 (synopsis "Flexible control files implementation for scientific simulations")
1261 (description
1262 "Libctl is a Guile-based library implementing flexible control files
1263 for scientific simulations.")
1264 (license license:gpl2+)))
1265
1266 (define-public mpb
1267 (package
1268 (name "mpb")
1269 (version "1.8.0")
1270 (source (origin
1271 (method url-fetch)
1272 (uri
1273 (string-append
1274 "https://github.com/NanoComp/mpb/releases/download/v"
1275 version "/mpb-" version ".tar.gz"))
1276 (sha256
1277 (base32
1278 "1jgrb7dd6qs6j6y1gnxmdgrh79l2bvqa6nk60a4pw1annsks4brd"))))
1279 (build-system gnu-build-system)
1280 (arguments
1281 `(#:configure-flags
1282 (list (string-append "--with-libctl="
1283 (assoc-ref %build-inputs "libctl")
1284 "/share/libctl")
1285 "--enable-shared")))
1286 (native-inputs
1287 `(("fortran" ,gfortran)
1288 ("pkg-config" ,pkg-config)
1289 ("swig" ,swig)))
1290 (inputs
1291 `(("fftw" ,fftw)
1292 ("gsl" ,gsl)
1293 ("guile" ,guile-2.2)
1294 ("hdf5" ,hdf5)
1295 ("lapack" ,lapack)
1296 ("libctl" ,guile-libctl)
1297 ("readline" ,readline)
1298 ("zlib" ,zlib)))
1299 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
1300 (synopsis "Computes band structures and electromagnetic modes of dielectric
1301 structures")
1302 (description
1303 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
1304 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
1305 fully-vectorial and three-dimensional methods.")
1306 (license license:gpl2+)))
1307
1308 (define-public meep
1309 (package
1310 (name "meep")
1311 (version "1.8.0")
1312 (source (origin
1313 (method url-fetch)
1314 (uri
1315 (string-append
1316 "https://github.com/NanoComp/meep/releases/download/v"
1317 version "/meep-" version ".tar.gz"))
1318 (sha256
1319 (base32
1320 "14zyxmm3p80j5fz5b89sl7hgkgcisqjny5hjh4pi274ziqjqz8bm"))))
1321 (build-system gnu-build-system)
1322 (arguments
1323 `(#:configure-flags
1324 (list (string-append "--with-libctl="
1325 (assoc-ref %build-inputs "libctl")
1326 "/share/libctl"))))
1327 (native-inputs
1328 `(("fortran" ,gfortran)
1329 ("pkg-config" ,pkg-config)
1330 ("swig" ,swig)))
1331 (inputs
1332 `(("fftw" ,fftw)
1333 ("gsl" ,gsl)
1334 ("guile" ,guile-2.2)
1335 ("harminv" ,harminv)
1336 ("hdf5" ,hdf5)
1337 ("lapack" ,lapack)
1338 ("libctl" ,guile-libctl)
1339 ("mpb" ,mpb)
1340 ("zlib" ,zlib)))
1341 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1342 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1343 (description
1344 "Meep is a finite-difference time-domain (FDTD) simulation software package
1345 developed at MIT to model electromagnetic systems.")
1346 (license license:gpl2+)))
1347
1348 (define-public adms
1349 (package
1350 (name "adms")
1351 (version "2.3.7")
1352 (source (origin
1353 (method git-fetch)
1354 (uri (git-reference
1355 (url "https://github.com/Qucs/ADMS")
1356 (commit (string-append "release-" version))))
1357 (file-name (git-file-name name version))
1358 (sha256
1359 (base32
1360 "0i37c9k6q1iglmzp9736rrgsnx7sw8xn3djqbbjw29zsyl3pf62c"))))
1361 (build-system gnu-build-system)
1362 (native-inputs
1363 `(("autoconf" ,autoconf)
1364 ("automake" ,automake)
1365 ("bison" ,bison)
1366 ("flex" ,flex)
1367 ("libtool" ,libtool)
1368 ("perl" ,perl)
1369 ("perl-xml-libxml" ,perl-xml-libxml)))
1370 (home-page "https://github.com/Qucs/ADMS")
1371 (synopsis "Automatic device model synthesizer")
1372 (description
1373 "ADMS is a code generator that converts electrical compact device models
1374 specified in high-level description language into ready-to-compile C code for
1375 the API of spice simulators. Based on transformations specified in XML
1376 language, ADMS transforms Verilog-AMS code into other target languages.")
1377 (license license:gpl3)))
1378
1379 (define-public capstone
1380 (package
1381 (name "capstone")
1382 (version "3.0.5")
1383 (source (origin
1384 (method git-fetch)
1385 (uri (git-reference
1386 (url "https://github.com/aquynh/capstone")
1387 (commit version)))
1388 (file-name (git-file-name name version))
1389 (sha256
1390 (base32
1391 "0dgf82kxj4rs45d6s8sr984c38sll1n5scpypjlyh21gh2yl4qfw"))))
1392 (build-system gnu-build-system)
1393 (arguments
1394 `(#:tests? #f
1395 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1396 "CC=gcc")
1397 #:phases
1398 (modify-phases %standard-phases
1399 (delete 'configure) ; no configure script
1400 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
1401 (add-before 'build 'fix-cstool-ldflags
1402 (lambda* (#:key outputs #:allow-other-keys)
1403 (setenv "LDFLAGS" (string-append "-Wl,-rpath="
1404 (assoc-ref outputs "out") "/lib"))
1405 #t)))))
1406 (home-page "https://www.capstone-engine.org")
1407 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1408 (description
1409 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1410 framework. Capstone can disassemble machine code for many supported architectures
1411 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1412 bindings for Python, Java, OCaml and more.")
1413 (license license:bsd-3)))
1414
1415 ;; FIXME: This package has a timestamp embedded in
1416 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1417 (define-public python-capstone
1418 (package
1419 (inherit capstone)
1420 (name "python-capstone")
1421 (propagated-inputs
1422 `(("capstone" ,capstone)))
1423 (build-system python-build-system)
1424 (arguments
1425 `(#:phases
1426 (modify-phases %standard-phases
1427 (add-after 'unpack 'chdir-and-fix-setup-py
1428 (lambda _
1429 (chdir "bindings/python")
1430 ;; Do not build the library again, because we already have it.
1431 (substitute* "setup.py" ((".* build_libraries.*") ""))
1432 ;; This substitution tells python-capstone where to find the
1433 ;; library.
1434 (substitute* "capstone/__init__.py"
1435 (("pkg_resources.resource_filename.*")
1436 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1437 #t)))))))
1438
1439 (define-public python2-capstone
1440 (package-with-python2 python-capstone))
1441
1442 (define-public radare2
1443 (package
1444 (name "radare2")
1445 (version "4.4.0")
1446 (source (origin
1447 (method git-fetch)
1448 (uri (git-reference
1449 (url "https://github.com/radareorg/radare2")
1450 (commit version)))
1451 (sha256
1452 (base32
1453 "0gwdnrnk7wdgkajp2qwg4fyplh7nsbmf01bzx07px6xmiscd9z2s"))
1454 (file-name (git-file-name name version))))
1455 (build-system gnu-build-system)
1456 (arguments
1457 '(#:tests? #f ; tests require git and network access
1458 #:phases
1459 (modify-phases %standard-phases
1460 (add-before 'configure 'mklibdir
1461 (lambda* (#:key inputs outputs #:allow-other-keys)
1462 (mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
1463 #t)))
1464 #:configure-flags
1465 (list "--with-openssl"
1466 "--with-rpath"
1467 "--with-syscapstone"
1468 "--with-sysmagic"
1469 "--with-syszip"
1470 "--with-sysxxhash")
1471 #:make-flags
1472 (list "CC=gcc")))
1473 ;; TODO: Add gmp and libzip and make the build system actually find them.
1474 (inputs
1475 `(("capstone" ,capstone)
1476 ("libuv" ,libuv)
1477 ("openssl" ,openssl)
1478 ("zip" ,zip)))
1479 (native-inputs
1480 `(("pkg-config" ,pkg-config)))
1481 (propagated-inputs
1482 ;; In the Libs: section of r_hash.pc.
1483 `(("xxhash" ,xxhash)))
1484 (home-page "https://radare.org/")
1485 (synopsis "Reverse engineering framework")
1486 (description
1487 "Radare2 is a complete framework for reverse-engineering, debugging, and
1488 analyzing binaries. It is composed of a set of small utilities that can be
1489 used together or independently from the command line.
1490
1491 Radare2 is built around a scriptable disassembler and hexadecimal editor that
1492 support a variety of executable formats for different processors and operating
1493 systems, through multiple back ends for local and remote files and disk
1494 images.
1495
1496 It can also compare (@dfn{diff}) binaries with graphs and extract information
1497 like relocation symbols. It is able to deal with malformed binaries, making
1498 it suitable for security research and analysis.")
1499 (license license:lgpl3)))
1500
1501 (define-public asco
1502 (package
1503 (name "asco")
1504 (version "0.4.10")
1505 (source (origin
1506 (method url-fetch)
1507 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1508 version ".tar.gz"))
1509 (sha256
1510 (base32
1511 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1512 (build-system gnu-build-system)
1513 (arguments
1514 `(#:tests? #f ; no tests
1515 #:make-flags '("all" "asco-mpi")
1516 #:phases
1517 (modify-phases %standard-phases
1518 (delete 'configure)
1519 (add-before 'build 'fix-paths
1520 (lambda* (#:key inputs #:allow-other-keys)
1521 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1522 (substitute* '("errfunc.c" "asco.c")
1523 (("cp ")
1524 (string-append coreutils "/bin/cp "))
1525 (("nice")
1526 (string-append coreutils "/bin/nice")))
1527 (substitute* "Makefile"
1528 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1529 #t)))
1530 (replace 'install ; no install target
1531 (lambda* (#:key outputs #:allow-other-keys)
1532 (for-each (lambda (file)
1533 (install-file file (string-append
1534 (assoc-ref outputs "out")
1535 "/bin")))
1536 '("asco" "asco-mpi" "asco-test"
1537 "tools/alter/alter" "tools/log/log"))
1538 #t)))))
1539 (native-inputs
1540 `(("mpi" ,openmpi)))
1541 (inputs
1542 `(("coreutils-minimal" ,coreutils-minimal)))
1543 (home-page "http://asco.sourceforge.net/")
1544 (synopsis "SPICE circuit optimizer")
1545 (description
1546 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1547 high-performance parallel differential evolution (DE) optimization algorithm.")
1548 (license license:gpl2+)))
1549
1550 (define-public libngspice
1551 ;; Note: The ngspice's build system does not allow us to build both the
1552 ;; library and the executables in one go. Thus, we have two packages.
1553 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1554 (package
1555 (name "libngspice")
1556 (version "28")
1557 (source (origin
1558 (method url-fetch)
1559 (uri (list
1560 (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1561 version "/ngspice-" version ".tar.gz")
1562 (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1563 "old-releases/" version
1564 "/ngspice-" version ".tar.gz")))
1565 (sha256
1566 (base32
1567 "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l"))
1568 (modules '((guix build utils)))
1569 ;; We remove the non-free cider and build without it.
1570 (snippet
1571 '(begin
1572 (delete-file-recursively "src/ciderlib")
1573 (delete-file "src/ciderinit")
1574 (substitute* "configure"
1575 (("src/ciderlib/Makefile") "")
1576 (("src/ciderlib/input/Makefile") "")
1577 (("src/ciderlib/support/Makefile") "")
1578 (("src/ciderlib/oned/Makefile") "")
1579 (("src/ciderlib/twod/Makefile") ""))
1580 #t))))
1581 (build-system gnu-build-system)
1582 (arguments
1583 `(;; No tests for libngspice exist.
1584 ;; The transient tests for ngspice fail.
1585 #:tests? #f
1586 #:phases
1587 (modify-phases %standard-phases
1588 (add-after 'unpack 'patch-timestamps
1589 (lambda _
1590 (substitute* "configure"
1591 (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))
1592 #t))
1593 (add-after 'unpack 'delete-program-manuals
1594 (lambda _
1595 (substitute* "man/man1/Makefile.in"
1596 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1597 "man_MANS = "))
1598 #t))
1599 (add-after 'install 'delete-script-files
1600 (lambda* (#:key outputs #:allow-other-keys)
1601 (delete-file-recursively
1602 (string-append (assoc-ref outputs "out")
1603 "/share/ngspice/scripts")))))
1604 #:configure-flags
1605 (list "--enable-openmp"
1606 "--enable-xspice"
1607 "--with-ngshared"
1608 "--with-readline=yes")))
1609 (native-inputs
1610 `(("bison" ,bison)
1611 ("flex" ,flex)))
1612 (inputs
1613 `(("libxaw" ,libxaw)
1614 ("mpi" ,openmpi)
1615 ("readline" ,readline)))
1616 (home-page "http://ngspice.sourceforge.net/")
1617 (synopsis "Mixed-level/mixed-signal circuit simulator")
1618 (description
1619 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1620 @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1621 provides code modeling support and simulation of digital components through
1622 an embedded event driven algorithm.")
1623 (license (list license:lgpl2.0+ ; code in frontend/numparam
1624 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1625 license:public-domain)))) ; xspice
1626
1627 (define-public ngspice
1628 ;; The ngspice executables (see libngpsice above.)
1629 (package (inherit libngspice)
1630 (name "ngspice")
1631 (arguments
1632 (substitute-keyword-arguments (package-arguments libngspice)
1633 ((#:configure-flags flags)
1634 `(delete "--with-ngshared" ,flags))
1635 ((#:phases phases)
1636 `(modify-phases ,phases
1637 (add-after 'unpack 'delete-include-files
1638 (lambda _
1639 (substitute* "src/Makefile.in"
1640 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1641 "SUBDIRS = misc maths frontend spicelib"))
1642 #t))
1643 (add-after 'install 'delete-cmpp-dlmain
1644 (lambda* (#:key outputs #:allow-other-keys)
1645 (for-each (lambda (file)
1646 (delete-file
1647 (string-append (assoc-ref outputs "out")
1648 file)))
1649 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1650 #t))
1651 (delete 'delete-program-manuals)
1652 (delete 'delete-script-files)))))
1653 (inputs
1654 `(("libngspice" ,libngspice)
1655 ("readline" ,readline)))))
1656
1657 (define trilinos-serial-xyce
1658 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1659 ;; keep it private. See
1660 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1661 ;; TODO: Remove when we have modular Trilinos packages?
1662 (package
1663 (name "trilinos-serial-xyce")
1664 (version "12.12.1")
1665 (source
1666 (origin (method url-fetch)
1667 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1668 version "-Source.tar.gz"))
1669 (sha256
1670 (base32
1671 "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
1672 (build-system cmake-build-system)
1673 (arguments
1674 `(#:out-of-source? #t
1675 #:phases
1676 (modify-phases %standard-phases
1677 ;; Delete unneeded tribits(build system) directory which makes validate-runpath
1678 ;; phase to fail.
1679 (add-before 'validate-runpath 'delete-tribits
1680 (lambda* (#:key outputs #:allow-other-keys)
1681 (delete-file-recursively
1682 (string-append (assoc-ref outputs "out")
1683 "/lib/cmake/tribits"))
1684 #t)))
1685 #:configure-flags
1686 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1687 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1688 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1689 "-DTrilinos_ENABLE_NOX=ON"
1690 "-DNOX_ENABLE_LOCA=ON"
1691 "-DTrilinos_ENABLE_EpetraExt=ON"
1692 "-DEpetraExt_BUILD_BTF=ON"
1693 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1694 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1695 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1696 "-DTrilinos_ENABLE_Ifpack=ON"
1697 "-DTrilinos_ENABLE_Isorropia=ON"
1698 "-DTrilinos_ENABLE_AztecOO=ON"
1699 "-DTrilinos_ENABLE_Belos=ON"
1700 "-DTrilinos_ENABLE_Teuchos=ON"
1701 "-DTeuchos_ENABLE_COMPLEX=ON"
1702 "-DTrilinos_ENABLE_Amesos=ON"
1703 "-DAmesos_ENABLE_KLU=ON"
1704 "-DAmesos_ENABLE_UMFPACK=ON"
1705 "-DTrilinos_ENABLE_Sacado=ON"
1706 "-DTrilinos_ENABLE_Kokkos=OFF"
1707 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1708 "-DTPL_ENABLE_AMD=ON"
1709 "-DTPL_ENABLE_UMFPACK=ON"
1710 "-DTPL_ENABLE_BLAS=ON"
1711 "-DTPL_ENABLE_LAPACK=ON")))
1712 (native-inputs
1713 `(("fortran" ,gfortran)
1714 ("swig" ,swig)))
1715 (inputs
1716 `(("boost" ,boost)
1717 ("lapack" ,lapack)
1718 ("suitesparse" ,suitesparse)))
1719 (home-page "https://trilinos.org")
1720 (synopsis "Engineering and scientific problems algorithms")
1721 (description
1722 "The Trilinos Project is an effort to develop algorithms and enabling
1723 technologies within an object-oriented software framework for the solution of
1724 large-scale, complex multi-physics engineering and scientific problems. A
1725 unique design feature of Trilinos is its focus on packages.")
1726 (license (list license:lgpl2.1+
1727 license:bsd-3))))
1728
1729 (define-public xyce-serial
1730 (package
1731 (name "xyce-serial")
1732 (version "6.8")
1733 (source
1734 (origin (method url-fetch)
1735 (uri (string-append "https://archive.org/download/Xyce-"
1736 version "/Xyce-" version ".tar.gz"))
1737 (sha256
1738 (base32
1739 "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
1740 (build-system gnu-build-system)
1741 (arguments
1742 `(#:tests? #f
1743 #:configure-flags
1744 (list
1745 "CXXFLAGS=-O3"
1746 (string-append "ARCHDIR="
1747 (assoc-ref %build-inputs "trilinos")))))
1748 (native-inputs
1749 `(("bison" ,bison-3.0) ;'configure' fails with Bison 3.4
1750 ("flex" ,flex)
1751 ("fortran" ,gfortran)))
1752 (inputs
1753 `(("fftw" ,fftw)
1754 ("suitesparse" ,suitesparse)
1755 ("lapack" ,lapack)
1756 ("trilinos" ,trilinos-serial-xyce)))
1757 (home-page "https://xyce.sandia.gov/")
1758 (synopsis "High-performance analog circuit simulator")
1759 (description
1760 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1761 capable of solving extremely large circuit problems by supporting large-scale
1762 parallel computing platforms. It also supports serial execution.")
1763 (license license:gpl3+)))
1764
1765 (define trilinos-parallel-xyce
1766 (package (inherit trilinos-serial-xyce)
1767 (name "trilinos-parallel-xyce")
1768 (arguments
1769 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1770 ((#:configure-flags flags)
1771 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1772 "-DTrilinos_ENABLE_Zoltan=ON"
1773 "-DTPL_ENABLE_MPI=ON")
1774 ,flags)))))
1775 (inputs
1776 `(("mpi" ,openmpi)
1777 ,@(package-inputs trilinos-serial-xyce)))))
1778
1779 (define-public xyce-parallel
1780 (package (inherit xyce-serial)
1781 (name "xyce-parallel")
1782 (arguments
1783 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1784 ((#:configure-flags flags)
1785 `(list "CXXFLAGS=-O3"
1786 "CXX=mpiCC"
1787 "CC=mpicc"
1788 "F77=mpif77"
1789 "--enable-mpi"
1790 (string-append
1791 "ARCHDIR="
1792 (assoc-ref %build-inputs "trilinos")))))))
1793 (propagated-inputs
1794 `(("mpi" ,openmpi)))
1795 (inputs
1796 `(("trilinos" ,trilinos-parallel-xyce)
1797 ,@(alist-delete "trilinos"
1798 (package-inputs xyce-serial))))))
1799
1800 (define-public freehdl
1801 (package
1802 (name "freehdl")
1803 (version "0.0.8")
1804 (source (origin
1805 (method url-fetch)
1806 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1807 version ".tar.gz"))
1808 (sha256
1809 (base32
1810 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))
1811 (patches
1812 (list (origin
1813 ;; Fix build with GCC 7. Patch taken from Arch Linux:
1814 ;; https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/freehdl
1815 (method url-fetch)
1816 (uri "https://git.archlinux.org/svntogit/community.git\
1817 /plain/trunk/build-fix.patch?h=packages/freehdl\
1818 &id=3bb90d64dfe6883e26083cd1fa96226d0d59175a")
1819 (file-name "freehdl-c++-namespace.patch")
1820 (sha256
1821 (base32
1822 "09df3c70rx81rnhlhry1wpdhji274nx9jb74rfprk06l4739zm08")))))))
1823 (build-system gnu-build-system)
1824 (arguments
1825 `(#:phases
1826 (modify-phases %standard-phases
1827 (add-before 'configure 'patch-pkg-config
1828 (lambda* (#:key inputs #:allow-other-keys)
1829 (substitute* "freehdl/freehdl-config"
1830 (("pkg-config")
1831 (string-append (assoc-ref inputs "pkg-config")
1832 "/bin/pkg-config"))
1833 (("cat")
1834 (string-append (assoc-ref inputs "coreutils")
1835 "/bin/cat")))
1836 #t))
1837 (add-after 'patch-pkg-config 'setenv
1838 (lambda* (#:key inputs #:allow-other-keys)
1839 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1840 "/bin/g++"))
1841 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1842 "/bin/libtool"))
1843 #t))
1844 (add-after 'setenv 'patch-gvhdl
1845 (lambda _
1846 (substitute* "v2cc/gvhdl.in"
1847 (("--mode=link") "--mode=link --tag=CXX")
1848 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1849 #t))
1850 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1851 (lambda* (#:key inputs #:allow-other-keys)
1852 (substitute* "freehdl/freehdl-gennodes.in"
1853 (("guile")
1854 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1855 (("\\(debug") ";(debug")
1856 (("\\(@ ") "(apply-emit")
1857 (("\\(@@ ") "(apply-mini-format"))
1858 #t))
1859 (add-after 'configure 'patch-freehdl-pc
1860 (lambda* (#:key inputs #:allow-other-keys)
1861 (substitute* "freehdl.pc"
1862 (("=g\\+\\+")
1863 (string-append "=" (assoc-ref inputs "gcc-toolchain")
1864 "/bin/g++"))
1865 (("=libtool")
1866 (string-append "=" (assoc-ref inputs "libtool")
1867 "/bin/libtool")))
1868 #t))
1869 (add-after 'install-scripts 'make-wrapper
1870 (lambda* (#:key inputs outputs #:allow-other-keys)
1871 (let ((out (assoc-ref outputs "out")))
1872 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1873 ;; file name.
1874 (wrap-program (string-append out "/bin/gvhdl")
1875 `("CPLUS_INCLUDE_PATH" ":" prefix
1876 (,(string-append (assoc-ref inputs "gcc-toolchain")
1877 "/include")))
1878 `("LIBRARY_PATH" ":" prefix
1879 (,(string-append (assoc-ref inputs "gcc-toolchain")
1880 "/lib")))
1881 `("PATH" ":" prefix
1882 (,(string-append (assoc-ref inputs "gcc-toolchain")
1883 "/bin")
1884 ,(string-append (assoc-ref inputs "coreutils")
1885 "/bin"))))
1886 (wrap-program (string-append out "/bin/freehdl-config")
1887 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1888 #t)))))
1889 (inputs
1890 `(("coreutils" ,coreutils)
1891 ("gcc-toolchain" ,gcc-toolchain)
1892 ("guile" ,guile-2.2)
1893 ("perl" ,perl)
1894 ("pkg-config" ,pkg-config)
1895 ("libtool" ,libtool)))
1896 (native-inputs
1897 `(("pkg-config-native" ,pkg-config)
1898 ("libtool-native" ,libtool)))
1899 (home-page "http://www.freehdl.seul.org/")
1900 (synopsis "VHDL simulator")
1901 (description
1902 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1903 VHDL'93 as well as VHDL'87 standards are supported.")
1904 (license (list license:gpl2+
1905 license:lgpl2.0+)))) ; freehdl's libraries
1906
1907 (define-public qucs
1908 ;; Qucs 0.0.19 segfaults when using glibc-2.26. Temporarily build from git.
1909 ;; TODO: When qucs-0.0.20 is released, revert the commit that introduced this
1910 ;; comment and update the package.
1911 (let ((commit "b4f27d9222568066cd59e4c387c51a35056c99d8")
1912 (revision "0"))
1913 (package
1914 (name "qucs")
1915 (version (git-version "0.0.19" revision commit))
1916 (source (origin
1917 (method git-fetch)
1918 (uri (git-reference
1919 (url "https://github.com/Qucs/qucs")
1920 (commit commit)))
1921 (sha256
1922 (base32 "10bclay9xhkffmsh4j4l28kj1qpxx0pnxja5vx6305cllnq4r3gb"))
1923 (file-name (string-append name "-" version "-checkout"))))
1924 (build-system gnu-build-system)
1925 (arguments
1926 `(#:phases
1927 (modify-phases %standard-phases
1928 (add-before 'bootstrap 'patch-bootstrap
1929 (lambda _
1930 (for-each patch-shebang
1931 '("bootstrap"
1932 "qucs/bootstrap"
1933 "qucs-doc/bootstrap"
1934 "qucs-core/bootstrap"))
1935 #t))
1936 (add-before 'configure 'patch-configure
1937 (lambda* (#:key inputs #:allow-other-keys)
1938 (substitute* "qucs/configure"
1939 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1940 #t))
1941 (add-after 'patch-configure 'patch-scripts
1942 (lambda* (#:key inputs outputs #:allow-other-keys)
1943 (substitute* '("qucs/qucs/qucsdigi"
1944 "qucs/qucs/qucsdigilib"
1945 "qucs/qucs/qucsveri")
1946 (("\\$BINDIR")
1947 (string-append (assoc-ref outputs "out") "/bin"))
1948 (("freehdl-config")
1949 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1950 (("freehdl-v2cc")
1951 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1952 (("cp ")
1953 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1954 (("glibtool")
1955 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1956 (("sed")
1957 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1958 (("iverilog")
1959 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1960 (("vvp")
1961 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1962 #t))
1963 (add-before 'check 'pre-check
1964 (lambda _
1965 ;; The test suite requires a running X server.
1966 (system "Xvfb :1 &")
1967 (setenv "DISPLAY" ":1")
1968 #t))
1969 (add-after 'install 'make-wrapper
1970 (lambda* (#:key inputs outputs #:allow-other-keys)
1971 (let ((out (assoc-ref outputs "out")))
1972 ;; 'qucs' directly invokes gcc, hence this wrapping.
1973 (wrap-program (string-append out "/bin/qucs")
1974 `("CPLUS_INCLUDE_PATH" ":" prefix
1975 (,(string-append (assoc-ref inputs "gcc-toolchain")
1976 "/include")))
1977 `("PATH" ":" prefix
1978 (,(string-append (assoc-ref inputs "gcc-toolchain")
1979 "/bin")))
1980 `("LIBRARY_PATH" ":" prefix
1981 (,(string-append (assoc-ref inputs "gcc-toolchain")
1982 "/lib")))
1983 `("ADMSXMLBINDIR" ":" prefix
1984 (,(string-append (assoc-ref inputs "adms") "/bin")))
1985 `("ASCOBINDIR" ":" prefix
1986 (,(string-append (assoc-ref inputs "asco") "/bin")))
1987 `("QUCS_OCTAVE" ":" prefix
1988 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1989 #t)))
1990 #:parallel-build? #f ; race condition
1991 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1992 (native-inputs
1993 `(("autoconf" ,autoconf)
1994 ("automake" ,automake)
1995 ("bison" ,bison)
1996 ("flex" ,flex)
1997 ("gperf" ,gperf)
1998 ("libtool-native" ,libtool)
1999 ("pkg-config" ,pkg-config)
2000 ("python" ,python-2) ; for tests
2001 ("matplotlib" ,python2-matplotlib) ; for tests
2002 ("numpy" ,python2-numpy) ; for tests
2003 ("xorg-server" ,xorg-server-for-tests))) ; for tests
2004 (inputs
2005 `(("adms" ,adms)
2006 ("asco" ,asco)
2007 ("coreutils" ,coreutils)
2008 ("freehdl" ,freehdl)
2009 ("gcc-toolchain" ,gcc-toolchain)
2010 ("iverilog" ,iverilog)
2011 ("libtool" ,libtool)
2012 ("octave" ,octave-cli)
2013 ("qt4" ,qt-4)
2014 ("sed" ,sed)))
2015 (home-page "http://qucs.sourceforge.net/")
2016 (synopsis "Circuit simulator with graphical user interface")
2017 (description
2018 "Qucs is a circuit simulator with graphical user interface. The software
2019 aims to support all kinds of circuit simulation types---e.g. DC, AC,
2020 S-parameter, transient, noise and harmonic balance analysis. Pure digital
2021 simulations are also supported.")
2022 (license license:gpl2+))))
2023
2024 (define-public qucs-s
2025 (package
2026 (name "qucs-s")
2027 (version "0.0.21")
2028 (source (origin
2029 (method url-fetch)
2030 (uri (string-append "https://github.com/ra3xdh/qucs_s/archive/"
2031 version ".tar.gz"))
2032 (file-name (string-append name "-" version ".tar.gz"))
2033 (sha256
2034 (base32
2035 "12m1jwhb9qwvb141qzyskbxnw3wn1x22d02z4b4862p7xvccl5h7"))))
2036 (build-system cmake-build-system)
2037 (arguments
2038 `(#:tests? #f ; no tests
2039 #:phases
2040 (modify-phases %standard-phases
2041 (add-before 'configure 'patch-scripts
2042 (lambda* (#:key inputs #:allow-other-keys)
2043 (substitute* '("qucs/qucsdigi"
2044 "qucs/qucsdigilib"
2045 "qucs/qucsveri")
2046 (("\\$BINDIR")
2047 (string-append (assoc-ref inputs "qucs") "/bin"))
2048 (("freehdl-config")
2049 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
2050 (("freehdl-v2cc")
2051 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
2052 (("cp ")
2053 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
2054 (("glibtool")
2055 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
2056 (("sed")
2057 (string-append (assoc-ref inputs "sed") "/bin/sed"))
2058 (("iverilog")
2059 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
2060 (("vvp")
2061 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
2062 #t))
2063 (add-after 'patch-scripts 'patch-paths
2064 (lambda* (#:key inputs #:allow-other-keys)
2065 (substitute* "qucs/main.cpp"
2066 (((string-append "QucsSettings\\.Qucsator = QucsSettings\\.BinDir "
2067 "\\+ \"qucsator\" \\+ executableSuffix"))
2068 (string-append "}{ QucsSettings.Qucsator = \""
2069 (assoc-ref inputs "qucs") "/bin/qucsator\""))
2070 (((string-append "QucsSettings\\.XyceExecutable = "
2071 "\"/usr/local/Xyce-Release-6.8.0-OPENSOURCE/bin/Xyce"))
2072 (string-append "}{ QucsSettings.XyceExecutable = \""
2073 (assoc-ref inputs "xyce-serial") "/bin/Xyce"))
2074 (((string-append "else QucsSettings\\.XyceParExecutable = "
2075 "\"mpirun -np %p /usr/local"
2076 "/Xyce-Release-6.8.0-OPENMPI-OPENSOURCE/bin/Xyce"))
2077 (string-append "QucsSettings.XyceParExecutable = \""
2078 (assoc-ref inputs "mpi") "/bin/mpirun -np %p "
2079 (assoc-ref inputs "xyce-parallel") "/bin/Xyce"))
2080 (("else QucsSettings\\.NgspiceExecutable = \"ngspice\"")
2081 (string-append "QucsSettings.NgspiceExecutable = " "\""
2082 (assoc-ref inputs "ngspice") "/bin/ngspice\"")))
2083 (substitute* "qucs/extsimkernels/ngspice.cpp"
2084 (("share/qucs/xspice_cmlib") "share/qucs-s/xspice_cmlib"))
2085 (substitute* "qucs/qucs_actions.cpp"
2086 (("qucstrans")
2087 (string-append (assoc-ref inputs "qucs") "/bin/qucstrans"))
2088 (("qucsattenuator")
2089 (string-append (assoc-ref inputs "qucs") "/bin/qucsattenuator"))
2090 (("qucsrescodes")
2091 (string-append (assoc-ref inputs "qucs") "/bin/qucsrescodes")))
2092 #t))
2093 (add-after 'install 'install-scripts
2094 (lambda* (#:key inputs outputs #:allow-other-keys)
2095 (for-each
2096 (lambda (script)
2097 (let ((file (string-append "../qucs_s-" ,version
2098 "/qucs/" script))
2099 (out (assoc-ref outputs "out")))
2100 (install-file file (string-append out "/bin"))
2101 (chmod (string-append out "/bin/" script) #o555)))
2102 '("qucsdigi" "qucsdigilib" "qucsveri"))
2103 #t))
2104 (add-after 'install-scripts 'make-wrapper
2105 (lambda* (#:key inputs outputs #:allow-other-keys)
2106 (let* ((out (assoc-ref outputs "out"))
2107 (file (string-append out "/bin/qucs-s"))
2108 (qucs (assoc-ref inputs "qucs"))
2109 (qucsator (string-append qucs "/bin/qucsator")))
2110 (wrap-program file
2111 `("CPLUS_INCLUDE_PATH" ":" prefix
2112 (,(string-append (assoc-ref inputs "gcc-toolchain")
2113 "/include")))
2114 `("PATH" ":" prefix
2115 (,(string-append (assoc-ref inputs "gcc-toolchain")
2116 "/bin")))
2117 `("LIBRARY_PATH" ":" prefix
2118 (,(string-append (assoc-ref inputs "gcc-toolchain")
2119 "/lib")))
2120 `("QUCSATOR" ":" prefix (,qucsator))
2121 `("QUCSCONV" ":" prefix (,(string-append qucsator "/bin/qucsconv")))
2122 `("ADMSXMLBINDIR" ":" prefix (,(string-append (assoc-ref inputs "adms")
2123 "/bin")))
2124 `("ASCOBINDIR" ":" prefix (,(string-append (assoc-ref inputs "asco")
2125 "/bin")))
2126 `("QUCS_OCTAVE" ":" prefix (,(string-append (assoc-ref inputs "octave")
2127 "/bin/octave"))))
2128 (symlink qucsator (string-append out "/bin/qucsator"))
2129 #t))))))
2130 (native-inputs
2131 `(("libtool-native" ,libtool)))
2132 (inputs
2133 `(("adms" ,adms)
2134 ("asco" ,asco)
2135 ("coreutils" ,coreutils)
2136 ("freehdl" ,freehdl)
2137 ("gcc-toolchain" ,gcc-toolchain)
2138 ("iverilog" ,iverilog)
2139 ("libtool" ,libtool)
2140 ("mpi" ,openmpi)
2141 ("ngspice" ,ngspice)
2142 ("octave" ,octave-cli)
2143 ("qt4" ,qt-4)
2144 ("qucs" ,qucs)
2145 ("sed" ,sed)
2146 ("xyce-serial" ,xyce-serial)
2147 ("xyce-parallel" ,xyce-parallel)))
2148 (home-page "https://ra3xdh.github.io/")
2149 (synopsis "Circuit simulator with graphical user interface")
2150 (description
2151 "Qucs-S is a spin-off of the Qucs cross-platform circuit simulator.
2152 The S letter indicates SPICE. The purpose of the Qucs-S subproject is to use
2153 free SPICE circuit simulation kernels with the Qucs GUI. It provides the
2154 simulator backends @code{Qucsator}, @code{ngspice} and @code{Xyce}.")
2155 (license license:gpl2+)))
2156
2157 (define-public librepcb
2158 (package
2159 (name "librepcb")
2160 (version "0.1.4")
2161 (source
2162 (origin
2163 (method url-fetch)
2164 (uri (string-append "https://download.librepcb.org/releases/"
2165 version "/librepcb-" version "-source.zip"))
2166 (sha256
2167 (base32 "1b5dkanz3q0y5ag80w0l85hn7axrachb5m9zvyv4zvzrfy09wa88"))))
2168 (build-system gnu-build-system)
2169 (inputs
2170 `(("qtbase" ,qtbase)
2171 ("qtsvg" ,qtsvg)
2172 ("zlib" ,zlib)))
2173 (native-inputs
2174 `(("qttools" ,qttools) ; for lrelease
2175 ("unzip" ,unzip)))
2176 (arguments
2177 `(#:phases
2178 (modify-phases %standard-phases
2179 (replace 'configure
2180 (lambda* (#:key inputs outputs #:allow-other-keys)
2181 (mkdir-p "build")
2182 (chdir "build")
2183 (let ((lrelease (string-append (assoc-ref inputs "qttools")
2184 "/bin/lrelease"))
2185 (out (assoc-ref outputs "out")))
2186 (invoke "qmake"
2187 (string-append "QMAKE_LRELEASE=" lrelease)
2188 (string-append "PREFIX=" out)
2189 "../librepcb.pro")))))))
2190 (home-page "https://librepcb.org/")
2191 (synopsis "Electronic Design Automation tool")
2192 (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
2193 software to develop printed circuit boards. It features human readable file
2194 formats and complete project management with library, schematic and board
2195 editors.")
2196 (license (list license:gpl3+
2197 license:boost1.0 ; libs/clipper,
2198 ; libs/optional/tests/catch.hpp,
2199 ; libs/sexpresso/tests/catch.hpp
2200 license:expat ; libs/delaunay-triangulation,
2201 ; libs/parseagle, libs/type_safe
2202 license:asl2.0 ; libs/fontobene, libs/googletest,
2203 ; libs/parseagle
2204 license:isc ; libs/hoedown
2205 license:cc0 ; libs/optional, libs/sexpresso
2206 license:bsd-2 ; libs/optional/tests/catch.hpp
2207 license:lgpl2.1+)))) ; libs/quazip
2208
2209 (define-public gpx
2210 (package
2211 (name "gpx")
2212 (version "2.5.2")
2213 (source (origin
2214 (method git-fetch)
2215 (uri (git-reference
2216 (url "https://github.com/markwal/GPX")
2217 (commit version)))
2218 (file-name (git-file-name name version))
2219 (sha256
2220 (base32
2221 "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
2222 (build-system gnu-build-system)
2223 (home-page "https://github.com/markwal/GPX")
2224 (synopsis "Converting gcode to x3g files for 3D printing")
2225 (description
2226 "GPX is a post processing utility for converting gcode output from 3D
2227 slicing software to x3g files for standalone 3D printing on common 3D
2228 printers.")
2229 (license license:gpl2+)))
2230
2231 (define-public gnucap
2232 (package
2233 (name "gnucap")
2234 (version "20171003")
2235 (source
2236 (origin
2237 (method url-fetch)
2238 (uri (string-append "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/gnucap-"
2239 version ".tar.gz"))
2240 (sha256
2241 (base32
2242 "16m09xa685qhj5fqq3bcgakrwnb74xhf5f7rpqkkf9fg8plzbb1g"))))
2243 (build-system gnu-build-system)
2244 (inputs
2245 `(("readline" ,readline)))
2246 (arguments
2247 `(#:phases
2248 (modify-phases %standard-phases
2249 (replace 'configure
2250 (lambda* (#:key outputs #:allow-other-keys)
2251 (let ((out (assoc-ref outputs "out")))
2252 ;; Set correct rpath so that gnucap finds libgnucap.so.
2253 (substitute* (list "apps/configure" "lib/configure"
2254 "main/configure" "modelgen/configure")
2255 (("LDFLAGS =")
2256 (string-append "LDFLAGS = -Wl,-rpath=" out "/lib")))
2257 ;; gnucap uses a hand-written configure script that expects the
2258 ;; --prefix argument to be the first argument passed to it.
2259 (invoke "./configure" (string-append "--prefix=" out)))))
2260 (replace 'check
2261 (lambda* (#:key outputs #:allow-other-keys)
2262 (let ((out (assoc-ref outputs "out"))
2263 (libpath "../lib/O:../apps/O"))
2264 (with-directory-excursion "tests"
2265 ;; Make test return non-zero exit code when a test fails.
2266 (substitute* "test"
2267 (("/bin/sh") "/bin/sh -e")
2268 (("\\|\\| echo \"\\*\\*\\*\\* \\$ii fails \\*\\*\\*\\*\"") ""))
2269 ;; Fix expected plugin search path for test c_attach.1.gc
2270 (substitute* "==out/c_attach.1.gc.out"
2271 (("/usr/local/lib/gnucap")
2272 (string-append libpath ":" out "/lib/gnucap")))
2273 ;; Set library path so that gnucap can find libgnucap.so
2274 ;; while running the tests.
2275 (setenv "LD_LIBRARY_PATH" libpath)
2276 (invoke "./test" "../main/O/gnucap" "" "test-output" "==out"))))))))
2277 (home-page "https://www.gnu.org/software/gnucap/")
2278 (synopsis "Mixed analog and digital circuit simulator")
2279 (description "GNUcap is a circuit analysis package. It offers a general
2280 purpose circuit simulator and can perform DC and transient analyses, fourier
2281 analysis and AC analysis. The engine is designed to do true mixed-mode
2282 simulation.")
2283 (license license:gpl3+)))
2284
2285 (define-public cutter
2286 (package
2287 (name "cutter")
2288 (version "1.10.3")
2289 (source
2290 (origin
2291 (method git-fetch)
2292 (uri (git-reference
2293 (url "https://github.com/radareorg/cutter")
2294 (commit (string-append "v" version))))
2295 (file-name (git-file-name name version))
2296 (sha256
2297 (base32 "0qj8jyij02nif4jpirl09ygwnv8a9zi3vkb5sf5s8mg7qwlpnvyk"))))
2298 (build-system gnu-build-system)
2299 (arguments
2300 `(#:phases
2301 (modify-phases %standard-phases
2302 (replace 'configure
2303 (lambda* (#:key inputs outputs #:allow-other-keys)
2304 (let ((out (assoc-ref outputs "out"))
2305 (radare2 (assoc-ref inputs "radare2")))
2306 ;; Fix pkg-config detection ./src/lib_radare2.pri:PREFIX=/usr/lib
2307 ;; override `qmake PREFIX=`.
2308 (substitute* "./src/lib_radare2.pri"
2309 (("PREFIX") "R2PREFIX")
2310 (("R2PREFIX=/usr") (string-append "R2PREFIX=" radare2)))
2311 (invoke "qmake"
2312 (string-append "PREFIX=" out)
2313 "./src/Cutter.pro")))))))
2314 (native-inputs
2315 `(("pkg-config" ,pkg-config)))
2316 (inputs
2317 `(("qtbase" ,qtbase)
2318 ("qtsvg" ,qtsvg)
2319 ("openssl" ,openssl)
2320 ("radare2" ,radare2)))
2321 (home-page "https://github.com/radareorg/cutter")
2322 (synopsis "GUI for radare2 reverse engineering framework")
2323 (description "Cutter is a GUI for radare2 reverse engineering framework.
2324 Its goal is making an advanced andcustomizable reverse-engineering platform
2325 while keeping the user experience at mind. Cutter is created by reverse
2326 engineers for reverse engineers.")
2327 (license (list license:cc-by-sa3.0 ;the "Iconic" icon set
2328 license:gpl3+)))) ;everything else
2329
2330 (define-public lib3mf
2331 (package
2332 (name "lib3mf")
2333 (version "1.8.1")
2334 (source
2335 (origin
2336 (method git-fetch)
2337 (uri (git-reference (url "https://github.com/3MFConsortium/lib3mf")
2338 (commit (string-append "v" version))))
2339 (file-name (git-file-name name version))
2340 (sha256
2341 (base32
2342 "11wpk6n9ga2p57h1dcrp37w77mii0r7r6mlrgmykf7rvii1rzgqd"))))
2343 (build-system cmake-build-system)
2344 (native-inputs
2345 `(("googletest-source" ,(package-source googletest))))
2346 (inputs
2347 `(("libuuid" ,util-linux "lib")))
2348 (arguments
2349 `(#:phases
2350 (modify-phases %standard-phases
2351 (add-after 'unpack 'unpack-googletest
2352 (lambda* (#:key inputs #:allow-other-keys)
2353 (copy-recursively (assoc-ref inputs "googletest-source")
2354 "UnitTests/googletest")
2355 #t)))))
2356 (synopsis "Implementation of the 3D Manufacturing Format (3MF) file standard")
2357 (description
2358 "Lib3MF is a C++ implementation of the 3D Manufacturing Format (3MF) file
2359 standard. It offers a way to integrate 3MF reading and writing capabilities, as
2360 well as conversion and validation tools for input and output data. The
2361 specification can be downloaded at @url{http://3mf.io/specification/}.")
2362 (home-page "https://3mf.io/")
2363 (license license:bsd-2)))
2364
2365 (define-public openscad
2366 (package
2367 (name "openscad")
2368 (version "2019.05")
2369 (source
2370 (origin
2371 (method url-fetch)
2372 (uri (string-append "https://files.openscad.org/openscad-" version
2373 ".src.tar.gz"))
2374 (sha256
2375 (base32
2376 "0nbgk5q5pgnw53la0kccdcpz2f4xf6d6076rkn0q08z57hkc85ha"))
2377 (patches (search-patches
2378 "openscad-parser-boost-1.72.patch"))))
2379 (build-system cmake-build-system)
2380 (inputs
2381 `(("boost" ,boost)
2382 ("cgal" ,cgal)
2383 ("double-conversion" ,double-conversion)
2384 ("eigen" ,eigen)
2385 ("fontconfig" ,fontconfig)
2386 ("glew" ,glew)
2387 ("gmp" ,gmp)
2388 ("harfbuzz" ,harfbuzz)
2389 ("lib3mf" ,lib3mf)
2390 ("libxml2" ,libxml2)
2391 ("libzip" ,libzip)
2392 ("mpfr" ,mpfr)
2393 ("opencsg" ,opencsg)
2394 ("qscintilla" ,qscintilla)
2395 ("qtbase" ,qtbase)
2396 ("qtmultimedia" ,qtmultimedia)))
2397 (native-inputs
2398 `(("bison" ,bison)
2399 ("flex" ,flex)
2400 ("gettext" ,gettext-minimal)
2401 ("pkg-config" ,pkg-config)
2402 ("which" ,which)
2403 ;; the following are only needed for tests
2404 ("imagemagick" ,imagemagick)
2405 ("ps" ,procps)
2406 ("python" ,python)
2407 ("xvfb" ,xorg-server-for-tests)))
2408 (arguments
2409 `(#:phases
2410 (modify-phases %standard-phases
2411 (replace 'configure
2412 (lambda* (#:key outputs #:allow-other-keys)
2413 (invoke "qmake"
2414 (string-append "PREFIX=" (assoc-ref outputs "out")))
2415 #t))
2416 (replace 'check
2417 (lambda _
2418 (with-directory-excursion "tests"
2419 (invoke "cmake" ".")
2420 (invoke "make")
2421 (invoke "ctest"))
2422 ;; strip python test files since lib dir ends up in out/share
2423 (for-each delete-file
2424 (find-files "libraries/MCAD" ".*\\.py"))
2425 #t)))))
2426 (synopsis "Script-based 3D modeling application")
2427 (description
2428 "OpenSCAD is a 3D Computer-aided Design (CAD) application. Unlike an
2429 interactive modeler, OpenSCAD generates 3D models from a script, giving you
2430 full programmatic control over your models.")
2431 (home-page "https://www.openscad.org/")
2432 (license license:gpl2+)))
2433
2434 (define-public freecad
2435 (package
2436 (name "freecad")
2437 (version "0.18.4")
2438 (source
2439 (origin
2440 (method git-fetch)
2441 (uri (git-reference
2442 (url "https://github.com/FreeCAD/FreeCAD")
2443 (commit version)))
2444 (modules '((guix build utils)))
2445 (snippet
2446 '(begin
2447 ;; Fix build with Python 3.8, see
2448 ;; <https://tracker.freecadweb.org/view.php?id=4143>.
2449 (substitute* "src/Base/swigpyrun.inl"
2450 (("PyObject \\*modules = interp->modules;")
2451 "PyObject *modules = PyEval_GetBuiltins();"))
2452 #t))
2453 (file-name (git-file-name name version))
2454 (sha256
2455 (base32
2456 "170hk1kgrvsddrwykp24wyj0cha78zzmzbf50gn98x7ngqqs395s"))))
2457 (build-system qt-build-system)
2458 (native-inputs
2459 `(("doxygen" ,doxygen)
2460 ("graphviz" ,graphviz)
2461 ("qttools" ,qttools)
2462 ("pkg-config" ,pkg-config)
2463 ("swig" ,swig)))
2464 (inputs
2465 `(("boost" ,boost)
2466 ("coin3D" ,coin3D)
2467 ("eigen" ,eigen)
2468 ("freetype" ,freetype)
2469 ("glew" ,glew)
2470 ("hdf5" ,hdf5-1.10)
2471 ("libarea" ,libarea)
2472 ("libmedfile" ,libmedfile)
2473 ("libspnav" ,libspnav)
2474 ("libxi" ,libxi)
2475 ("libxmu" ,libxmu)
2476 ("openmpi" ,openmpi)
2477 ("opencascade-occt" ,opencascade-occt)
2478 ("python-matplotlib" ,python-matplotlib)
2479 ("python-pyside-2" ,python-pyside-2)
2480 ("python-pyside-2-tools" ,python-pyside-2-tools)
2481 ("python-shiboken-2" ,python-shiboken-2)
2482 ("python-wrapper" ,python-wrapper)
2483 ("qtbase" ,qtbase)
2484 ("qtsvg" ,qtsvg)
2485 ("qtx11extras" ,qtx11extras)
2486 ("qtxmlpatterns" ,qtxmlpatterns)
2487 ;; qtwebkit is optional. We remove it currently, because it takes
2488 ;; much time to compile and substitutes are often unavailable
2489 ;;("qtwebkit" ,qtwebkit)
2490 ("tbb" ,tbb)
2491 ("vtk" ,vtk)
2492 ("xerces-c" ,xerces-c)
2493 ("zlib" ,zlib)))
2494 (arguments
2495 `(#:tests? #f
2496 #:configure-flags
2497 (list
2498 "-DBUILD_QT5=ON"
2499 (string-append "-DCMAKE_INSTALL_LIBDIR="
2500 (assoc-ref %outputs "out") "/lib"))
2501 #:phases
2502 (modify-phases %standard-phases
2503 (add-before 'configure 'restore-pythonpath
2504 (lambda _
2505 (substitute* "src/Main/MainGui.cpp"
2506 (("_?putenv\\(\"PYTHONPATH=\"\\);") ""))
2507 #t))
2508 (add-after 'install 'wrap-pythonpath
2509 (lambda* (#:key outputs #:allow-other-keys)
2510 (let ((out (assoc-ref outputs "out")))
2511 (wrap-program (string-append out "/bin/FreeCAD")
2512 (list "PYTHONPATH"
2513 'prefix (list (getenv "PYTHONPATH")))))
2514 #t)))))
2515 (home-page "https://www.freecadweb.org/")
2516 (synopsis "Your Own 3D Parametric Modeler")
2517 (description
2518 "FreeCAD is a general purpose feature-based, parametric 3D modeler for
2519 CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering and
2520 product design but also fits a wider range of uses in engineering, such as
2521 architecture or other engineering specialties. It is 100% Open Source (LGPL2+
2522 license) and extremely modular, allowing for very advanced extension and
2523 customization.")
2524 (license
2525 (list
2526 license:lgpl2.1+
2527 license:lgpl2.0+
2528 license:gpl3+
2529 license:bsd-3))))
2530
2531 (define-public libmedfile
2532 (package
2533 (name "libmedfile")
2534 (version "4.0.0")
2535 (source
2536 (origin
2537 (method url-fetch)
2538 (uri (string-append
2539 "https://files.salome-platform.org/Salome/other/med-"
2540 version ".tar.gz"))
2541 (sha256
2542 (base32
2543 "017h9p0x533fm4gn6pwc8kmp72rvqmcn6vznx72nkkl2b05yjx54"))))
2544 (build-system cmake-build-system)
2545 (inputs `(("hdf5" ,hdf5-1.10)))
2546 (arguments
2547 `(#:phases
2548 (modify-phases %standard-phases
2549 (add-after 'install 'remove-test-output
2550 (lambda* (#:key outputs #:allow-other-keys)
2551 (let ((out (assoc-ref outputs "out")))
2552 (delete-file-recursively
2553 (string-append out "/bin/testc"))
2554 #t))))))
2555 (home-page "https://www.salome-platform.org")
2556 (synopsis "Library to read and write MED files")
2557 (description
2558 "The purpose of the MED module is to provide a standard for storing and
2559 recovering computer data associated to numerical meshes and fields, and to
2560 facilitate the exchange between codes and solvers.
2561
2562 The persistent data storage is based upon HDF format (like CGNS, a standard
2563 developed by Boeing and NASA in the area of Computational Fluid Dynamic).
2564
2565 MED also provides structures to hold data on meshes and fields. These
2566 structures are exchanged between solvers, hide the communication level (CORBA
2567 or MPI), and offer persistence (read/write in .med files).
2568
2569 The main benefit of a common exchange format is reduced complexity of code
2570 coupling. It also allows sharing such high level functionalities as
2571 computation of nodal connectivity of sub-elements (faces and edges),
2572 arithmetic operations on fields, entity location functionalities, and
2573 interpolation toolkit.")
2574 (license license:gpl3+)))
2575
2576 (define-public libarea
2577 (let ((revision "1")
2578 (commit "8f8bac811c10f1f01fda0d742a18591f61dd76ee"))
2579 (package
2580 (name "libarea")
2581 (version (git-version "0" revision commit))
2582 (source
2583 (origin
2584 (method git-fetch)
2585 (uri (git-reference (url "https://github.com/Heeks/libarea")
2586 (commit commit)))
2587 (file-name (git-file-name name version))
2588 (sha256
2589 (base32 "0pvqz6cabxqdz5y26wnj6alkn8v5d7gkx0d3h8xmg4lvy9r3kh3g"))))
2590 (build-system gnu-build-system)
2591 (inputs `(("boost" ,boost)
2592 ("python-wrapper" ,python-wrapper)))
2593 (native-inputs
2594 `(("cmake" ,cmake-minimal)))
2595 (arguments
2596 `(#:tests? #f
2597 #:phases
2598 (modify-phases %standard-phases
2599 (add-after 'configure 'cmake-configure
2600 (lambda* (#:key inputs outputs #:allow-other-keys)
2601 (let ((out (assoc-ref outputs "out"))
2602 (cmake (assoc-ref inputs "cmake")))
2603 (mkdir-p "build")
2604 (invoke "cmake"
2605 (string-append "-DCMAKE_INSTALL_PREFIX=" out)))))
2606 (delete 'configure))))
2607 (home-page "https://github.com/Heeks/libarea")
2608 (synopsis
2609 "Library and python module for pocketing and profiling operations")
2610 (description
2611 "Area is a CAM-related software for pocketing operation.
2612
2613 This project provides library and associated python-module to compute pocket
2614 operations.")
2615 (license (list
2616 license:bsd-3
2617 license:gpl3+)))))
2618
2619 (define-public libspnav
2620 (package
2621 (name "libspnav")
2622 (version "0.2.3")
2623 (source (origin
2624 (method git-fetch)
2625 (uri (git-reference
2626 (url "https://github.com/FreeSpacenav/libspnav")
2627 (commit (string-append "libspnav-" version))))
2628 (sha256
2629 (base32
2630 "098h1jhlj87axpza5zgy58prp0zn94wyrbch6x0s7q4mzh7dc8ba"))
2631 (file-name (git-file-name name version))))
2632 (build-system gnu-build-system)
2633 (inputs
2634 `(("libx11" ,libx11)))
2635 (arguments `(#:tests? #f))
2636 (home-page "http://spacenav.sourceforge.net/")
2637 (synopsis
2638 "Library for communicating with spacenavd or 3dxsrv")
2639 (description
2640 "The libspnav library is provided as a replacement of the magellan
2641 library. It provides a cleaner, and more orthogonal interface. libspnav
2642 supports both the original X11 protocol for communicating with the driver, and
2643 the new alternative non-X protocol. Programs that choose to use the X11
2644 protocol, are automatically compatible with either the free spacenavd driver
2645 or the official 3dxserv, as if they were using the magellan SDK.
2646
2647 Also, libspnav provides a magellan API wrapper on top of the new API. So, any
2648 applications that were using the magellan library, can switch to libspnav
2649 without any changes. And programmers that are familiar with the magellan API
2650 can continue using it with a free library without the restrictions of the
2651 official SDK.")
2652 (license license:bsd-3)))
2653
2654 (define-public openctm
2655 (let ((revision 603))
2656 ;; Previous versions don't compile, they need to link libGL and libGLU.
2657 ;; Fixed in this revision.
2658 (package
2659 (name "openctm")
2660 (version (string-append "1.0.3." (number->string revision)))
2661 (source
2662 (origin
2663 (method svn-fetch)
2664 (uri (svn-reference
2665 (url "https://svn.code.sf.net/p/openctm/code/trunk")
2666 (revision revision)))
2667 (file-name (string-append name "-" version "-checkout"))
2668 (sha256
2669 (base32 "01wb70m48xh5gwhv60a5brv4sxl0i0rh038w32cgnlxn5x86s9f1"))))
2670 (build-system gnu-build-system)
2671 (native-inputs
2672 `(("pkg-config" ,pkg-config)))
2673 (inputs
2674 `(("mesa" ,mesa)
2675 ("glu" ,glu)
2676 ("glut" ,freeglut)
2677 ("gtk" ,gtk+-2)))
2678 (arguments
2679 `(#:tests? #f ;no tests
2680 #:phases
2681 (modify-phases %standard-phases
2682 (replace 'configure
2683 (lambda* (#:key outputs #:allow-other-keys)
2684 (rename-file "Makefile.linux" "Makefile")
2685 (let ((out (assoc-ref outputs "out")))
2686 ;; Create output directories.
2687 (mkdir-p (string-append out "/lib"))
2688 (mkdir-p (string-append out "/include"))
2689 (mkdir-p (string-append out "/bin"))
2690 ;; Fix rpath.
2691 (substitute* "tools/Makefile.linux"
2692 (("-rpath,\\.")
2693 (string-append "-rpath," out "/lib/"))
2694 (("/usr/local")
2695 out))
2696 ;; Set right output.
2697 (substitute* "Makefile"
2698 (("/usr/lib")
2699 (string-append out "/lib"))
2700 (("\\/usr\\/local")
2701 out))
2702 #t))))))
2703 (synopsis "3D triangle mesh format and related tools and libraries")
2704 (description "OpenCTM is a file format, a software library and a tool set
2705 for compression of 3D triangle meshes. The geometry is compressed to a
2706 fraction of comparable file formats (3DS, STL, COLLADA...), and the format is
2707 accessible through a simple API")
2708 (license license:zlib)
2709 (home-page "http://openctm.sourceforge.net/"))))
2710
2711 (define-public lib3ds
2712 (package
2713 (name "lib3ds")
2714 (version "1.3.0")
2715 (source
2716 (origin
2717 (method url-fetch)
2718 (uri (string-append
2719 "https://storage.googleapis.com/google-code-archive-downloads"
2720 "/v2/code.google.com/lib3ds/lib3ds-" version ".zip"))
2721 (sha256
2722 (base32 "1qr9arfdkjf7q11xhvxwzmhxqz3nhcjkyb8zzfjpz9jm54q0rc7m"))))
2723 (build-system gnu-build-system)
2724 (native-inputs
2725 `(("unzip" ,unzip)))
2726 (home-page "https://code.google.com/archive/p/lib3ds")
2727 (synopsis "3DS format file toolkit")
2728 (description "Lib3ds is a toolkit for handling the 3DS format for 3D
2729 model files. Its main goal is to simplify the creation of 3DS import and
2730 export filters.")
2731 (license license:lgpl2.1+)))
2732
2733 (define-public meshlab
2734 (package
2735 (name "meshlab")
2736 (version "2020.06")
2737 (source (origin
2738 (method git-fetch)
2739 (uri (git-reference
2740 (url "https://github.com/cnr-isti-vclab/meshlab")
2741 (commit (string-append "Meshlab-" version))
2742 (recursive? #t)))
2743 (file-name (git-file-name name version))
2744 (sha256
2745 (base32 "1cgx24wxh2ah5pff51rcrk6x8qcdjpkxcdak7s4cfzmxvjlshydd"))))
2746 (build-system cmake-build-system)
2747 (inputs
2748 `(("qtbase" ,qtbase)
2749 ("qtscript" ,qtscript)
2750 ("qtxmlpatterns" ,qtxmlpatterns)
2751 ("mesa" ,mesa)
2752 ("glu" ,glu)
2753 ("glew" ,glew)
2754 ("muparser" ,muparser)
2755 ("gmp" ,gmp)
2756 ("eigen" ,eigen)
2757 ("libfreenect" ,libfreenect)
2758 ("lib3ds" ,lib3ds)
2759 ("openctm" ,openctm)
2760 ;; FIXME: Compilation fails with system qhull:
2761 ;; https://github.com/cnr-isti-vclab/meshlab/issues/678
2762 ;; ("qhull" ,qhull)
2763 ))
2764 (arguments
2765 `(#:tests? #f ; Has no tests
2766 #:phases
2767 (modify-phases %standard-phases
2768 (add-after 'unpack 'go-to-source-dir
2769 (lambda _ (chdir "src") #t))
2770 (add-after 'install 'move-files
2771 (lambda* (#:key outputs #:allow-other-keys)
2772 (let ((lib (string-append (assoc-ref outputs "out")
2773 "/lib")))
2774 (rename-file
2775 (string-append lib "/meshlab/libmeshlab-common.so")
2776 (string-append lib "/libmeshlab-common.so"))
2777 #t))))))
2778 (synopsis "3D triangular mesh processing and editing software")
2779 (home-page "https://www.meshlab.net/")
2780 (description "MeshLab is a system for the processing and
2781 editing of unstructured large 3D triangular meshes. It is aimed to help the
2782 processing of the typical not-so-small unstructured models arising in 3D
2783 scanning, providing a set of tools for editing, cleaning, healing, inspecting,
2784 rendering and converting this kind of meshes. These tools include MeshLab
2785 proper, a versatile program with a graphical user interface, and meshlabserver,
2786 a program that can perform mesh processing tasks in batch mode, without a
2787 GUI.")
2788 (license license:gpl3+)))
2789
2790 (define-public poke
2791 ;; Upstream has yet to tag any releases.
2792 (let ((commit "d33317a46e3b7c48130a471a48cbfea1abab70d8")
2793 (revision "0"))
2794 (package
2795 (name "poke")
2796 (version (git-version "0.0.0" revision commit))
2797 (source
2798 (origin
2799 (method git-fetch)
2800 (uri (git-reference
2801 (url "git://git.savannah.gnu.org/poke.git")
2802 (commit commit)
2803 (recursive? #t)))
2804 (sha256
2805 (base32 "1dd0r1x123bqi78lrsk58rvg9c9wka0kywdyzn7g3i4hkh54xb7d"))
2806 (file-name (git-file-name name version))))
2807 (build-system gnu-build-system)
2808 ;; The GUI, which we elide, requires tcl and tk.
2809 (native-inputs `(("autoconf" ,autoconf)
2810 ("automake" ,automake)
2811 ;; Requires bison 3.6+ but we currently only have 3.5.
2812 ;; Bison 3.6 will be available in the next core update.
2813 ("bison-3.6" ,bison-3.6)
2814 ("clisp" ,clisp)
2815 ("dejagnu" ,dejagnu)
2816 ("flex" ,flex)
2817 ("gettext" ,gettext-minimal)
2818 ("help2man" ,help2man)
2819 ("libtool" ,libtool)
2820 ("perl" ,perl)
2821 ("pkg-config" ,pkg-config)
2822 ("python-2" ,python-2)
2823 ("python-3" ,python-3)
2824 ("texinfo" ,texinfo)))
2825 ;; FIXME: Enable NBD support by adding `libnbd' (currently unpackaged).
2826 ;; FIXME: A "hyperlinks-capable" `libtexststyle' needed for the hserver.
2827 (inputs `(("json-c" ,json-c)
2828 ("libgc" ,libgc)
2829 ("readline" ,readline)))
2830 (arguments
2831 ;; To build the GUI, add the `--enable-gui' configure flag.
2832 ;; To enable the "hyperlink server", add the `--enable-hserver' flag.
2833 `(#:configure-flags '("--enable-mi")
2834 #:phases (modify-phases %standard-phases
2835 ;; This is a non-trivial bootstrap that needs many of the
2836 ;; native-inputs and thus must run after `patch-shebangs'.
2837 (delete 'bootstrap)
2838 (add-after 'patch-source-shebangs 'bootstrap
2839 (lambda _
2840 (invoke "./bootstrap" "--no-git"
2841 "--no-bootstrap-sync"
2842 "--gnulib-srcdir=gnulib")
2843 #t)))))
2844 (home-page "http://jemarch.net/poke.html")
2845 (synopsis "Interactive, extensible editor for binary data")
2846 (description "GNU poke is an interactive, extensible editor for binary
2847 data. Not limited to editing basic entities such as bits and bytes, it
2848 provides a full-fledged procedural, interactive programming language designed
2849 to describe data structures and to operate on them.")
2850 (license license:gpl3+))))
2851
2852 (define-public pcb2gcode
2853 (package
2854 (name "pcb2gcode")
2855 (version "2.1.0")
2856 (source
2857 (origin
2858 (method git-fetch)
2859 (uri (git-reference
2860 (url "https://github.com/pcb2gcode/pcb2gcode")
2861 (commit (string-append "v" version))
2862 (recursive? #t)))
2863 (file-name (git-file-name name version))
2864 (sha256
2865 (base32
2866 "0nzglcyh6ban27cc73j4l7w7r9k38qivq0jz8iwnci02pfalw4ry"))))
2867 (build-system gnu-build-system)
2868 (inputs
2869 `(("boost" ,boost)
2870 ("geos" ,geos)
2871 ("gerbv" ,gerbv)
2872 ("glibmm" ,glibmm)
2873 ("gtkmm" ,gtkmm-2)
2874 ("librsvg" ,librsvg)))
2875 (native-inputs
2876 `(("autoconf" ,autoconf)
2877 ("automake" ,automake)
2878 ("libtool" ,libtool)
2879 ("pkg-config" ,pkg-config)))
2880 (home-page "https://github.com/pcb2gcode/pcb2gcode")
2881 (synopsis "Generate G-code for milling PCBs")
2882 (description "pcb2gcode is a command-line program for isolation routing
2883 and drilling of PCBs. It takes Gerber files as input and outputs G-code files
2884 for the milling of PCBs. It also includes an autoleveller for the automatic
2885 dynamic calibration of the milling depth.")
2886 (license license:gpl3+)))