1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016, 2017 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
6 ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros.for@openmailbox.org>
8 ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
10 ;;; This file is part of GNU Guix.
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.
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.
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/>.
25 (define-module (gnu packages engineering)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix gexp)
29 #:use-module (guix git-download)
30 #:use-module (guix monads)
31 #:use-module (guix store)
32 #:use-module (guix utils)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system python)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages algebra)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages bison)
42 #:use-module (gnu packages boost)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages curl)
46 #:use-module (gnu packages flex)
47 #:use-module (gnu packages fontutils)
48 #:use-module (gnu packages freedesktop)
49 #:use-module (gnu packages gcc)
50 #:use-module (gnu packages gd)
51 #:use-module (gnu packages gettext)
52 #:use-module (gnu packages ghostscript)
53 #:use-module (gnu packages gl)
54 #:use-module (gnu packages glib)
55 #:use-module (gnu packages gnome)
56 #:use-module (gnu packages gtk)
57 #:use-module (gnu packages guile)
58 #:use-module (gnu packages image)
59 #:use-module (gnu packages imagemagick)
60 #:use-module (gnu packages linux) ;FIXME: for pcb
61 #:use-module (gnu packages m4)
62 #:use-module (gnu packages maths)
63 #:use-module (gnu packages multiprecision)
64 #:use-module (gnu packages ncurses)
65 #:use-module (gnu packages perl)
66 #:use-module (gnu packages pkg-config)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages qt)
69 #:use-module (gnu packages readline)
70 #:use-module (gnu packages swig)
71 #:use-module (gnu packages tcl)
72 #:use-module (gnu packages tls)
73 #:use-module (gnu packages tex)
74 #:use-module (gnu packages wxwidgets)
75 #:use-module (gnu packages xorg))
77 (define-public librecad
84 "https://github.com/LibreCAD/LibreCAD/archive/"
86 (file-name (string-append name "-" version ".tar.gz"))
89 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
90 (build-system gnu-build-system)
93 (modify-phases %standard-phases
94 (add-after 'unpack 'patch-paths
95 (lambda* (#:key outputs #:allow-other-keys)
96 (let ((out (assoc-ref outputs "out")))
97 (substitute* "librecad/src/lib/engine/rs_system.cpp"
98 (("/usr/share") (string-append out "/share"))))))
100 (lambda* (#:key inputs #:allow-other-keys)
101 (system* "qmake" (string-append "BOOST_DIR="
102 (assoc-ref inputs "boost")))))
104 (lambda* (#:key outputs #:allow-other-keys)
105 (let* ((out (assoc-ref outputs "out"))
106 (bin (string-append out "/bin"))
107 (share (string-append out "/share/librecad")))
109 (install-file "unix/librecad" bin)
111 (copy-recursively "unix/resources" share)))))))
114 ("muparser" ,muparser)
115 ("freetype" ,freetype)
119 `(("pkg-config" ,pkg-config)
121 (home-page "http://librecad.org/")
122 (synopsis "Computer-aided design (CAD) application")
124 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
126 (license license:gpl2)))
128 (define-public geda-gaf
135 "http://ftp.geda-project.org/geda-gaf/unstable/v"
136 (version-major+minor version) "/"
137 version "/geda-gaf-" version ".tar.gz"))
140 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
141 (build-system gnu-build-system)
144 (modify-phases %standard-phases
145 ;; tests require a writable HOME
146 (add-before 'check 'set-home
148 (setenv "HOME" (getenv "TMPDIR"))
151 (let ((pcb (assoc-ref %build-inputs "pcb")))
152 (list (string-append "--with-pcb-datadir=" pcb "/share")
153 (string-append "--with-pcb-lib-path="
154 pcb "/share/pcb/pcblib-newlib:"
155 pcb "/share/pcb/newlib")))))
160 ("desktop-file-utils" ,desktop-file-utils)
161 ("shared-mime-info" ,shared-mime-info)
165 `(("pkg-config" ,pkg-config)
166 ("perl" ,perl))) ; for tests
167 (home-page "http://geda-project.org/")
168 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
170 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
171 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
172 which currently includes: gschem, a schematic capture program; gnetlist, a
173 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
174 gattrib, a spreadsheet programm that manipulates the properties of symbols of
175 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
176 tool to forward annotation from your schematic to layout using PCB; some minor
178 (license license:gpl2+)))
186 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
187 "/pcb-" version ".tar.gz"))
190 "1i6sk8g8h9avms142wl07yv20m1cm4c3fq3v6hybrhdxs2n17plf"))))
191 (build-system gnu-build-system)
197 (substitute* "configure"
198 (("wish85") "wish8.6")))
201 (lambda* (#:key inputs outputs #:allow-other-keys)
202 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
203 ;; fix of the mesa package we wrap the pcb executable such that
204 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
205 (let* ((out (assoc-ref outputs "out"))
206 (path (string-append (assoc-ref inputs "udev") "/lib")))
207 (wrap-program (string-append out "/bin/pcb")
208 `("LD_LIBRARY_PATH" ":" prefix (,path)))))
213 (setenv "DISPLAY" ":1")
215 %standard-phases)))))
219 ("udev" ,eudev) ;FIXME: required by mesa
223 ("gtkglext" ,gtkglext)
224 ("desktop-file-utils" ,desktop-file-utils)
225 ("shared-mime-info" ,shared-mime-info)
228 `(("pkg-config" ,pkg-config)
229 ("intltool" ,intltool)
233 ("imagemagick" ,imagemagick)
235 ("ghostscript" ,ghostscript)
236 ("xvfb" ,xorg-server)))
237 (home-page "http://pcb.geda-project.org/")
238 (synopsis "Design printed circuit board layouts")
240 "GNU PCB is an interactive tool for editing printed circuit board
241 layouts. It features a rats-nest implementation, schematic/netlist import,
242 and design rule checking. It also includes an autorouter and a trace
243 optimizer; and it can produce photorealistic and design review images.")
244 (license license:gpl2+)))
246 (define-public pcb-rnd
247 (package (inherit pcb)
252 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
253 "pcb-rnd-" version ".tar.gz"))
256 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
258 `(#:tests? #f ; no check target
260 (modify-phases %standard-phases
261 (add-after 'unpack 'cc-is-gcc
262 (lambda _ (setenv "CC" "gcc") #t))
264 ;; The configure script doesn't tolerate most of our configure flags.
265 (lambda* (#:key outputs #:allow-other-keys)
266 (zero? (system* "sh" "configure"
267 (string-append "--prefix="
268 (assoc-ref outputs "out")))))))))
269 (home-page "http://repo.hu/projects/pcb-rnd/")
270 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
271 featuring various improvements and bug fixes.")))
273 (define-public fastcap
276 (version "2.0-18Sep92")
278 (method url-fetch/tarbomb)
279 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
280 name "-" version ".tgz"))
283 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
285 ;; Remove a non-free file.
286 '(delete-file "doc/psfig.sty"))
287 (patches (search-patches "fastcap-mulSetup.patch"
288 "fastcap-mulGlobal.patch"))))
289 (build-system gnu-build-system)
291 `(("texlive" ,texlive)
292 ("ghostscript" ,ghostscript)))
294 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
296 #:tests? #f ;; no tests-suite
297 #:modules ((srfi srfi-1)
298 ,@%gnu-build-system-modules)
300 (modify-phases %standard-phases
301 (add-after 'build 'make-doc
303 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
305 (add-before 'make-doc 'fix-doc
307 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
308 (substitute* (find-files "doc" "\\.tex")
309 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
311 (string-append "\\includegraphics[scale=" scale "]{"
313 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
315 (string-append "\\includegraphics[width=" width "]{"
317 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
319 (string-append "\\includegraphics[height=" height "]{"
321 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
322 (string-append "\\includegraphics{" file "}")))
323 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
324 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
326 (string-append "\\documentclass[" options "]{"
328 "\\usepackage{graphicx}\n"
329 "\\usepackage{robinspace}"))
330 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
331 (string-append "%" all))
332 (("\\\\setstretch\\{.*\\}" all)
333 (string-append "%" all)))
336 (add-before 'install 'clean-bin
338 (delete-file (string-append (getcwd) "/bin/README"))
340 (add-before 'install 'make-pdf
342 (with-directory-excursion "doc"
344 (every (lambda (file)
345 (zero? (system* "dvips" file "-o")))
346 (find-files "." "\\.dvi"))
347 (every (lambda (file)
348 (zero? (system* "ps2pdf" file)))
349 '("mtt.ps" "ug.ps" "tcad.ps"))
350 (zero? (system* "make" "clean"))))))
352 (lambda* (#:key outputs #:allow-other-keys)
353 (let* ((out (assoc-ref outputs "out"))
354 (data (string-append out "/share"))
355 (bin (string-append out "/bin"))
356 (doc (string-append data "/doc/" ,name "-" ,version))
357 (examples (string-append doc "/examples")))
358 (with-directory-excursion "bin"
359 (for-each (lambda (f)
360 (install-file f bin))
361 (find-files "." ".*")))
362 (copy-recursively "doc" doc)
363 (copy-recursively "examples" examples)
365 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
366 (synopsis "Multipole-accelerated capacitance extraction program")
368 "Fastcap is a capacitance extraction program based on a
369 multipole-accelerated algorithm.")
370 (license (license:non-copyleft #f "See fastcap.c."))))
372 (define-public fasthenry
375 (version "3.0-12Nov96")
378 (file-name (string-append name "-" version ".tar.gz"))
380 "http://www.rle.mit.edu/cpg/codes/" name
381 "-" version ".tar.z"))
383 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
384 (patches (search-patches "fasthenry-spAllocate.patch"
385 "fasthenry-spBuild.patch"
386 "fasthenry-spUtils.patch"
387 "fasthenry-spSolve.patch"
388 "fasthenry-spFactor.patch"))))
389 (build-system gnu-build-system)
391 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
393 #:tests? #f ;; no tests-suite
394 #:modules ((srfi srfi-1)
395 ,@%gnu-build-system-modules)
397 (modify-phases %standard-phases
400 (lambda* (#:key outputs #:allow-other-keys)
401 (let* ((out (assoc-ref outputs "out"))
402 (data (string-append out "/share"))
403 (bin (string-append out "/bin"))
404 (doc (string-append data "/doc/" ,name "-" ,version))
405 (examples (string-append doc "/examples")))
406 (with-directory-excursion "bin"
407 (for-each (lambda (f)
408 (install-file f bin))
409 (find-files "." ".*")))
410 (copy-recursively "doc" doc)
411 (copy-recursively "examples" examples)
413 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
414 (synopsis "Multipole-accelerated inductance analysis program")
416 "Fasthenry is an inductance extraction program based on a
417 multipole-accelerated algorithm.")
418 (license (license:non-copyleft #f "See induct.c."))))
420 (define-public fritzing
426 (uri (string-append "https://github.com/fritzing/"
427 "fritzing-app/archive/" version ".tar.gz"))
428 (file-name (string-append name "-" version ".tar.gz"))
431 "0pvk57z2pxz89pcwwm61lkpvj4w9qxqz8mi0zkpj6pnaljabp7bf"))))
432 (build-system gnu-build-system)
435 (modify-phases %standard-phases
437 (lambda* (#:key inputs outputs #:allow-other-keys)
438 (and (zero? (system* "tar"
439 "-xvf" (assoc-ref inputs "fritzing-parts-db")
441 (zero? (system* "qmake"
442 (string-append "PREFIX="
443 (assoc-ref outputs "out"))
444 "phoenix.pro"))))))))
447 ("qtserialport" ,qtserialport)
454 (uri (string-append "https://github.com/fritzing/"
455 "fritzing-parts/archive/" version ".tar.gz"))
456 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
459 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
460 (home-page "http://fritzing.org")
461 (synopsis "Electronic circuit design")
463 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
464 software with a low entry barrier, suited for the needs of makers and
465 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
466 library with many commonly used high-level components. Fritzing makes it very
467 easy to communicate about circuits, as well as to turn them into PCB layouts
468 ready for production.")
469 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
470 ;; released under GPLv3+.
471 (license (list license:gpl3+ license:cc-by-sa3.0))))
479 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
480 version "/gerbv-" version ".tar.gz"))
483 "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
484 (build-system gnu-build-system)
487 (modify-phases %standard-phases
488 (add-after 'unpack 'autoconf
490 ;; Build rules contain references to Russian translation, but the
491 ;; needed files are missing; see
492 ;; http://sourceforge.net/p/gerbv/bugs/174/
493 (delete-file "po/LINGUAS")
494 (substitute* "man/Makefile.am"
495 (("PO_FILES= gerbv.ru.1.in.po") "")
496 (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
497 (zero? (system* "autoreconf" "-vfi")))))))
499 `(("autoconf" ,autoconf)
500 ("automake" ,automake)
502 ("gettext" ,gettext-minimal)
504 ("pkg-config" ,pkg-config)))
508 ("desktop-file-utils" ,desktop-file-utils)))
509 (home-page "http://gerbv.geda-project.org/")
510 (synopsis "Gerber file viewer")
512 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
513 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
514 you load several files on top of each other, do measurements on the displayed
515 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
516 as well as pick-place files.")
517 (license license:gpl2+)))
520 (let ((commit "0bc2354b8dcd1a82a0fd6647706b126045e52734"))
522 (name "ao-cad") ;XXX: really "ao", but it collides with libao
523 (version (string-append "0." (string-take commit 7)))
527 (url "https://github.com/mkeeter/ao")
531 "0lm7iljklafs8dhlvaab2yhwx4xymrdjrqk9c5xvn59hlvbgl1j5"))
532 (file-name (string-append name "-" version "-checkout"))
533 (modules '((guix build utils)))
535 ;; Remove bundled libraries: Eigen, glm, and catch. TODO:
536 ;; Unbundle efsw <https://github.com/diegostamigni/efsw>.
538 (delete-file-recursively "vendor")
540 ;; Use #include <catch.hpp>.
541 (substitute* (find-files "." "\\.[ch]pp$")
542 (("catch/catch\\.hpp")
544 (build-system cmake-build-system)
546 `(;; Have the RUNPATH of libao.so point to $libdir, where libefsw.so
548 #:configure-flags (list (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
550 (assoc-ref %outputs "out")
554 (modify-phases %standard-phases
555 (add-before 'build 'add-eigen-to-search-path
556 (lambda* (#:key inputs #:allow-other-keys)
557 ;; Allow things to find our own Eigen and Catch.
558 (let ((eigen (assoc-ref inputs "eigen")))
559 (setenv "CPLUS_INCLUDE_PATH"
560 (string-append eigen "/include/eigen3:"
561 (getenv "CPLUS_INCLUDE_PATH")))
563 (add-after 'install 'install-guile-bindings
564 (lambda* (#:key inputs outputs #:allow-other-keys)
565 ;; Install the Guile bindings (the build system only installs
567 (let* ((out (assoc-ref outputs "out"))
568 (moddir (string-append out "/share/guile/site/2.0")))
569 (install-file "bind/libao.so"
570 (string-append out "/lib"))
572 ;; Go to the source directory.
573 (with-directory-excursion ,(string-append "../"
576 (substitute* "bind/guile/ao/bind.scm"
577 (("\\(define libao \\(dynamic-link .*$")
578 (string-append "(define libao (dynamic-link \""
579 out "/lib/libao\")) ;")))
581 (for-each (lambda (file)
583 (string-append moddir
585 (find-files "bind/guile" "\\.scm$"))
587 (substitute* "bin/ao-guile"
588 (("\\(add-to-load-path .*")
589 (string-append "(add-to-load-path \"" moddir "\")")))
591 (install-file "bin/ao-guile"
592 (string-append out "/bin"))
594 ;; Allow Ao to dlopen the relevant GL libraries. Otherwise
596 ;; Couldn't find current GLX or EGL context.
597 (let ((mesa (assoc-ref inputs "mesa")))
598 (wrap-program (string-append out "/bin/ao-guile")
599 `("LD_LIBRARY_PATH" ":" prefix
600 (,(string-append mesa "/lib")))))
603 `(("pkg-config" ,pkg-config)))
606 ("catch" ,catch-framework)
609 ("libepoxy" ,libepoxy)
613 ("guile" ,guile-2.0)))
614 (home-page "http://www.mattkeeter.com/projects/ao/")
615 (synopsis "Tool for programmatic computer-aided design")
617 "Ao is a tool for programmatic computer-aided design (CAD). In Ao,
618 solid models are defined as Scheme scripts, and there are no opaque function
619 calls into the geometry kernel: everything is visible to the user. Even
620 fundamental, primitive shapes are represented as code in the user-level
622 (license (list license:lgpl2.1+ ;library
623 license:gpl2+))))) ;Guile bindings
625 ;; We use kicad from a git commit, because support for boost 1.61.0 has been
628 (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
632 (version (string-append "4.0-" revision "."
633 (string-take commit 7)))
638 (url "https://git.launchpad.net/kicad")
641 (base32 "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
642 (file-name (string-append name "-" version "-checkout"))))
643 (build-system cmake-build-system)
645 `(#:out-of-source? #t
646 #:tests? #f ; no tests
648 (list "-DKICAD_STABLE_VERSION=ON"
649 "-DKICAD_REPO_NAME=stable"
650 ,(string-append "-DKICAD_BUILD_VERSION=4.0-"
651 (string-take commit 7))
652 "-DCMAKE_BUILD_TYPE=Release"
653 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
654 "-DKICAD_SCRIPTING=ON"
655 "-DKICAD_SCRIPTING_MODULES=ON"
656 "-DKICAD_SCRIPTING_WXPYTHON=ON"
657 ;; Has to be set explicitely, as we don't have the wxPython
658 ;; headers in the wxwidgets store item, but in wxPython.
659 (string-append "-DCMAKE_CXX_FLAGS=-I"
660 (assoc-ref %build-inputs "wxpython")
662 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
663 ;; TODO: Enable this when CA certs are working with curl.
664 "-DBUILD_GITHUB_PLUGIN=OFF")
666 (modify-phases %standard-phases
667 (add-after 'install 'wrap-program
668 ;; Ensure correct Python at runtime.
669 (lambda* (#:key inputs outputs #:allow-other-keys)
670 (let* ((out (assoc-ref outputs "out"))
671 (python (assoc-ref inputs "python"))
672 (file (string-append out "/bin/kicad"))
675 "/lib/python2.7/site-packages:"
676 (getenv "PYTHONPATH"))))
678 `("PYTHONPATH" ":" prefix (,path))
680 (,(string-append python "/bin:")))))
684 ("gettext" ,gnu-gettext)
685 ("pkg-config" ,pkg-config)
691 ("desktop-file-utils" ,desktop-file-utils)
694 ("hicolor-icon-theme" ,hicolor-icon-theme)
699 ("wxwidgets" ,wxwidgets-gtk2)
700 ("wxpython" ,python2-wxpython)))
701 (home-page "http://kicad-pcb.org/")
702 (synopsis "Electronics Design Automation Suite")
703 (description "Kicad is a program for the formation of printed circuit
704 boards and electrical circuits. The software has a number of programs that
705 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
706 electrical diagrams), gerbview (viewing Gerber files) and others.")
707 (license license:gpl3+))))
709 (define-public kicad-library
710 (let ((version "4.0.4"))
712 (name "kicad-library")
717 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
721 "1wyda58y39lhxml0xv1ngvddi0nqihx9bnlza46ajzms38ajvh12"))))
722 (build-system cmake-build-system)
724 `(#:out-of-source? #t
725 #:tests? #f ; no tests
727 (modify-phases %standard-phases
728 (add-after 'install 'install-footprints ; from footprints tarball
729 (lambda* (#:key inputs outputs #:allow-other-keys)
730 (zero? (system* "tar" "xvf"
731 (assoc-ref inputs "kicad-footprints")
732 "-C" (string-append (assoc-ref outputs "out")
733 "/share/kicad/modules")
734 "--strip-components=1"))))
735 ;; We change the default global footprint file, which is generated if
736 ;; it doesn't exist in user's home directory, from the one using the
737 ;; github plugin, to the one using the KISYSMOD environment path.
738 (add-after 'install-footprints 'use-pretty-footprint-table
739 (lambda* (#:key outputs #:allow-other-keys)
740 (let* ((out (assoc-ref outputs "out"))
741 (template-dir (string-append out "/share/kicad/template"))
742 (fp-lib-table (string-append template-dir "/fp-lib-table")))
743 (delete-file fp-lib-table)
744 (copy-file (string-append fp-lib-table ".for-pretty")
748 (list (search-path-specification
749 (variable "KISYSMOD") ; footprint path
750 (files '("share/kicad/modules")))
751 (search-path-specification
752 (variable "KISYS3DMOD") ; 3D model path
753 (files '("share/kicad/modules/packages3d")))))
754 ;; Kicad distributes footprints in a separate tarball
756 `(("kicad-footprints"
760 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
764 "0ya4gg6clz3vp2wrb67xwg0bhwh5q8ag39jjmpcp4zjcqs1f48rb"))))))
765 (home-page "http://kicad-pcb.org/")
766 (synopsis "Libraries for kicad")
767 (description "This package provides Kicad component, footprint and 3D
768 render model libraries.")
769 (license license:lgpl2.0+))))
771 (define-public linsmith
778 "mirror://sourceforge/linsmith/linsmith/linsmith-"
779 version "/linsmith-" version ".tar.gz"))
782 "18qslhr2r45rhpj4v6bjcqx189vs0bflvsj271wr7w8kvh69qwvn"))))
783 (build-system gnu-build-system)
785 `(("pkg-config" ,pkg-config)
787 ("libgnome" ,libgnomeui)))
788 (home-page "http://jcoppens.com/soft/linsmith/index.en.php")
789 (synopsis "Smith Charting program")
790 (description "LinSmith is a Smith Charting program, mainly designed for
791 educational use. As such, there is an emphasis on capabilities that improve
792 the 'showing the effect of'-style of operation.")
793 (license license:gpl2+)))
802 (uri (string-append "http://libvolk.org/releases/volk-"
806 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
807 (build-system cmake-build-system)
811 `(("python-2", python-2)
812 ("python2-cheetah" ,python2-cheetah)))
813 (home-page "http://libvolk.org/")
814 (synopsis "Vector-Optimized Library of Kernels")
816 "@code{volk} contains procedures with machine-specific optimizations
817 for mathematical functions. It also provides an machine-independent
818 interface to select the best such procedures to use on a given system.")
819 (license license:gpl3+)))
821 (define-public minicom
828 (uri (string-append "https://alioth.debian.org/frs/download.php/"
829 "file/4215/" name "-" version ".tar.gz"))
832 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
833 (build-system gnu-build-system)
835 `(#:configure-flags '("--enable-lock-dir=/var/lock")
837 (modify-phases %standard-phases
838 (add-after 'unpack 'patch-lock-check
840 (substitute* "configure"
841 (("test -d [$]UUCPLOCK") "true"))
844 `(("ncurses" ,ncurses)))
845 (home-page "https://alioth.debian.org/projects/minicom/")
846 (synopsis "Serial terminal emulator")
847 (description "@code{minicom} is a serial terminal emulator.")
848 (license license:gpl2+)))
850 (define-public harminv
858 "http://ab-initio.mit.edu/harminv/harminv-"
862 "1pmm8d6fx9ahhnk7w12bfa6zx3afbkg4gkvlvgwhpjxbcrvrp3jk"))))
863 (build-system gnu-build-system)
866 (modify-phases %standard-phases
867 (add-before 'configure 'fix-tests
869 (substitute* "./sines-test.sh"
870 ; change test frequency range - default fails
874 `(("fortran" ,gfortran)))
876 `(("lapack" ,lapack)))
877 (home-page "http://ab-initio.mit.edu/wiki/index.php/Harminv")
878 (synopsis "Harmonic inversion solver")
880 "Harminv is a free program (and accompanying library) to solve the problem of
881 harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
882 of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
883 determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
884 (license license:gpl2+)))
886 (define-public guile-libctl
888 (name "guile-libctl")
894 "http://ab-initio.mit.edu/libctl/libctl-"
898 "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
899 (build-system gnu-build-system)
901 `(("fortran" ,gfortran)))
903 `(("guile" ,guile-2.2)))
904 (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
905 (synopsis "Flexible control files implementation for scientific simulations")
907 "Libctl is a Guile-based library implementing flexible control files
908 for scientific simulations.")
909 (license license:gpl2+)))
919 "http://ab-initio.mit.edu/mpb/mpb-"
923 "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
924 (build-system gnu-build-system)
927 (list (string-append "--with-libctl="
928 (assoc-ref %build-inputs "libctl")
931 `(("fortran" ,gfortran)
932 ("pkg-config" ,pkg-config)
940 ("libctl" ,guile-libctl)
941 ("readline" ,readline)
943 (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
944 (synopsis "Computes band structures and electromagnetic modes of dielectric
947 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
948 of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
949 fully-vectorial and three-dimensional methods.")
950 (license license:gpl2+)))
960 "http://ab-initio.mit.edu/meep/meep-"
964 "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
965 (build-system gnu-build-system)
968 (list (string-append "--with-libctl="
969 (assoc-ref %build-inputs "libctl")
972 `(("fortran" ,gfortran)
973 ("pkg-config" ,pkg-config)
978 ("guile" ,guile-2.0) ; doesn't build with guile-2.2
982 ("libctl" ,guile-libctl)
985 (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
986 (synopsis "Finite-difference time-domain (FDTD) simulation software")
988 "Meep is a finite-difference time-domain (FDTD) simulation software package
989 developed at MIT to model electromagnetic systems.")
990 (license license:gpl2+)))
1000 "mirror://sourceforge/mot-adms/adms-source/"
1001 (version-major+minor version) "/adms-" version ".tar.gz"))
1004 "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
1005 (build-system gnu-build-system)
1009 (home-page "https://sourceforge.net/projects/mot-adms")
1010 (synopsis "Automatic device model synthesizer")
1012 "ADMS is a code generator that converts electrical compact device models
1013 specified in high-level description language into ready-to-compile C code for
1014 the API of spice simulators. Based on transformations specified in XML
1015 language, ADMS transforms Verilog-AMS code into other target languages.")
1016 (license license:gpl3)))
1018 (define-public capstone
1021 (version "3.0.5-rc2")
1024 (uri (string-append "https://github.com/aquynh/capstone/archive/"
1026 (file-name (string-append name "-" version ".tar.gz"))
1029 "1cqms9r2p43aiwp5spd84zaccp16ih03r7sjhrv16nddahj0jz2q"))))
1030 (build-system gnu-build-system)
1033 #:make-flags (list (string-append "PREFIX=" %output)
1036 (modify-phases %standard-phases
1038 ;; cstool's Makefile overrides LDFLAGS, so we cannot pass it as a make flag.
1039 (add-before 'build 'fix-cstool-ldflags
1040 (lambda* (#:key outputs #:allow-other-keys)
1041 (substitute* "cstool/Makefile"
1043 (string-append "LDFLAGS = -Wl,-rpath=" (assoc-ref outputs "out")
1046 (home-page "http://www.capstone-engine.org")
1047 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
1049 "Capstone is a lightweight multi-platform, multi-architecture disassembly
1050 framework. Capstone can disassemble machine code for many supported architectures
1051 such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
1052 bindings for Python, Java, OCaml and more.")
1053 (license license:bsd-3)))
1055 ;; FIXME: This package has a timestamp embedded in
1056 ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
1057 (define-public python-capstone
1060 (name "python-capstone")
1062 `(("capstone" ,capstone)))
1063 (build-system python-build-system)
1066 (modify-phases %standard-phases
1067 (add-after 'unpack 'chdir-and-fix-setup-py
1069 (chdir "bindings/python")
1070 ;; Do not build the library again, because we already have it.
1071 (substitute* "setup.py" ((".* build_libraries.*") ""))
1072 ;; This substitution tells python-capstone where to find the
1074 (substitute* "capstone/__init__.py"
1075 (("pkg_resources.resource_filename.*")
1076 (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
1079 (define-public python2-capstone
1080 (package-with-python2 python-capstone))
1082 (define-public radare2
1088 (uri (string-append "http://radare.mikelloc.com/get/" version "/"
1089 name "-" version ".tar.gz"))
1092 "16ggsk40zz6hyvclvqj1r4bh4hb78jf0d6ppry1jk4r0j30wm7cm"))
1093 (modules '((guix build utils)))
1096 (substitute* "libr/asm/p/Makefile"
1097 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1098 (substitute* "libr/parse/p/Makefile"
1099 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
1100 (substitute* "libr/bin/p/Makefile"
1101 (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))))))
1102 (build-system gnu-build-system)
1104 '(#:tests? #f; tests require git and network access
1106 (modify-phases %standard-phases
1107 (add-before 'configure 'mklibdir
1108 (lambda* (#:key inputs #:allow-other-keys)
1109 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
1112 (list "--with-sysmagic" "--with-syszip" "--with-openssl"
1113 "--without-nonpic" "--with-rpath" "--with-syscapstone")
1117 `(("openssl" ,openssl)
1120 ("capstone" ,capstone)))
1122 `(("pkg-config" ,pkg-config)))
1123 (home-page "https://radare.org/")
1124 (synopsis "Portable reversing framework")
1126 "Radare project started as a forensics tool, a scriptable commandline
1127 hexadecimal editor able to open disk files, but later support for analyzing
1128 binaries, disassembling code, debugging programs, attaching to remote gdb
1130 (license license:lgpl3)))