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