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