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