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