gnu: time: Update license.
[jackhill/guix/guix.git] / gnu / packages / engineering.scm
CommitLineData
ffb010b5 1;;; GNU Guix --- Functional package management for GNU
e981ca36 2;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
93094501 3;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
d8a4b932 4;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
0de98139 5;;; Copyright © 2016 David Thompson <davet@gnu.org>
d7d5050c 6;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
d109b1e8 7;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros@foradis.org>
6febda94 8;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
ffb010b5
RW
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
40fbd52a 25(define-module (gnu packages engineering)
ffb010b5
RW
26 #:use-module (guix packages)
27 #:use-module (guix download)
93094501 28 #:use-module (guix gexp)
ffb010b5 29 #:use-module (guix git-download)
93094501
FB
30 #:use-module (guix monads)
31 #:use-module (guix store)
412726ee 32 #:use-module (guix utils)
91cabd3e 33 #:use-module ((srfi srfi-1) #:hide (zip))
ffb010b5 34 #:use-module ((guix licenses) #:prefix license:)
befc9ff6 35 #:use-module (guix build-system cmake)
ffb010b5 36 #:use-module (guix build-system gnu)
f70be011 37 #:use-module (guix build-system python)
ffb010b5 38 #:use-module (gnu packages)
4534d85e 39 #:use-module (gnu packages algebra)
95283f3f 40 #:use-module (gnu packages autotools)
5699a3cf 41 #:use-module (gnu packages base)
20500662 42 #:use-module (gnu packages bison)
ffb010b5 43 #:use-module (gnu packages boost)
4534d85e 44 #:use-module (gnu packages check)
d3f95898 45 #:use-module (gnu packages commencement)
93094501 46 #:use-module (gnu packages compression)
befc9ff6 47 #:use-module (gnu packages curl)
20500662 48 #:use-module (gnu packages flex)
ffb010b5 49 #:use-module (gnu packages fontutils)
c31b61ef 50 #:use-module (gnu packages fpga)
324b0040 51 #:use-module (gnu packages freedesktop)
1251c664 52 #:use-module (gnu packages gcc)
20500662 53 #:use-module (gnu packages gd)
95283f3f 54 #:use-module (gnu packages gettext)
93094501 55 #:use-module (gnu packages ghostscript)
20500662 56 #:use-module (gnu packages gl)
412726ee
RW
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
c31b61ef 59 #:use-module (gnu packages gperf)
412726ee
RW
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages guile)
4534d85e 62 #:use-module (gnu packages image)
e981ca36 63 #:use-module (gnu packages imagemagick)
38cf2ba0 64 #:use-module (gnu packages linux) ;FIXME: for pcb
0de98139 65 #:use-module (gnu packages m4)
ffb010b5 66 #:use-module (gnu packages maths)
44669577 67 #:use-module (gnu packages multiprecision)
a6edcfaf 68 #:use-module (gnu packages mpi)
f37f949d 69 #:use-module (gnu packages ncurses)
412726ee 70 #:use-module (gnu packages perl)
ffb010b5 71 #:use-module (gnu packages pkg-config)
befc9ff6 72 #:use-module (gnu packages python)
ffb010b5 73 #:use-module (gnu packages qt)
5e872d4b 74 #:use-module (gnu packages readline)
befc9ff6 75 #:use-module (gnu packages swig)
20500662 76 #:use-module (gnu packages tcl)
befc9ff6 77 #:use-module (gnu packages tls)
8f9ac901 78 #:use-module (gnu packages tex)
befc9ff6 79 #:use-module (gnu packages wxwidgets)
44669577 80 #:use-module (gnu packages xorg))
ffb010b5
RW
81
82(define-public librecad
83 (package
84 (name "librecad")
6e9d5d5f 85 (version "2.1.3")
ffb010b5
RW
86 (source (origin
87 (method url-fetch)
88 (uri (string-append
89 "https://github.com/LibreCAD/LibreCAD/archive/"
90 version ".tar.gz"))
d8a4b932 91 (file-name (string-append name "-" version ".tar.gz"))
ffb010b5
RW
92 (sha256
93 (base32
6e9d5d5f 94 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
ffb010b5
RW
95 (build-system gnu-build-system)
96 (arguments
97 '(#:phases
d694230a
EF
98 (modify-phases %standard-phases
99 (add-after 'unpack 'patch-paths
100 (lambda* (#:key outputs #:allow-other-keys)
101 (let ((out (assoc-ref outputs "out")))
102 (substitute* "librecad/src/lib/engine/rs_system.cpp"
103 (("/usr/share") (string-append out "/share"))))))
104 (replace 'configure
ffb010b5
RW
105 (lambda* (#:key inputs #:allow-other-keys)
106 (system* "qmake" (string-append "BOOST_DIR="
d694230a
EF
107 (assoc-ref inputs "boost")))))
108 (replace 'install
109 (lambda* (#:key outputs #:allow-other-keys)
f3860753
TGR
110 (let* ((out (assoc-ref outputs "out"))
111 (bin (string-append out "/bin"))
112 (share (string-append out "/share/librecad")))
113 (mkdir-p bin)
114 (install-file "unix/librecad" bin)
115 (mkdir-p share)
116 (copy-recursively "unix/resources" share)))))))
ffb010b5
RW
117 (inputs
118 `(("boost" ,boost)
119 ("muparser" ,muparser)
120 ("freetype" ,freetype)
9fdda0b2
RW
121 ("qtbase" ,qtbase)
122 ("qtsvg" ,qtsvg)))
ffb010b5
RW
123 (native-inputs
124 `(("pkg-config" ,pkg-config)
125 ("which" ,which)))
126 (home-page "http://librecad.org/")
127 (synopsis "Computer-aided design (CAD) application")
128 (description
129 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
130plans and designs.")
131 (license license:gpl2)))
412726ee
RW
132
133(define-public geda-gaf
134 (package
135 (name "geda-gaf")
12356eb8 136 (version "1.9.2")
412726ee
RW
137 (source (origin
138 (method url-fetch)
139 (uri (string-append
12356eb8 140 "http://ftp.geda-project.org/geda-gaf/unstable/v"
412726ee
RW
141 (version-major+minor version) "/"
142 version "/geda-gaf-" version ".tar.gz"))
143 (sha256
144 (base32
12356eb8 145 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
412726ee
RW
146 (build-system gnu-build-system)
147 (arguments
148 '(#:phases
2352c97d
RW
149 (modify-phases %standard-phases
150 ;; tests require a writable HOME
151 (add-before 'check 'set-home
152 (lambda _
153 (setenv "HOME" (getenv "TMPDIR"))
154 #t)))
0de98139
DT
155 #:configure-flags
156 (let ((pcb (assoc-ref %build-inputs "pcb")))
157 (list (string-append "--with-pcb-datadir=" pcb "/share")
158 (string-append "--with-pcb-lib-path="
159 pcb "/share/pcb/pcblib-newlib:"
160 pcb "/share/pcb/newlib")))))
412726ee
RW
161 (inputs
162 `(("glib" ,glib)
163 ("gtk" ,gtk+-2)
164 ("guile" ,guile-2.0)
165 ("desktop-file-utils" ,desktop-file-utils)
0de98139
DT
166 ("shared-mime-info" ,shared-mime-info)
167 ("m4" ,m4)
168 ("pcb" ,pcb)))
412726ee
RW
169 (native-inputs
170 `(("pkg-config" ,pkg-config)
171 ("perl" ,perl))) ; for tests
172 (home-page "http://geda-project.org/")
173 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
174 (description
a124bbd2 175 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
412726ee
RW
176suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
177which currently includes: gschem, a schematic capture program; gnetlist, a
178netlist generation program; gsymcheck, a syntax checker for schematic symbols;
179gattrib, a spreadsheet programm that manipulates the properties of symbols of
180a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
181tool to forward annotation from your schematic to layout using PCB; some minor
182utilities.")
183 (license license:gpl2+)))
184
20500662
RW
185(define-public pcb
186 (package
187 (name "pcb")
e981ca36 188 (version "4.0.0")
20500662
RW
189 (source (origin
190 (method url-fetch)
e981ca36
RW
191 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
192 "/pcb-" version ".tar.gz"))
20500662
RW
193 (sha256
194 (base32
e981ca36 195 "1i6sk8g8h9avms142wl07yv20m1cm4c3fq3v6hybrhdxs2n17plf"))))
20500662
RW
196 (build-system gnu-build-system)
197 (arguments
198 `(#:phases
dc1d3cde
KK
199 (modify-phases %standard-phases
200 (add-after 'unpack 'use-wish8.6
201 (lambda _
202 (substitute* "configure"
203 (("wish85") "wish8.6"))
204 #t))
205 (add-after 'install 'wrap
206 (lambda* (#:key inputs outputs #:allow-other-keys)
207 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
208 ;; fix of the mesa package we wrap the pcb executable such that
209 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
210 (let* ((out (assoc-ref outputs "out"))
211 (path (string-append (assoc-ref inputs "udev") "/lib")))
212 (wrap-program (string-append out "/bin/pcb")
213 `("LD_LIBRARY_PATH" ":" prefix (,path))))
214 #t))
215 (add-before 'check 'pre-check
216 (lambda _
217 (system "Xvfb :1 &")
218 (setenv "DISPLAY" ":1")
219 #t)))))
20500662
RW
220 (inputs
221 `(("dbus" ,dbus)
222 ("mesa" ,mesa)
223 ("udev" ,eudev) ;FIXME: required by mesa
224 ("glu" ,glu)
225 ("gd" ,gd)
226 ("gtk" ,gtk+-2)
227 ("gtkglext" ,gtkglext)
228 ("desktop-file-utils" ,desktop-file-utils)
229 ("shared-mime-info" ,shared-mime-info)
230 ("tk" ,tk)))
231 (native-inputs
232 `(("pkg-config" ,pkg-config)
233 ("intltool" ,intltool)
234 ("bison" ,bison)
e981ca36
RW
235 ("flex" ,flex)
236 ;; For tests
237 ("imagemagick" ,imagemagick)
238 ("gerbv" ,gerbv)
239 ("ghostscript" ,ghostscript)
240 ("xvfb" ,xorg-server)))
20500662
RW
241 (home-page "http://pcb.geda-project.org/")
242 (synopsis "Design printed circuit board layouts")
243 (description
244 "GNU PCB is an interactive tool for editing printed circuit board
245layouts. It features a rats-nest implementation, schematic/netlist import,
246and design rule checking. It also includes an autorouter and a trace
247optimizer; and it can produce photorealistic and design review images.")
248 (license license:gpl2+)))
93094501 249
49c2665f
RW
250(define-public pcb-rnd
251 (package (inherit pcb)
252 (name "pcb-rnd")
253 (version "1.1.3")
254 (source (origin
255 (method url-fetch)
256 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
257 "pcb-rnd-" version ".tar.gz"))
258 (sha256
259 (base32
260 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
261 (arguments
262 `(#:tests? #f ; no check target
263 #:phases
264 (modify-phases %standard-phases
265 (add-after 'unpack 'cc-is-gcc
266 (lambda _ (setenv "CC" "gcc") #t))
267 (replace 'configure
268 ;; The configure script doesn't tolerate most of our configure flags.
269 (lambda* (#:key outputs #:allow-other-keys)
270 (zero? (system* "sh" "configure"
271 (string-append "--prefix="
272 (assoc-ref outputs "out")))))))))
273 (home-page "http://repo.hu/projects/pcb-rnd/")
274 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
275featuring various improvements and bug fixes.")))
276
93094501
FB
277(define-public fastcap
278 (package
279 (name "fastcap")
280 (version "2.0-18Sep92")
281 (source (origin
95001d4b 282 (method url-fetch/tarbomb)
93094501
FB
283 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
284 name "-" version ".tgz"))
285 (sha256
286 (base32
287 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
3dac53be
FB
288 (snippet
289 ;; Remove a non-free file.
290 '(delete-file "doc/psfig.sty"))
fc1adab1
AK
291 (patches (search-patches "fastcap-mulSetup.patch"
292 "fastcap-mulGlobal.patch"))))
93094501
FB
293 (build-system gnu-build-system)
294 (native-inputs
295 `(("texlive" ,texlive)
fb0b9ff1 296 ("ghostscript" ,ghostscript)))
93094501
FB
297 (arguments
298 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
299 #:parallel-build? #f
300 #:tests? #f ;; no tests-suite
301 #:modules ((srfi srfi-1)
302 ,@%gnu-build-system-modules)
303 #:phases
304 (modify-phases %standard-phases
305 (add-after 'build 'make-doc
306 (lambda _
307 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
308 "manual"))))
309 (add-before 'make-doc 'fix-doc
310 (lambda _
311 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
312 (substitute* (find-files "doc" "\\.tex")
313 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
314 all file scale)
315 (string-append "\\includegraphics[scale=" scale "]{"
1f7ffd6f
FB
316 file "}"))
317 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
318 all file width)
319 (string-append "\\includegraphics[width=" width "]{"
320 file "}"))
321 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
322 all file height)
323 (string-append "\\includegraphics[height=" height "]{"
324 file "}"))
325 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
326 (string-append "\\includegraphics{" file "}")))
327 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
93094501
FB
328 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
329 all options class)
330 (string-append "\\documentclass[" options "]{"
331 class "}\n"
332 "\\usepackage{graphicx}\n"
333 "\\usepackage{robinspace}"))
334 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
335 (string-append "%" all))
336 (("\\\\setstretch\\{.*\\}" all)
337 (string-append "%" all)))
338 #t))
339 (delete 'configure)
340 (add-before 'install 'clean-bin
341 (lambda _
342 (delete-file (string-append (getcwd) "/bin/README"))
343 #t))
344 (add-before 'install 'make-pdf
345 (lambda _
346 (with-directory-excursion "doc"
347 (and
348 (every (lambda (file)
349 (zero? (system* "dvips" file "-o")))
350 (find-files "." "\\.dvi"))
351 (every (lambda (file)
352 (zero? (system* "ps2pdf" file)))
353 '("mtt.ps" "ug.ps" "tcad.ps"))
354 (zero? (system* "make" "clean"))))))
355 (replace 'install
356 (lambda* (#:key outputs #:allow-other-keys)
357 (let* ((out (assoc-ref outputs "out"))
358 (data (string-append out "/share"))
359 (bin (string-append out "/bin"))
360 (doc (string-append data "/doc/" ,name "-" ,version))
361 (examples (string-append doc "/examples")))
362 (with-directory-excursion "bin"
96c46210
LC
363 (for-each (lambda (f)
364 (install-file f bin))
365 (find-files "." ".*")))
93094501
FB
366 (copy-recursively "doc" doc)
367 (copy-recursively "examples" examples)
368 #t))))))
369 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
370 (synopsis "Multipole-accelerated capacitance extraction program")
371 (description
372 "Fastcap is a capacitance extraction program based on a
373multipole-accelerated algorithm.")
374 (license (license:non-copyleft #f "See fastcap.c."))))
23bae7bb
FB
375
376(define-public fasthenry
377 (package
378 (name "fasthenry")
379 (version "3.0-12Nov96")
380 (source (origin
381 (method url-fetch)
382 (file-name (string-append name "-" version ".tar.gz"))
383 (uri (string-append
384 "http://www.rle.mit.edu/cpg/codes/" name
385 "-" version ".tar.z"))
386 (sha256
387 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
fc1adab1
AK
388 (patches (search-patches "fasthenry-spAllocate.patch"
389 "fasthenry-spBuild.patch"
390 "fasthenry-spUtils.patch"
391 "fasthenry-spSolve.patch"
392 "fasthenry-spFactor.patch"))))
23bae7bb
FB
393 (build-system gnu-build-system)
394 (arguments
395 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
396 #:parallel-build? #f
397 #:tests? #f ;; no tests-suite
398 #:modules ((srfi srfi-1)
399 ,@%gnu-build-system-modules)
400 #:phases
401 (modify-phases %standard-phases
402 (delete 'configure)
403 (replace 'install
404 (lambda* (#:key outputs #:allow-other-keys)
405 (let* ((out (assoc-ref outputs "out"))
406 (data (string-append out "/share"))
407 (bin (string-append out "/bin"))
408 (doc (string-append data "/doc/" ,name "-" ,version))
409 (examples (string-append doc "/examples")))
410 (with-directory-excursion "bin"
96c46210
LC
411 (for-each (lambda (f)
412 (install-file f bin))
413 (find-files "." ".*")))
23bae7bb
FB
414 (copy-recursively "doc" doc)
415 (copy-recursively "examples" examples)
416 #t))))))
417 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
418 (synopsis "Multipole-accelerated inductance analysis program")
419 (description
420 "Fasthenry is an inductance extraction program based on a
421multipole-accelerated algorithm.")
422 (license (license:non-copyleft #f "See induct.c."))))
95283f3f 423
3d5fd240
RW
424(define-public fritzing
425 (package
426 (name "fritzing")
427 (version "0.9.2b")
428 (source (origin
429 (method url-fetch)
430 (uri (string-append "https://github.com/fritzing/"
431 "fritzing-app/archive/" version ".tar.gz"))
432 (file-name (string-append name "-" version ".tar.gz"))
433 (sha256
434 (base32
fd75eb6c 435 "15rwjp4xdj9w1z9f709rz9p0k2mi9k9idma9hvzkj5j8p04mg7yd"))))
3d5fd240
RW
436 (build-system gnu-build-system)
437 (arguments
438 `(#:phases
439 (modify-phases %standard-phases
440 (replace 'configure
441 (lambda* (#:key inputs outputs #:allow-other-keys)
442 (and (zero? (system* "tar"
443 "-xvf" (assoc-ref inputs "fritzing-parts-db")
444 "-C" "parts"))
445 (zero? (system* "qmake"
446 (string-append "PREFIX="
447 (assoc-ref outputs "out"))
448 "phoenix.pro"))))))))
449 (inputs
a2b99351
DC
450 `(("qtbase" ,qtbase)
451 ("qtserialport" ,qtserialport)
452 ("qtsvg" ,qtsvg)
3d5fd240
RW
453 ("boost" ,boost)
454 ("zlib" ,zlib)
455 ("fritzing-parts-db"
456 ,(origin
457 (method url-fetch)
458 (uri (string-append "https://github.com/fritzing/"
459 "fritzing-parts/archive/" version ".tar.gz"))
460 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
461 (sha256
462 (base32
463 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
464 (home-page "http://fritzing.org")
465 (synopsis "Electronic circuit design")
466 (description
467 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
468software with a low entry barrier, suited for the needs of makers and
469hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
470library with many commonly used high-level components. Fritzing makes it very
471easy to communicate about circuits, as well as to turn them into PCB layouts
472ready for production.")
473 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
474 ;; released under GPLv3+.
475 (license (list license:gpl3+ license:cc-by-sa3.0))))
476
95283f3f
RW
477(define-public gerbv
478 (package
479 (name "gerbv")
480 (version "2.6.1")
481 (source (origin
482 (method url-fetch)
483 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
484 version "/gerbv-" version ".tar.gz"))
485 (sha256
486 (base32
487 "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
488 (build-system gnu-build-system)
489 (arguments
490 `(#:phases
491 (modify-phases %standard-phases
d10092b8
KK
492 (add-after 'unpack 'autoconf
493 (lambda _
494 ;; Build rules contain references to Russian translation, but the
495 ;; needed files are missing; see
496 ;; http://sourceforge.net/p/gerbv/bugs/174/
497 (delete-file "po/LINGUAS")
498 (substitute* "man/Makefile.am"
499 (("PO_FILES= gerbv.ru.1.in.po") "")
500 (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
501 (zero? (system* "autoreconf" "-vfi")))))))
95283f3f
RW
502 (native-inputs
503 `(("autoconf" ,autoconf)
504 ("automake" ,automake)
505 ("libtool" ,libtool)
b94a6ca0 506 ("gettext" ,gettext-minimal)
95283f3f
RW
507 ("po4a" ,po4a)
508 ("pkg-config" ,pkg-config)))
509 (inputs
510 `(("cairo" ,cairo)
511 ("gtk" ,gtk+-2)
512 ("desktop-file-utils" ,desktop-file-utils)))
513 (home-page "http://gerbv.geda-project.org/")
514 (synopsis "Gerber file viewer")
515 (description
516 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
517is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
518you load several files on top of each other, do measurements on the displayed
519image, etc. Besides viewing Gerbers, you may also view Excellon drill files
520as well as pick-place files.")
521 (license license:gpl2+)))
4534d85e
LC
522
523(define-public ao
524 (let ((commit "0bc2354b8dcd1a82a0fd6647706b126045e52734"))
525 (package
526 (name "ao-cad") ;XXX: really "ao", but it collides with libao
527 (version (string-append "0." (string-take commit 7)))
528 (source (origin
529 (method git-fetch)
530 (uri (git-reference
531 (url "https://github.com/mkeeter/ao")
532 (commit commit)))
533 (sha256
534 (base32
535 "0lm7iljklafs8dhlvaab2yhwx4xymrdjrqk9c5xvn59hlvbgl1j5"))
536 (file-name (string-append name "-" version "-checkout"))
537 (modules '((guix build utils)))
538 (snippet
539 ;; Remove bundled libraries: Eigen, glm, and catch. TODO:
540 ;; Unbundle efsw <https://github.com/diegostamigni/efsw>.
541 '(begin
542 (delete-file-recursively "vendor")
543
544 ;; Use #include <catch.hpp>.
545 (substitute* (find-files "." "\\.[ch]pp$")
546 (("catch/catch\\.hpp")
547 "catch.hpp"))))))
548 (build-system cmake-build-system)
549 (arguments
550 `(;; Have the RUNPATH of libao.so point to $libdir, where libefsw.so
551 ;; lives.
552 #:configure-flags (list (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
553 "-Wl,-rpath="
554 (assoc-ref %outputs "out")
555 "/lib"))
556
557 #:phases
558 (modify-phases %standard-phases
559 (add-before 'build 'add-eigen-to-search-path
560 (lambda* (#:key inputs #:allow-other-keys)
561 ;; Allow things to find our own Eigen and Catch.
562 (let ((eigen (assoc-ref inputs "eigen")))
563 (setenv "CPLUS_INCLUDE_PATH"
564 (string-append eigen "/include/eigen3:"
565 (getenv "CPLUS_INCLUDE_PATH")))
566 #t)))
567 (add-after 'install 'install-guile-bindings
d7d5050c 568 (lambda* (#:key inputs outputs #:allow-other-keys)
4534d85e
LC
569 ;; Install the Guile bindings (the build system only installs
570 ;; libao.so.)
571 (let* ((out (assoc-ref outputs "out"))
572 (moddir (string-append out "/share/guile/site/2.0")))
573 (install-file "bind/libao.so"
574 (string-append out "/lib"))
575
576 ;; Go to the source directory.
577 (with-directory-excursion ,(string-append "../"
578 name "-" version
579 "-checkout")
580 (substitute* "bind/guile/ao/bind.scm"
581 (("\\(define libao \\(dynamic-link .*$")
582 (string-append "(define libao (dynamic-link \""
583 out "/lib/libao\")) ;")))
584
585 (for-each (lambda (file)
586 (install-file file
587 (string-append moddir
588 "/ao")))
589 (find-files "bind/guile" "\\.scm$"))
590
591 (substitute* "bin/ao-guile"
592 (("\\(add-to-load-path .*")
593 (string-append "(add-to-load-path \"" moddir "\")")))
594
595 (install-file "bin/ao-guile"
596 (string-append out "/bin"))
d7d5050c
LC
597
598 ;; Allow Ao to dlopen the relevant GL libraries. Otherwise
599 ;; it fails with:
600 ;; Couldn't find current GLX or EGL context.
601 (let ((mesa (assoc-ref inputs "mesa")))
602 (wrap-program (string-append out "/bin/ao-guile")
603 `("LD_LIBRARY_PATH" ":" prefix
604 (,(string-append mesa "/lib")))))
4534d85e
LC
605 #t)))))))
606 (native-inputs
607 `(("pkg-config" ,pkg-config)))
608 (inputs
609 `(("boost" ,boost)
610 ("catch" ,catch-framework)
611 ("libpng" ,libpng)
612 ("glfw" ,glfw)
613 ("libepoxy" ,libepoxy)
d7d5050c 614 ("mesa" ,mesa)
4534d85e
LC
615 ("eigen" ,eigen)
616 ("glm" ,glm)
617 ("guile" ,guile-2.0)))
618 (home-page "http://www.mattkeeter.com/projects/ao/")
619 (synopsis "Tool for programmatic computer-aided design")
620 (description
621 "Ao is a tool for programmatic computer-aided design (CAD). In Ao,
622solid models are defined as Scheme scripts, and there are no opaque function
623calls into the geometry kernel: everything is visible to the user. Even
624fundamental, primitive shapes are represented as code in the user-level
625language.")
626 (license (list license:lgpl2.1+ ;library
627 license:gpl2+))))) ;Guile bindings
befc9ff6
TF
628
629;; We use kicad from a git commit, because support for boost 1.61.0 has been
630;; recently added.
631(define-public kicad
c48799c0
TF
632 (let ((commit "5f4599fb56da4dd748845ab10abec02961d477f3")
633 (revision "2"))
befc9ff6
TF
634 (package
635 (name "kicad")
636 (version (string-append "4.0-" revision "."
637 (string-take commit 7)))
638 (source
639 (origin
640 (method git-fetch)
641 (uri (git-reference
642 (url "https://git.launchpad.net/kicad")
643 (commit commit)))
644 (sha256
c48799c0 645 (base32 "1833pln2975gmc5s18xf7s8m9vg834lmxxdjk0wlk3lq7bvjjnff"))
befc9ff6
TF
646 (file-name (string-append name "-" version "-checkout"))))
647 (build-system cmake-build-system)
648 (arguments
649 `(#:out-of-source? #t
650 #:tests? #f ; no tests
651 #:configure-flags
652 (list "-DKICAD_STABLE_VERSION=ON"
653 "-DKICAD_REPO_NAME=stable"
654 ,(string-append "-DKICAD_BUILD_VERSION=4.0-"
655 (string-take commit 7))
656 "-DCMAKE_BUILD_TYPE=Release"
657 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
658 "-DKICAD_SCRIPTING=ON"
659 "-DKICAD_SCRIPTING_MODULES=ON"
660 "-DKICAD_SCRIPTING_WXPYTHON=ON"
661 ;; Has to be set explicitely, as we don't have the wxPython
662 ;; headers in the wxwidgets store item, but in wxPython.
663 (string-append "-DCMAKE_CXX_FLAGS=-I"
664 (assoc-ref %build-inputs "wxpython")
665 "/include/wx-3.0")
666 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
50942a69 667 "-DKICAD_SPICE=TRUE"
befc9ff6
TF
668 ;; TODO: Enable this when CA certs are working with curl.
669 "-DBUILD_GITHUB_PLUGIN=OFF")
670 #:phases
671 (modify-phases %standard-phases
672 (add-after 'install 'wrap-program
673 ;; Ensure correct Python at runtime.
674 (lambda* (#:key inputs outputs #:allow-other-keys)
675 (let* ((out (assoc-ref outputs "out"))
676 (python (assoc-ref inputs "python"))
677 (file (string-append out "/bin/kicad"))
678 (path (string-append
679 out
680 "/lib/python2.7/site-packages:"
681 (getenv "PYTHONPATH"))))
682 (wrap-program file
683 `("PYTHONPATH" ":" prefix (,path))
684 `("PATH" ":" prefix
685 (,(string-append python "/bin:")))))
c48799c0
TF
686 #t))
687 (add-after 'wrap-program 'install-lib-3d
688 (lambda* (#:key inputs outputs #:allow-other-keys)
689 (for-each
690 (lambda (file)
691 (install-file file (string-append (assoc-ref outputs "out")
692 "/lib")))
693 (find-files "." "^libkicad_3dsg.*"))
befc9ff6
TF
694 #t)))))
695 (native-inputs
696 `(("boost" ,boost)
697 ("gettext" ,gnu-gettext)
698 ("pkg-config" ,pkg-config)
699 ("swig" ,swig)
700 ("zlib" ,zlib)))
701 (inputs
702 `(("cairo" ,cairo)
703 ("curl" ,curl)
704 ("desktop-file-utils" ,desktop-file-utils)
705 ("glew" ,glew)
706 ("glm" ,glm)
707 ("hicolor-icon-theme" ,hicolor-icon-theme)
50942a69 708 ("libngspice" ,libngspice)
befc9ff6
TF
709 ("libsm" ,libsm)
710 ("mesa" ,mesa)
711 ("openssl" ,openssl)
712 ("python" ,python-2)
713 ("wxwidgets" ,wxwidgets-gtk2)
714 ("wxpython" ,python2-wxpython)))
715 (home-page "http://kicad-pcb.org/")
716 (synopsis "Electronics Design Automation Suite")
717 (description "Kicad is a program for the formation of printed circuit
718boards and electrical circuits. The software has a number of programs that
719perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
720electrical diagrams), gerbview (viewing Gerber files) and others.")
721 (license license:gpl3+))))
8f528bd4
TF
722
723(define-public kicad-library
c16fabfa 724 (let ((version "4.0.6"))
8f528bd4
TF
725 (package
726 (name "kicad-library")
727 (version version)
728 (source (origin
729 (method url-fetch)
730 (uri (string-append
731 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
732 version ".tar.gz"))
733 (sha256
734 (base32
c16fabfa 735 "16f47pd6f0ddsdxdrp327nr9v05gl8c24d0qypq2aqx5hdjmkp7f"))))
8f528bd4
TF
736 (build-system cmake-build-system)
737 (arguments
738 `(#:out-of-source? #t
739 #:tests? #f ; no tests
740 #:phases
741 (modify-phases %standard-phases
742 (add-after 'install 'install-footprints ; from footprints tarball
743 (lambda* (#:key inputs outputs #:allow-other-keys)
744 (zero? (system* "tar" "xvf"
745 (assoc-ref inputs "kicad-footprints")
746 "-C" (string-append (assoc-ref outputs "out")
747 "/share/kicad/modules")
748 "--strip-components=1"))))
749 ;; We change the default global footprint file, which is generated if
750 ;; it doesn't exist in user's home directory, from the one using the
751 ;; github plugin, to the one using the KISYSMOD environment path.
752 (add-after 'install-footprints 'use-pretty-footprint-table
753 (lambda* (#:key outputs #:allow-other-keys)
754 (let* ((out (assoc-ref outputs "out"))
755 (template-dir (string-append out "/share/kicad/template"))
756 (fp-lib-table (string-append template-dir "/fp-lib-table")))
757 (delete-file fp-lib-table)
758 (copy-file (string-append fp-lib-table ".for-pretty")
759 fp-lib-table))
760 #t)))))
761 (native-search-paths
762 (list (search-path-specification
763 (variable "KISYSMOD") ; footprint path
764 (files '("share/kicad/modules")))
765 (search-path-specification
766 (variable "KISYS3DMOD") ; 3D model path
767 (files '("share/kicad/modules/packages3d")))))
768 ;; Kicad distributes footprints in a separate tarball
769 (native-inputs
770 `(("kicad-footprints"
771 ,(origin
772 (method url-fetch)
773 (uri (string-append
774 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
775 version ".tar.gz"))
776 (sha256
777 (base32
c16fabfa 778 "0vmgqhdw05k5fdnqv42grnvlz7v75g9md82jp2d3dvw2zw050lfb"))))))
8f528bd4
TF
779 (home-page "http://kicad-pcb.org/")
780 (synopsis "Libraries for kicad")
781 (description "This package provides Kicad component, footprint and 3D
782render model libraries.")
783 (license license:lgpl2.0+))))
5f947808
JD
784
785(define-public linsmith
786 (package
787 (name "linsmith")
788 (version "0.99.30")
789 (source (origin
790 (method url-fetch)
791 (uri (string-append
792 "mirror://sourceforge/linsmith/linsmith/linsmith-"
793 version "/linsmith-" version ".tar.gz"))
794 (sha256
795 (base32
796 "18qslhr2r45rhpj4v6bjcqx189vs0bflvsj271wr7w8kvh69qwvn"))))
797 (build-system gnu-build-system)
798 (native-inputs
799 `(("pkg-config" ,pkg-config)
800 ("gtk" ,gtk+-2)
801 ("libgnome" ,libgnomeui)))
802 (home-page "http://jcoppens.com/soft/linsmith/index.en.php")
803 (synopsis "Smith Charting program")
804 (description "LinSmith is a Smith Charting program, mainly designed for
805educational use. As such, there is an emphasis on capabilities that improve
806the 'showing the effect of'-style of operation.")
807 (license license:gpl2+)))
2766f9e8
DM
808
809(define-public volk
810 (package
811 (name "volk")
812 (version "1.3")
813 (source
814 (origin
815 (method url-fetch)
816 (uri (string-append "http://libvolk.org/releases/volk-"
817 version ".tar.gz"))
818 (sha256
819 (base32
820 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
821 (build-system cmake-build-system)
822 (inputs
823 `(("boost" ,boost)))
824 (native-inputs
825 `(("python-2", python-2)
826 ("python2-cheetah" ,python2-cheetah)))
827 (home-page "http://libvolk.org/")
828 (synopsis "Vector-Optimized Library of Kernels")
829 (description
830 "@code{volk} contains procedures with machine-specific optimizations
831for mathematical functions. It also provides an machine-independent
832interface to select the best such procedures to use on a given system.")
833 (license license:gpl3+)))
f37f949d
DM
834
835(define-public minicom
836 (package
837 (name "minicom")
838 (version "2.7.1")
839 (source
840 (origin
841 (method url-fetch)
842 (uri (string-append "https://alioth.debian.org/frs/download.php/"
843 "file/4215/" name "-" version ".tar.gz"))
844 (sha256
845 (base32
846 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
847 (build-system gnu-build-system)
848 (arguments
849 `(#:configure-flags '("--enable-lock-dir=/var/lock")
850 #:phases
851 (modify-phases %standard-phases
852 (add-after 'unpack 'patch-lock-check
853 (lambda _
854 (substitute* "configure"
855 (("test -d [$]UUCPLOCK") "true"))
856 #t)))))
857 (inputs
858 `(("ncurses" ,ncurses)))
859 (home-page "https://alioth.debian.org/projects/minicom/")
860 (synopsis "Serial terminal emulator")
861 (description "@code{minicom} is a serial terminal emulator.")
862 (license license:gpl2+)))
1251c664
TF
863
864(define-public harminv
865 (package
866 (name "harminv")
867 (version "1.4")
868 (source (origin
869 (method url-fetch)
870 (uri
871 (string-append
872 "http://ab-initio.mit.edu/harminv/harminv-"
873 version ".tar.gz"))
874 (sha256
875 (base32
876 "1pmm8d6fx9ahhnk7w12bfa6zx3afbkg4gkvlvgwhpjxbcrvrp3jk"))))
877 (build-system gnu-build-system)
878 (arguments
879 `(#:phases
880 (modify-phases %standard-phases
881 (add-before 'configure 'fix-tests
882 (lambda _
883 (substitute* "./sines-test.sh"
884 ; change test frequency range - default fails
885 (("0\\.15") "0.16"))
886 #t)))))
887 (native-inputs
888 `(("fortran" ,gfortran)))
889 (inputs
890 `(("lapack" ,lapack)))
891 (home-page "http://ab-initio.mit.edu/wiki/index.php/Harminv")
892 (synopsis "Harmonic inversion solver")
893 (description
894 "Harminv is a free program (and accompanying library) to solve the problem of
895harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
896of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
897determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
898 (license license:gpl2+)))
cbd9568f
TF
899
900(define-public guile-libctl
901 (package
902 (name "guile-libctl")
903 (version "3.2.2")
904 (source (origin
905 (method url-fetch)
906 (uri
907 (string-append
908 "http://ab-initio.mit.edu/libctl/libctl-"
909 version ".tar.gz"))
910 (sha256
911 (base32
912 "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
913 (build-system gnu-build-system)
914 (native-inputs
915 `(("fortran" ,gfortran)))
916 (inputs
917 `(("guile" ,guile-2.2)))
918 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
919 (synopsis "Flexible control files implementation for scientific simulations")
920 (description
921 "Libctl is a Guile-based library implementing flexible control files
922for scientific simulations.")
923 (license license:gpl2+)))
5e872d4b
TF
924
925(define-public mpb
926 (package
927 (name "mpb")
928 (version "1.5")
929 (source (origin
930 (method url-fetch)
931 (uri
932 (string-append
933 "http://ab-initio.mit.edu/mpb/mpb-"
934 version ".tar.gz"))
935 (sha256
936 (base32
937 "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
938 (build-system gnu-build-system)
939 (arguments
940 `(#:configure-flags
941 (list (string-append "--with-libctl="
942 (assoc-ref %build-inputs "libctl")
943 "/share/libctl"))))
944 (native-inputs
945 `(("fortran" ,gfortran)
946 ("pkg-config" ,pkg-config)
947 ("swig" ,swig)))
948 (inputs
949 `(("fftw" ,fftw)
950 ("gsl" ,gsl)
951 ("guile" ,guile-2.2)
952 ("hdf5" ,hdf5)
953 ("lapack" ,lapack)
954 ("libctl" ,guile-libctl)
955 ("readline" ,readline)
956 ("zlib" ,zlib)))
957 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
958 (synopsis "Computes band structures and electromagnetic modes of dielectric
959structures")
960 (description
961 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
962of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
963fully-vectorial and three-dimensional methods.")
964 (license license:gpl2+)))
28b08d2a
TF
965
966(define-public meep
967 (package
968 (name "meep")
969 (version "1.3")
970 (source (origin
971 (method url-fetch)
972 (uri
973 (string-append
974 "http://ab-initio.mit.edu/meep/meep-"
975 version ".tar.gz"))
976 (sha256
977 (base32
978 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
979 (build-system gnu-build-system)
980 (arguments
981 `(#:configure-flags
982 (list (string-append "--with-libctl="
983 (assoc-ref %build-inputs "libctl")
984 "/share/libctl"))))
985 (native-inputs
986 `(("fortran" ,gfortran)
987 ("pkg-config" ,pkg-config)
988 ("swig" ,swig)))
989 (inputs
990 `(("fftw" ,fftw)
991 ("gsl" ,gsl)
8bca358b 992 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
28b08d2a
TF
993 ("harminv" ,harminv)
994 ("hdf5" ,hdf5)
995 ("lapack" ,lapack)
996 ("libctl" ,guile-libctl)
997 ("mpb" ,mpb)
998 ("zlib" ,zlib)))
999 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
1000 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1001 (description
1002 "Meep is a finite-difference time-domain (FDTD) simulation software package
1003developed at MIT to model electromagnetic systems.")
1004 (license license:gpl2+)))
8bca358b
TF
1005
1006(define-public adms
1007 (package
1008 (name "adms")
1009 (version "2.3.6")
1010 (source (origin
1011 (method url-fetch)
1012 (uri
1013 (string-append
1014 "mirror://sourceforge/mot-adms/adms-source/"
1015 (version-major+minor version) "/adms-" version ".tar.gz"))
1016 (sha256
1017 (base32
1018 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1019 (build-system gnu-build-system)
1020 (native-inputs
1021 `(("flex" ,flex)
1022 ("bison" ,bison)))
1023 (home-page "https://sourceforge.net/projects/mot-adms")
1024 (synopsis "Automatic device model synthesizer")
1025 (description
1026 "ADMS is a code generator that converts electrical compact device models
1027specified in high-level description language into ready-to-compile C code for
1028the API of spice simulators. Based on transformations specified in XML
1029language, ADMS transforms Verilog-AMS code into other target languages.")
1030 (license license:gpl3)))
6febda94
JL
1031
1032(define-public capstone
1033 (package
1034 (name "capstone")
1035 (version "3.0.5-rc2")
1036 (source (origin
1037 (method url-fetch)
1038 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1039 version ".tar.gz"))
1040 (file-name (string-append name "-" version ".tar.gz"))
1041 (sha256
1042 (base32
1043 "1cqms9r2p43aiwp5spd84zaccp16ih03r7sjhrv16nddahj0jz2q"))))
1044 (build-system gnu-build-system)
1045 (arguments
1046 `(#:tests? #f
1047 #:make-flags (list (string-append "PREFIX=" %output)
1048 "CC=gcc")
1049 #:phases
1050 (modify-phases %standard-phases
1051 (delete 'configure)
1052 ;; cstool's Makefile overrides LDFLAGS, so we cannot pass it as a make flag.
1053 (add-before 'build 'fix-cstool-ldflags
1054 (lambda* (#:key outputs #:allow-other-keys)
1055 (substitute* "cstool/Makefile"
1056 (("LDFLAGS =")
1057 (string-append "LDFLAGS = -Wl,-rpath=" (assoc-ref outputs "out")
1058 "/lib")))
1059 #t)))))
1060 (home-page "http://www.capstone-engine.org")
1061 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1062 (description
1063 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1064framework. Capstone can disassemble machine code for many supported architectures
1065such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1066bindings for Python, Java, OCaml and more.")
1067 (license license:bsd-3)))
f70be011
JL
1068
1069;; FIXME: This package has a timestamp embedded in
1070;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1071(define-public python-capstone
1072 (package
1073 (inherit capstone)
1074 (name "python-capstone")
1075 (propagated-inputs
1076 `(("capstone" ,capstone)))
1077 (build-system python-build-system)
1078 (arguments
1079 `(#:phases
1080 (modify-phases %standard-phases
1081 (add-after 'unpack 'chdir-and-fix-setup-py
1082 (lambda _
1083 (chdir "bindings/python")
1084 ;; Do not build the library again, because we already have it.
1085 (substitute* "setup.py" ((".* build_libraries.*") ""))
1086 ;; This substitution tells python-capstone where to find the
1087 ;; library.
1088 (substitute* "capstone/__init__.py"
1089 (("pkg_resources.resource_filename.*")
1090 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1091 #t)))))))
1092
1093(define-public python2-capstone
1094 (package-with-python2 python-capstone))
44669577
JL
1095
1096(define-public radare2
1097 (package
1098 (name "radare2")
1099 (version "1.6.0")
1100 (source (origin
1101 (method url-fetch)
1102 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1103 name "-" version ".tar.gz"))
1104 (sha256
1105 (base32
1106 "16ggsk40zz6hyvclvqj1r4bh4hb78jf0d6ppry1jk4r0j30wm7cm"))
1107 (modules '((guix build utils)))
1108 (snippet
1109 '(begin
1110 (substitute* "libr/asm/p/Makefile"
1111 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1112 (substitute* "libr/parse/p/Makefile"
1113 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1114 (substitute* "libr/bin/p/Makefile"
1115 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))))))
1116 (build-system gnu-build-system)
1117 (arguments
1118 '(#:tests? #f; tests require git and network access
1119 #:phases
1120 (modify-phases %standard-phases
1121 (add-before 'configure 'mklibdir
1122 (lambda* (#:key inputs #:allow-other-keys)
1123 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1124 #t)))
1125 #:configure-flags
1126 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1127 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1128 #:make-flags
1129 (list "CC=gcc")))
1130 (inputs
1131 `(("openssl" ,openssl)
1132 ("zip" ,zip)
1133 ("gmp" ,gmp)
1134 ("capstone" ,capstone)))
1135 (native-inputs
1136 `(("pkg-config" ,pkg-config)))
1137 (home-page "https://radare.org/")
1138 (synopsis "Portable reversing framework")
1139 (description
1140 "Radare project started as a forensics tool, a scriptable commandline
1141hexadecimal editor able to open disk files, but later support for analyzing
1142binaries, disassembling code, debugging programs, attaching to remote gdb
1143servers, ...")
1144 (license license:lgpl3)))
a6edcfaf
TF
1145
1146(define-public asco
1147 (package
1148 (name "asco")
1149 (version "0.4.10")
1150 (source (origin
1151 (method url-fetch)
1152 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
1153 version ".tar.gz"))
1154 (sha256
1155 (base32
1156 "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
1157 (build-system gnu-build-system)
1158 (arguments
1159 `(#:tests? #f ; no tests
1160 #:make-flags '("all" "asco-mpi")
1161 #:phases
1162 (modify-phases %standard-phases
1163 (delete 'configure)
1164 (add-before 'build 'fix-paths
1165 (lambda* (#:key inputs #:allow-other-keys)
1166 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
1167 (substitute* '("errfunc.c" "asco.c")
1168 (("cp ")
1169 (string-append coreutils "/bin/cp "))
1170 (("nice")
1171 (string-append coreutils "/bin/nice")))
1172 (substitute* "Makefile"
1173 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
1174 #t)))
1175 (replace 'install ; no install target
1176 (lambda* (#:key outputs #:allow-other-keys)
1177 (for-each (lambda (file)
1178 (install-file file (string-append
1179 (assoc-ref outputs "out")
1180 "/bin")))
1181 '("asco" "asco-mpi" "asco-test"
1182 "tools/alter/alter" "tools/log/log"))
1183 #t)))))
1184 (native-inputs
1185 `(("mpi" ,openmpi)))
1186 (inputs
1187 `(("coreutils-minimal" ,coreutils-minimal)))
1188 (home-page "http://asco.sourceforge.net/")
1189 (synopsis "SPICE circuit optimizer")
1190 (description
1191 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
1192high-performance parallel differential evolution (DE) optimization algorithm.")
1193 (license license:gpl2+)))
710cc1a4
TF
1194
1195(define-public libngspice
1196 ;; Note: The ngspice's build system does not allow us to build both the
1197 ;; library and the executables in one go. Thus, we have two packages.
1198 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
1199 (package
1200 (name "libngspice")
1201 (version "26")
1202 (source (origin
1203 (method url-fetch)
1204 (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
1205 version "/ngspice-" version ".tar.gz"))
1206 (sha256
1207 (base32
1208 "02019ndcl057nq9z41nxycqba7wxlb081ibvfj9jv010nz431qji"))
1209 (modules '((guix build utils)))
1210 ;; We remove the non-free cider and build without it.
1211 (snippet
1212 '(begin
1213 (delete-file-recursively "src/ciderlib")
1214 (delete-file "src/ciderinit")
1215 (substitute* "configure"
1216 (("src/ciderlib/Makefile") "")
1217 (("src/ciderlib/input/Makefile") "")
1218 (("src/ciderlib/support/Makefile") "")
1219 (("src/ciderlib/oned/Makefile") "")
1220 (("src/ciderlib/twod/Makefile") ""))))))
1221 (build-system gnu-build-system)
1222 (arguments
1223 `(;; No tests for libngspice exist.
1224 ;; The transient tests for ngspice fail.
1225 #:tests? #f
1226 #:phases
1227 (modify-phases %standard-phases
1228 (add-after 'unpack 'patch-timestamps
1229 (lambda _
1230 (substitute* "configure"
1231 (("`date`") "Do 1. Jan 00:00:00 UTC 1970"))
1232 #t))
1233 (add-after 'unpack 'delete-program-manuals
1234 (lambda _
1235 (substitute* "man/man1/Makefile.in"
1236 (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
1237 "man_MANS = "))
1238 #t))
1239 (add-after 'install 'delete-script-files
1240 (lambda* (#:key outputs #:allow-other-keys)
1241 (delete-file-recursively
1242 (string-append (assoc-ref outputs "out")
1243 "/share/ngspice/scripts")))))
1244 #:configure-flags
1245 (list "--enable-openmp"
1246 "--enable-xspice"
1247 "--with-ngshared"
1248 "--with-readline=yes")))
1249 (native-inputs
1250 `(("bison" ,bison)
1251 ("flex" ,flex)))
1252 (inputs
1253 `(("libxaw" ,libxaw)
1254 ("mpi" ,openmpi)
1255 ("readline" ,readline)))
1256 (home-page "http://ngspice.sourceforge.net/")
1257 (synopsis "Mixed-level/mixed-signal circuit simulator")
1258 (description
1259 "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
1260@code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
1261provides code modeling support and simulation of digital components through
1262an embedded event driven algorithm.")
1263 (license (list license:lgpl2.0+ ; code in frontend/numparam
1264 (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
1265 license:public-domain)))) ; xspice
1266
1267(define-public ngspice
1268 ;; The ngspice executables (see libngpsice above.)
1269 (package (inherit libngspice)
1270 (name "ngspice")
1271 (arguments
1272 (substitute-keyword-arguments (package-arguments libngspice)
1273 ((#:configure-flags flags)
1274 `(delete "--with-ngshared" ,flags))
1275 ((#:phases phases)
1276 `(modify-phases ,phases
1277 (add-after 'unpack 'delete-include-files
1278 (lambda _
1279 (substitute* "src/Makefile.in"
1280 (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
1281 "SUBDIRS = misc maths frontend spicelib"))
1282 #t))
1283 (add-after 'install 'delete-cmpp-dlmain
1284 (lambda* (#:key outputs #:allow-other-keys)
1285 (for-each (lambda (file)
1286 (delete-file
1287 (string-append (assoc-ref outputs "out")
1288 file)))
1289 '("/bin/cmpp" "/share/ngspice/dlmain.c"))
1290 #t))
1291 (delete 'delete-program-manuals)
1292 (delete 'delete-script-files)))))
1293 (inputs
1294 `(("libngspice" ,libngspice)
1295 ("readline" ,readline)))))
1da02b6a
TF
1296
1297(define trilinos-serial-xyce
1298 ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
1299 ;; keep it private. See
1300 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
1301 ;; TODO: Remove when we have modular Trilinos packages?
1302 (package
1303 (name "trilinos-serial-xyce")
1304 (version "12.6.3")
1305 (source
1306 (origin (method url-fetch)
1307 (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
1308 version "-Source.tar.gz"))
1309 (sha256
1310 (base32
1311 "07jd1qpsbf31cmbyyngr4l67xzwyan24dyx5wlcahgbw7x6my3wn"))))
1312 (build-system cmake-build-system)
1313 (arguments
1314 `(#:out-of-source? #t
1315 #:configure-flags
1316 (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
1317 "-DCMAKE_C_FLAGS=-O3 -fPIC"
1318 "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
1319 "-DTrilinos_ENABLE_NOX=ON"
1320 "-DNOX_ENABLE_LOCA=ON"
1321 "-DTrilinos_ENABLE_EpetraExt=ON"
1322 "-DEpetraExt_BUILD_BTF=ON"
1323 "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
1324 "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
1325 "-DTrilinos_ENABLE_TrilinosCouplings=ON"
1326 "-DTrilinos_ENABLE_Ifpack=ON"
1327 "-DTrilinos_ENABLE_Isorropia=ON"
1328 "-DTrilinos_ENABLE_AztecOO=ON"
1329 "-DTrilinos_ENABLE_Belos=ON"
1330 "-DTrilinos_ENABLE_Teuchos=ON"
1331 "-DTeuchos_ENABLE_COMPLEX=ON"
1332 "-DTrilinos_ENABLE_Amesos=ON"
1333 "-DAmesos_ENABLE_KLU=ON"
1334 "-DAmesos_ENABLE_UMFPACK=ON"
1335 "-DTrilinos_ENABLE_Sacado=ON"
1336 "-DTrilinos_ENABLE_Kokkos=OFF"
1337 "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
1338 "-DTPL_ENABLE_AMD=ON"
1339 "-DTPL_ENABLE_UMFPACK=ON"
1340 "-DTPL_ENABLE_BLAS=ON"
1341 "-DTPL_ENABLE_LAPACK=ON")))
1342 (native-inputs
1343 `(("fortran" ,gfortran)
1344 ("swig" ,swig)))
1345 (inputs
1346 `(("boost" ,boost)
1347 ("lapack" ,lapack-3.5)
1348 ("suitesparse" ,suitesparse)))
1349 (home-page "https://trilinos.org")
1350 (synopsis "Engineering and scientific problems algorithms")
1351 (description
1352 "The Trilinos Project is an effort to develop algorithms and enabling
1353technologies within an object-oriented software framework for the solution of
1354large-scale, complex multi-physics engineering and scientific problems. A
1355unique design feature of Trilinos is its focus on packages.")
1356 (license (list license:lgpl2.1+
1357 license:bsd-3))))
1358
1359(define-public xyce-serial
1360 (package
1361 (name "xyce-serial")
1362 (version "6.7")
1363 (source
1364 (origin (method url-fetch)
1365 (uri (string-append "https://archive.org/download/Xyce-"
1366 version "/Xyce-" version ".tar.gz"))
1367 (sha256
1368 (base32
1369 "02k952mnvrnc5kv7r65fdrn7khwq1lbyhwyvd7jznafzdpsvgm4x"))))
1370 (build-system gnu-build-system)
1371 (arguments
1372 `(#:tests? #f
1373 #:configure-flags
1374 (list
1375 "CXXFLAGS=-O3 -std=c++11"
1376 (string-append "ARCHDIR="
1377 (assoc-ref %build-inputs "trilinos")))))
1378 (native-inputs
1379 `(("bison" ,bison)
1380 ("flex" ,flex)
1381 ("fortran" ,gfortran)))
1382 (inputs
1383 `(("fftw" ,fftw)
1384 ("suitesparse" ,suitesparse)
1385 ("lapack" ,lapack-3.5)
1386 ("trilinos" ,trilinos-serial-xyce)))
1387 (home-page "https://xyce.sandia.gov/")
1388 (synopsis "High-performance analog circuit simulator")
1389 (description
1390 "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
1391capable of solving extremely large circuit problems by supporting large-scale
1392parallel computing platforms. It also supports serial execution.")
1393 (license license:gpl3+)))
91cabd3e
TF
1394
1395(define trilinos-parallel-xyce
1396 (package (inherit trilinos-serial-xyce)
1397 (name "trilinos-parallel-xyce")
1398 (arguments
1399 `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
1400 ((#:configure-flags flags)
1401 `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
1402 "-DTrilinos_ENABLE_Zoltan=ON"
1403 "-DTPL_ENABLE_MPI=ON")
1404 ,flags)))))
1405 (inputs
1406 `(("mpi" ,openmpi)
1407 ,@(package-inputs trilinos-serial-xyce)))))
1408
1409(define-public xyce-parallel
1410 (package (inherit xyce-serial)
1411 (name "xyce-parallel")
1412 (arguments
1413 `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
1414 ((#:configure-flags flags)
1415 `(list "CXXFLAGS=-O3 -std=c++11"
1416 "CXX=mpiCC"
1417 "CC=mpicc"
1418 "F77=mpif77"
1419 "--enable-mpi"
1420 "--enable-isorropia=no"
1421 "--enable-zoltan=no"
1422 (string-append
1423 "ARCHDIR="
1424 (assoc-ref %build-inputs "trilinos")))))))
1425 (propagated-inputs
1426 `(("mpi" ,openmpi)))
1427 (inputs
1428 `(("trilinos" ,trilinos-parallel-xyce)
1429 ,@(alist-delete "trilinos"
1430 (package-inputs xyce-serial))))))
f26af33a
TF
1431
1432(define-public freehdl
1433 (package
1434 (name "freehdl")
1435 (version "0.0.8")
1436 (source (origin
1437 (method url-fetch)
1438 (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
1439 version ".tar.gz"))
1440 (sha256
1441 (base32
1442 "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))))
1443 (build-system gnu-build-system)
1444 (arguments
1445 `(#:phases
1446 (modify-phases %standard-phases
1447 (add-before 'configure 'patch-pkg-config
1448 (lambda* (#:key inputs #:allow-other-keys)
1449 (substitute* "freehdl/freehdl-config"
1450 (("pkg-config")
1451 (string-append (assoc-ref inputs "pkg-config")
1452 "/bin/pkg-config"))
1453 (("cat")
1454 (string-append (assoc-ref inputs "coreutils")
1455 "/bin/cat")))
1456 #t))
d3f95898
TF
1457 (add-after 'patch-pkg-config 'setenv
1458 (lambda* (#:key inputs #:allow-other-keys)
1459 (setenv "CXX" (string-append (assoc-ref inputs "gcc")
1460 "/bin/g++"))
1461 (setenv "SYSTEM_LIBTOOL" (string-append (assoc-ref inputs "libtool")
1462 "/bin/libtool"))
1463 #t))
1464 (add-after 'setenv 'patch-gvhdl
1465 (lambda _
1466 (substitute* "v2cc/gvhdl.in"
1467 (("--mode=link") "--mode=link --tag=CXX")
1468 (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
1469 #t))
1470 (add-after 'patch-gvhdl 'patch-freehdl-gennodes
1471 (lambda* (#:key inputs #:allow-other-keys)
1472 (substitute* "freehdl/freehdl-gennodes.in"
1473 (("guile")
1474 (string-append (assoc-ref inputs "guile") "/bin/guile"))
1475 (("\\(debug") ";(debug")
1476 (("\\(@ ") "(apply-emit")
1477 (("\\(@@ ") "(apply-mini-format"))
1478 #t))
f26af33a
TF
1479 (add-after 'configure 'patch-freehdl-pc
1480 (lambda* (#:key inputs #:allow-other-keys)
1481 (substitute* "freehdl.pc"
1482 (("=g\\+\\+")
d3f95898 1483 (string-append "=" (assoc-ref inputs "gcc-toolchain")
f26af33a
TF
1484 "/bin/g++"))
1485 (("=libtool")
1486 (string-append "=" (assoc-ref inputs "libtool")
1487 "/bin/libtool")))
1488 #t))
1489 (add-after 'install-scripts 'make-wrapper
d3f95898 1490 (lambda* (#:key inputs outputs #:allow-other-keys)
f26af33a 1491 (let ((out (assoc-ref outputs "out")))
d3f95898
TF
1492 ;; 'gvhdl' invokes the C compiler directly, so hard-code its
1493 ;; file name.
1494 (wrap-program (string-append out "/bin/gvhdl")
1495 `("CPLUS_INCLUDE_PATH" ":" prefix
1496 (,(string-append (assoc-ref inputs "gcc-toolchain")
1497 "/include")))
1498 `("LIBRARY_PATH" ":" prefix
1499 (,(string-append (assoc-ref inputs "gcc-toolchain")
1500 "/lib")))
1501 `("PATH" ":" prefix
1502 (,(string-append (assoc-ref inputs "gcc-toolchain")
1503 "/bin")
1504 ,(string-append (assoc-ref inputs "coreutils")
1505 "/bin"))))
f26af33a
TF
1506 (wrap-program (string-append out "/bin/freehdl-config")
1507 `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
1508 #t)))))
1509 (inputs
1510 `(("coreutils" ,coreutils)
40a99ca0 1511 ("gcc-toolchain" ,gcc-toolchain)
d3f95898 1512 ("guile" ,guile-2.2)
f26af33a
TF
1513 ("perl" ,perl)
1514 ("pkg-config" ,pkg-config)
1515 ("libtool" ,libtool)))
1516 (native-inputs
1517 `(("pkg-config-native" ,pkg-config)
1518 ("libtool-native" ,libtool)))
1519 (home-page "http://www.freehdl.seul.org/")
1520 (synopsis "VHDL simulator")
1521 (description
1522 "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
1523 VHDL'93 as well as VHDL'87 standards are supported.")
1524 (license (list license:gpl2+
1525 license:lgpl2.0+)))) ; freehdl's libraries
1526
c31b61ef
TF
1527(define-public qucs
1528 (package
1529 (name "qucs")
1530 (version "0.0.19")
1531 (source (origin
1532 (method url-fetch)
1533 (uri
1534 (string-append
1535 "https://sourceforge.net/projects/qucs/files/qucs/" version
1536 "/qucs-" version ".tar.gz"))
1537 (sha256
1538 (base32
1539 "0giv9gfyfdizvjhq56x2pdncrlyv3k15lrsh6pk37i94vr7l7ij5"))))
1540 (build-system gnu-build-system)
1541 (arguments
1542 `(#:phases
1543 (modify-phases %standard-phases
1544 (add-before 'configure 'patch-configure
1545 (lambda* (#:key inputs #:allow-other-keys)
1546 (substitute* "qucs/configure"
1547 (("\\$QTDIR") (assoc-ref inputs "qt4")))
1548 #t))
1549 (add-after 'patch-configure 'patch-scripts
1550 (lambda* (#:key inputs outputs #:allow-other-keys)
1551 (substitute* '("qucs/qucs/qucsdigi"
1552 "qucs/qucs/qucsdigilib"
1553 "qucs/qucs/qucsveri")
1554 (("\\$BINDIR")
1555 (string-append (assoc-ref outputs "out") "/bin"))
1556 (("freehdl-config")
1557 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-config"))
1558 (("freehdl-v2cc")
1559 (string-append (assoc-ref inputs "freehdl") "/bin/freehdl-v2cc"))
1560 (("cp ")
1561 (string-append (assoc-ref inputs "coreutils") "/bin/cp "))
1562 (("glibtool")
1563 (string-append (assoc-ref inputs "libtool") "/bin/libtool"))
1564 (("sed")
1565 (string-append (assoc-ref inputs "sed") "/bin/sed"))
1566 (("iverilog")
1567 (string-append (assoc-ref inputs "iverilog") "/bin/iverilog"))
1568 (("vvp")
1569 (string-append (assoc-ref inputs "iverilog") "/bin/vvp")))
1570 #t))
1571 (add-before 'check 'pre-check
1572 (lambda _
1573 ;; The test suite requires a running X server.
1574 (system "Xvfb :1 &")
1575 (setenv "DISPLAY" ":1")
1576 #t))
1577 (add-after 'install 'make-wrapper
1578 (lambda* (#:key inputs outputs #:allow-other-keys)
1579 (let ((out (assoc-ref outputs "out")))
1580 ;; 'qucs' directly invokes gcc, hence this wrapping.
1581 (wrap-program (string-append out "/bin/qucs")
1582 `("CPLUS_INCLUDE_PATH" ":" prefix
1583 (,(string-append (assoc-ref inputs "gcc-toolchain")
1584 "/include")))
1585 `("PATH" ":" prefix
1586 (,(string-append (assoc-ref inputs "gcc-toolchain")
1587 "/bin")))
1588 `("LIBRARY_PATH" ":" prefix
1589 (,(string-append (assoc-ref inputs "gcc-toolchain")
1590 "/lib")))
1591 `("ADMSXMLBINDIR" ":" prefix
1592 (,(string-append (assoc-ref inputs "adms") "/bin")))
1593 `("ASCOBINDIR" ":" prefix
1594 (,(string-append (assoc-ref inputs "asco") "/bin")))
1595 `("QUCS_OCTAVE" ":" prefix
1596 (,(string-append (assoc-ref inputs "octave") "/bin/octave")))))
1597 #t)))
1598 #:parallel-build? #f ; race condition
1599 #:configure-flags '("--disable-doc"))) ; we need octave-epstk
1600 (native-inputs
1601 `(("gperf" ,gperf)
1602 ("libtool-native" ,libtool)
1603 ("python" ,python-2) ; for tests
1604 ("matplotlib" ,python2-matplotlib) ; for tests
1605 ("numpy" ,python2-numpy) ; for tests
1606 ("xorg-server" ,xorg-server))) ; for tests
1607 (inputs
1608 `(("adms" ,adms)
1609 ("asco" ,asco)
1610 ("coreutils" ,coreutils)
1611 ("freehdl" ,freehdl)
1612 ("gcc-toolchain" ,gcc-toolchain)
1613 ("iverilog" ,iverilog)
1614 ("libtool" ,libtool)
1615 ("octave" ,octave)
1616 ("qt4" ,qt-4)
1617 ("sed" ,sed)))
1618 (home-page "http://qucs.sourceforge.net/")
1619 (synopsis "Circuit simulator with graphical user interface")
1620 (description
1621 "Qucs is a circuit simulator with graphical user interface. The software
1622aims to support all kinds of circuit simulation types---e.g. DC, AC,
1623S-parameter, transient, noise and harmonic balance analysis. Pure digital
1624simulations are also supported.")
1625 (license license:gpl2+)))