gnu: Move desktop-file-utils to (gnu packages freedesktop).
[jackhill/guix/guix.git] / gnu / packages / engineering.scm
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 Theodoros Foradis <theodoros.for@openmailbox.org>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages engineering)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix gexp)
28 #:use-module (guix git-download)
29 #:use-module (guix monads)
30 #:use-module (guix store)
31 #:use-module (guix utils)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system cmake)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages algebra)
38 #:use-module (gnu packages autotools)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages bison)
41 #:use-module (gnu packages boost)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages curl)
45 #:use-module (gnu packages flex)
46 #:use-module (gnu packages fontutils)
47 #:use-module (gnu packages freedesktop)
48 #:use-module (gnu packages gd)
49 #:use-module (gnu packages gettext)
50 #:use-module (gnu packages ghostscript)
51 #:use-module (gnu packages gl)
52 #:use-module (gnu packages glib)
53 #:use-module (gnu packages gnome)
54 #:use-module (gnu packages gtk)
55 #:use-module (gnu packages guile)
56 #:use-module (gnu packages image)
57 #:use-module (gnu packages imagemagick)
58 #:use-module (gnu packages linux) ;FIXME: for pcb
59 #:use-module (gnu packages m4)
60 #:use-module (gnu packages maths)
61 #:use-module (gnu packages ncurses)
62 #:use-module (gnu packages perl)
63 #:use-module (gnu packages pkg-config)
64 #:use-module (gnu packages python)
65 #:use-module (gnu packages qt)
66 #:use-module (gnu packages swig)
67 #:use-module (gnu packages tcl)
68 #:use-module (gnu packages tls)
69 #:use-module (gnu packages tex)
70 #:use-module (gnu packages wxwidgets)
71 #:use-module (gnu packages xorg)
72 #:use-module (srfi srfi-1))
73
74 (define-public librecad
75 (package
76 (name "librecad")
77 (version "2.1.3")
78 (source (origin
79 (method url-fetch)
80 (uri (string-append
81 "https://github.com/LibreCAD/LibreCAD/archive/"
82 version ".tar.gz"))
83 (file-name (string-append name "-" version ".tar.gz"))
84 (sha256
85 (base32
86 "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
87 (build-system gnu-build-system)
88 (arguments
89 '(#:phases
90 (modify-phases %standard-phases
91 (add-after 'unpack 'patch-paths
92 (lambda* (#:key outputs #:allow-other-keys)
93 (let ((out (assoc-ref outputs "out")))
94 (substitute* "librecad/src/lib/engine/rs_system.cpp"
95 (("/usr/share") (string-append out "/share"))))))
96 (replace 'configure
97 (lambda* (#:key inputs #:allow-other-keys)
98 (system* "qmake" (string-append "BOOST_DIR="
99 (assoc-ref inputs "boost")))))
100 (replace 'install
101 (lambda* (#:key outputs #:allow-other-keys)
102 (let* ((out (assoc-ref outputs "out"))
103 (bin (string-append out "/bin"))
104 (share (string-append out "/share/librecad")))
105 (mkdir-p bin)
106 (install-file "unix/librecad" bin)
107 (mkdir-p share)
108 (copy-recursively "unix/resources" share)))))))
109 (inputs
110 `(("boost" ,boost)
111 ("muparser" ,muparser)
112 ("freetype" ,freetype)
113 ("qtbase" ,qtbase)
114 ("qtsvg" ,qtsvg)))
115 (native-inputs
116 `(("pkg-config" ,pkg-config)
117 ("which" ,which)))
118 (home-page "http://librecad.org/")
119 (synopsis "Computer-aided design (CAD) application")
120 (description
121 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
122 plans and designs.")
123 (license license:gpl2)))
124
125 (define-public geda-gaf
126 (package
127 (name "geda-gaf")
128 (version "1.9.2")
129 (source (origin
130 (method url-fetch)
131 (uri (string-append
132 "http://ftp.geda-project.org/geda-gaf/unstable/v"
133 (version-major+minor version) "/"
134 version "/geda-gaf-" version ".tar.gz"))
135 (sha256
136 (base32
137 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
138 (build-system gnu-build-system)
139 (arguments
140 '(#:phases
141 (modify-phases %standard-phases
142 ;; tests require a writable HOME
143 (add-before 'check 'set-home
144 (lambda _
145 (setenv "HOME" (getenv "TMPDIR"))
146 #t)))
147 #:configure-flags
148 (let ((pcb (assoc-ref %build-inputs "pcb")))
149 (list (string-append "--with-pcb-datadir=" pcb "/share")
150 (string-append "--with-pcb-lib-path="
151 pcb "/share/pcb/pcblib-newlib:"
152 pcb "/share/pcb/newlib")))))
153 (inputs
154 `(("glib" ,glib)
155 ("gtk" ,gtk+-2)
156 ("guile" ,guile-2.0)
157 ("desktop-file-utils" ,desktop-file-utils)
158 ("shared-mime-info" ,shared-mime-info)
159 ("m4" ,m4)
160 ("pcb" ,pcb)))
161 (native-inputs
162 `(("pkg-config" ,pkg-config)
163 ("perl" ,perl))) ; for tests
164 (home-page "http://geda-project.org/")
165 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
166 (description
167 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
168 suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
169 which currently includes: gschem, a schematic capture program; gnetlist, a
170 netlist generation program; gsymcheck, a syntax checker for schematic symbols;
171 gattrib, a spreadsheet programm that manipulates the properties of symbols of
172 a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
173 tool to forward annotation from your schematic to layout using PCB; some minor
174 utilities.")
175 (license license:gpl2+)))
176
177 (define-public pcb
178 (package
179 (name "pcb")
180 (version "4.0.0")
181 (source (origin
182 (method url-fetch)
183 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
184 "/pcb-" version ".tar.gz"))
185 (sha256
186 (base32
187 "1i6sk8g8h9avms142wl07yv20m1cm4c3fq3v6hybrhdxs2n17plf"))))
188 (build-system gnu-build-system)
189 (arguments
190 `(#:phases
191 (alist-cons-after
192 'unpack 'use-wish8.6
193 (lambda _
194 (substitute* "configure"
195 (("wish85") "wish8.6")))
196 (alist-cons-after
197 'install 'wrap
198 (lambda* (#:key inputs outputs #:allow-other-keys)
199 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
200 ;; fix of the mesa package we wrap the pcb executable such that
201 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
202 (let* ((out (assoc-ref outputs "out"))
203 (path (string-append (assoc-ref inputs "udev") "/lib")))
204 (wrap-program (string-append out "/bin/pcb")
205 `("LD_LIBRARY_PATH" ":" prefix (,path)))))
206 (alist-cons-before
207 'check 'pre-check
208 (lambda _
209 (system "Xvfb :1 &")
210 (setenv "DISPLAY" ":1")
211 #t)
212 %standard-phases)))))
213 (inputs
214 `(("dbus" ,dbus)
215 ("mesa" ,mesa)
216 ("udev" ,eudev) ;FIXME: required by mesa
217 ("glu" ,glu)
218 ("gd" ,gd)
219 ("gtk" ,gtk+-2)
220 ("gtkglext" ,gtkglext)
221 ("desktop-file-utils" ,desktop-file-utils)
222 ("shared-mime-info" ,shared-mime-info)
223 ("tk" ,tk)))
224 (native-inputs
225 `(("pkg-config" ,pkg-config)
226 ("intltool" ,intltool)
227 ("bison" ,bison)
228 ("flex" ,flex)
229 ;; For tests
230 ("imagemagick" ,imagemagick)
231 ("gerbv" ,gerbv)
232 ("ghostscript" ,ghostscript)
233 ("xvfb" ,xorg-server)))
234 (home-page "http://pcb.geda-project.org/")
235 (synopsis "Design printed circuit board layouts")
236 (description
237 "GNU PCB is an interactive tool for editing printed circuit board
238 layouts. It features a rats-nest implementation, schematic/netlist import,
239 and design rule checking. It also includes an autorouter and a trace
240 optimizer; and it can produce photorealistic and design review images.")
241 (license license:gpl2+)))
242
243 (define-public pcb-rnd
244 (package (inherit pcb)
245 (name "pcb-rnd")
246 (version "1.1.3")
247 (source (origin
248 (method url-fetch)
249 (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
250 "pcb-rnd-" version ".tar.gz"))
251 (sha256
252 (base32
253 "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
254 (arguments
255 `(#:tests? #f ; no check target
256 #:phases
257 (modify-phases %standard-phases
258 (add-after 'unpack 'cc-is-gcc
259 (lambda _ (setenv "CC" "gcc") #t))
260 (replace 'configure
261 ;; The configure script doesn't tolerate most of our configure flags.
262 (lambda* (#:key outputs #:allow-other-keys)
263 (zero? (system* "sh" "configure"
264 (string-append "--prefix="
265 (assoc-ref outputs "out")))))))))
266 (home-page "http://repo.hu/projects/pcb-rnd/")
267 (description "PCB RND is a fork of the GNU PCB circuit board editing tool
268 featuring various improvements and bug fixes.")))
269
270 (define-public fastcap
271 (package
272 (name "fastcap")
273 (version "2.0-18Sep92")
274 (source (origin
275 (method url-fetch/tarbomb)
276 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
277 name "-" version ".tgz"))
278 (sha256
279 (base32
280 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
281 (snippet
282 ;; Remove a non-free file.
283 '(delete-file "doc/psfig.sty"))
284 (patches (search-patches "fastcap-mulSetup.patch"
285 "fastcap-mulGlobal.patch"))))
286 (build-system gnu-build-system)
287 (native-inputs
288 `(("texlive" ,texlive)
289 ("ghostscript" ,ghostscript)))
290 (arguments
291 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
292 #:parallel-build? #f
293 #:tests? #f ;; no tests-suite
294 #:modules ((srfi srfi-1)
295 ,@%gnu-build-system-modules)
296 #:phases
297 (modify-phases %standard-phases
298 (add-after 'build 'make-doc
299 (lambda _
300 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
301 "manual"))))
302 (add-before 'make-doc 'fix-doc
303 (lambda _
304 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
305 (substitute* (find-files "doc" "\\.tex")
306 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
307 all file scale)
308 (string-append "\\includegraphics[scale=" scale "]{"
309 file "}"))
310 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
311 all file width)
312 (string-append "\\includegraphics[width=" width "]{"
313 file "}"))
314 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
315 all file height)
316 (string-append "\\includegraphics[height=" height "]{"
317 file "}"))
318 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
319 (string-append "\\includegraphics{" file "}")))
320 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
321 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
322 all options class)
323 (string-append "\\documentclass[" options "]{"
324 class "}\n"
325 "\\usepackage{graphicx}\n"
326 "\\usepackage{robinspace}"))
327 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
328 (string-append "%" all))
329 (("\\\\setstretch\\{.*\\}" all)
330 (string-append "%" all)))
331 #t))
332 (delete 'configure)
333 (add-before 'install 'clean-bin
334 (lambda _
335 (delete-file (string-append (getcwd) "/bin/README"))
336 #t))
337 (add-before 'install 'make-pdf
338 (lambda _
339 (with-directory-excursion "doc"
340 (and
341 (every (lambda (file)
342 (zero? (system* "dvips" file "-o")))
343 (find-files "." "\\.dvi"))
344 (every (lambda (file)
345 (zero? (system* "ps2pdf" file)))
346 '("mtt.ps" "ug.ps" "tcad.ps"))
347 (zero? (system* "make" "clean"))))))
348 (replace 'install
349 (lambda* (#:key outputs #:allow-other-keys)
350 (let* ((out (assoc-ref outputs "out"))
351 (data (string-append out "/share"))
352 (bin (string-append out "/bin"))
353 (doc (string-append data "/doc/" ,name "-" ,version))
354 (examples (string-append doc "/examples")))
355 (with-directory-excursion "bin"
356 (for-each (lambda (f)
357 (install-file f bin))
358 (find-files "." ".*")))
359 (copy-recursively "doc" doc)
360 (copy-recursively "examples" examples)
361 #t))))))
362 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
363 (synopsis "Multipole-accelerated capacitance extraction program")
364 (description
365 "Fastcap is a capacitance extraction program based on a
366 multipole-accelerated algorithm.")
367 (license (license:non-copyleft #f "See fastcap.c."))))
368
369 (define-public fasthenry
370 (package
371 (name "fasthenry")
372 (version "3.0-12Nov96")
373 (source (origin
374 (method url-fetch)
375 (file-name (string-append name "-" version ".tar.gz"))
376 (uri (string-append
377 "http://www.rle.mit.edu/cpg/codes/" name
378 "-" version ".tar.z"))
379 (sha256
380 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
381 (patches (search-patches "fasthenry-spAllocate.patch"
382 "fasthenry-spBuild.patch"
383 "fasthenry-spUtils.patch"
384 "fasthenry-spSolve.patch"
385 "fasthenry-spFactor.patch"))))
386 (build-system gnu-build-system)
387 (arguments
388 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
389 #:parallel-build? #f
390 #:tests? #f ;; no tests-suite
391 #:modules ((srfi srfi-1)
392 ,@%gnu-build-system-modules)
393 #:phases
394 (modify-phases %standard-phases
395 (delete 'configure)
396 (replace 'install
397 (lambda* (#:key outputs #:allow-other-keys)
398 (let* ((out (assoc-ref outputs "out"))
399 (data (string-append out "/share"))
400 (bin (string-append out "/bin"))
401 (doc (string-append data "/doc/" ,name "-" ,version))
402 (examples (string-append doc "/examples")))
403 (with-directory-excursion "bin"
404 (for-each (lambda (f)
405 (install-file f bin))
406 (find-files "." ".*")))
407 (copy-recursively "doc" doc)
408 (copy-recursively "examples" examples)
409 #t))))))
410 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
411 (synopsis "Multipole-accelerated inductance analysis program")
412 (description
413 "Fasthenry is an inductance extraction program based on a
414 multipole-accelerated algorithm.")
415 (license (license:non-copyleft #f "See induct.c."))))
416
417 (define-public fritzing
418 (package
419 (name "fritzing")
420 (version "0.9.2b")
421 (source (origin
422 (method url-fetch)
423 (uri (string-append "https://github.com/fritzing/"
424 "fritzing-app/archive/" version ".tar.gz"))
425 (file-name (string-append name "-" version ".tar.gz"))
426 (sha256
427 (base32
428 "0pvk57z2pxz89pcwwm61lkpvj4w9qxqz8mi0zkpj6pnaljabp7bf"))))
429 (build-system gnu-build-system)
430 (arguments
431 `(#:phases
432 (modify-phases %standard-phases
433 (replace 'configure
434 (lambda* (#:key inputs outputs #:allow-other-keys)
435 (and (zero? (system* "tar"
436 "-xvf" (assoc-ref inputs "fritzing-parts-db")
437 "-C" "parts"))
438 (zero? (system* "qmake"
439 (string-append "PREFIX="
440 (assoc-ref outputs "out"))
441 "phoenix.pro"))))))))
442 (inputs
443 `(("qtbase" ,qtbase)
444 ("qtserialport" ,qtserialport)
445 ("qtsvg" ,qtsvg)
446 ("boost" ,boost)
447 ("zlib" ,zlib)
448 ("fritzing-parts-db"
449 ,(origin
450 (method url-fetch)
451 (uri (string-append "https://github.com/fritzing/"
452 "fritzing-parts/archive/" version ".tar.gz"))
453 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
454 (sha256
455 (base32
456 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
457 (home-page "http://fritzing.org")
458 (synopsis "Electronic circuit design")
459 (description
460 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
461 software with a low entry barrier, suited for the needs of makers and
462 hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
463 library with many commonly used high-level components. Fritzing makes it very
464 easy to communicate about circuits, as well as to turn them into PCB layouts
465 ready for production.")
466 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
467 ;; released under GPLv3+.
468 (license (list license:gpl3+ license:cc-by-sa3.0))))
469
470 (define-public gerbv
471 (package
472 (name "gerbv")
473 (version "2.6.1")
474 (source (origin
475 (method url-fetch)
476 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
477 version "/gerbv-" version ".tar.gz"))
478 (sha256
479 (base32
480 "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
481 (build-system gnu-build-system)
482 (arguments
483 `(#:phases
484 (modify-phases %standard-phases
485 (add-before 'configure 'autoconf
486 (lambda _
487 ;; Build rules contain references to Russian translation, but the
488 ;; needed files are missing; see
489 ;; http://sourceforge.net/p/gerbv/bugs/174/
490 (delete-file "po/LINGUAS")
491 (substitute* "man/Makefile.am"
492 (("PO_FILES= gerbv.ru.1.in.po") "")
493 (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
494 (zero? (system* "autoreconf" "-vfi")))))))
495 (native-inputs
496 `(("autoconf" ,autoconf)
497 ("automake" ,automake)
498 ("libtool" ,libtool)
499 ("gettext" ,gettext-minimal)
500 ("po4a" ,po4a)
501 ("pkg-config" ,pkg-config)))
502 (inputs
503 `(("cairo" ,cairo)
504 ("gtk" ,gtk+-2)
505 ("desktop-file-utils" ,desktop-file-utils)))
506 (home-page "http://gerbv.geda-project.org/")
507 (synopsis "Gerber file viewer")
508 (description
509 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
510 is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
511 you load several files on top of each other, do measurements on the displayed
512 image, etc. Besides viewing Gerbers, you may also view Excellon drill files
513 as well as pick-place files.")
514 (license license:gpl2+)))
515
516 (define-public ao
517 (let ((commit "0bc2354b8dcd1a82a0fd6647706b126045e52734"))
518 (package
519 (name "ao-cad") ;XXX: really "ao", but it collides with libao
520 (version (string-append "0." (string-take commit 7)))
521 (source (origin
522 (method git-fetch)
523 (uri (git-reference
524 (url "https://github.com/mkeeter/ao")
525 (commit commit)))
526 (sha256
527 (base32
528 "0lm7iljklafs8dhlvaab2yhwx4xymrdjrqk9c5xvn59hlvbgl1j5"))
529 (file-name (string-append name "-" version "-checkout"))
530 (modules '((guix build utils)))
531 (snippet
532 ;; Remove bundled libraries: Eigen, glm, and catch. TODO:
533 ;; Unbundle efsw <https://github.com/diegostamigni/efsw>.
534 '(begin
535 (delete-file-recursively "vendor")
536
537 ;; Use #include <catch.hpp>.
538 (substitute* (find-files "." "\\.[ch]pp$")
539 (("catch/catch\\.hpp")
540 "catch.hpp"))))))
541 (build-system cmake-build-system)
542 (arguments
543 `(;; Have the RUNPATH of libao.so point to $libdir, where libefsw.so
544 ;; lives.
545 #:configure-flags (list (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
546 "-Wl,-rpath="
547 (assoc-ref %outputs "out")
548 "/lib"))
549
550 #:phases
551 (modify-phases %standard-phases
552 (add-before 'build 'add-eigen-to-search-path
553 (lambda* (#:key inputs #:allow-other-keys)
554 ;; Allow things to find our own Eigen and Catch.
555 (let ((eigen (assoc-ref inputs "eigen")))
556 (setenv "CPLUS_INCLUDE_PATH"
557 (string-append eigen "/include/eigen3:"
558 (getenv "CPLUS_INCLUDE_PATH")))
559 #t)))
560 (add-after 'install 'install-guile-bindings
561 (lambda* (#:key inputs outputs #:allow-other-keys)
562 ;; Install the Guile bindings (the build system only installs
563 ;; libao.so.)
564 (let* ((out (assoc-ref outputs "out"))
565 (moddir (string-append out "/share/guile/site/2.0")))
566 (install-file "bind/libao.so"
567 (string-append out "/lib"))
568
569 ;; Go to the source directory.
570 (with-directory-excursion ,(string-append "../"
571 name "-" version
572 "-checkout")
573 (substitute* "bind/guile/ao/bind.scm"
574 (("\\(define libao \\(dynamic-link .*$")
575 (string-append "(define libao (dynamic-link \""
576 out "/lib/libao\")) ;")))
577
578 (for-each (lambda (file)
579 (install-file file
580 (string-append moddir
581 "/ao")))
582 (find-files "bind/guile" "\\.scm$"))
583
584 (substitute* "bin/ao-guile"
585 (("\\(add-to-load-path .*")
586 (string-append "(add-to-load-path \"" moddir "\")")))
587
588 (install-file "bin/ao-guile"
589 (string-append out "/bin"))
590
591 ;; Allow Ao to dlopen the relevant GL libraries. Otherwise
592 ;; it fails with:
593 ;; Couldn't find current GLX or EGL context.
594 (let ((mesa (assoc-ref inputs "mesa")))
595 (wrap-program (string-append out "/bin/ao-guile")
596 `("LD_LIBRARY_PATH" ":" prefix
597 (,(string-append mesa "/lib")))))
598 #t)))))))
599 (native-inputs
600 `(("pkg-config" ,pkg-config)))
601 (inputs
602 `(("boost" ,boost)
603 ("catch" ,catch-framework)
604 ("libpng" ,libpng)
605 ("glfw" ,glfw)
606 ("libepoxy" ,libepoxy)
607 ("mesa" ,mesa)
608 ("eigen" ,eigen)
609 ("glm" ,glm)
610 ("guile" ,guile-2.0)))
611 (home-page "http://www.mattkeeter.com/projects/ao/")
612 (synopsis "Tool for programmatic computer-aided design")
613 (description
614 "Ao is a tool for programmatic computer-aided design (CAD). In Ao,
615 solid models are defined as Scheme scripts, and there are no opaque function
616 calls into the geometry kernel: everything is visible to the user. Even
617 fundamental, primitive shapes are represented as code in the user-level
618 language.")
619 (license (list license:lgpl2.1+ ;library
620 license:gpl2+))))) ;Guile bindings
621
622 ;; We use kicad from a git commit, because support for boost 1.61.0 has been
623 ;; recently added.
624 (define-public kicad
625 (let ((commit "4ee344e150bfaf3a6f3f7bf935fb96ae07c423fa")
626 (revision "1"))
627 (package
628 (name "kicad")
629 (version (string-append "4.0-" revision "."
630 (string-take commit 7)))
631 (source
632 (origin
633 (method git-fetch)
634 (uri (git-reference
635 (url "https://git.launchpad.net/kicad")
636 (commit commit)))
637 (sha256
638 (base32 "0kf6r92nps0658i9n3p9vp5dzbssmc22lvjv5flyvnlf83l63s4n"))
639 (file-name (string-append name "-" version "-checkout"))))
640 (build-system cmake-build-system)
641 (arguments
642 `(#:out-of-source? #t
643 #:tests? #f ; no tests
644 #:configure-flags
645 (list "-DKICAD_STABLE_VERSION=ON"
646 "-DKICAD_REPO_NAME=stable"
647 ,(string-append "-DKICAD_BUILD_VERSION=4.0-"
648 (string-take commit 7))
649 "-DCMAKE_BUILD_TYPE=Release"
650 "-DKICAD_SKIP_BOOST=ON"; Use our system's boost library.
651 "-DKICAD_SCRIPTING=ON"
652 "-DKICAD_SCRIPTING_MODULES=ON"
653 "-DKICAD_SCRIPTING_WXPYTHON=ON"
654 ;; Has to be set explicitely, as we don't have the wxPython
655 ;; headers in the wxwidgets store item, but in wxPython.
656 (string-append "-DCMAKE_CXX_FLAGS=-I"
657 (assoc-ref %build-inputs "wxpython")
658 "/include/wx-3.0")
659 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
660 ;; TODO: Enable this when CA certs are working with curl.
661 "-DBUILD_GITHUB_PLUGIN=OFF")
662 #:phases
663 (modify-phases %standard-phases
664 (add-after 'install 'wrap-program
665 ;; Ensure correct Python at runtime.
666 (lambda* (#:key inputs outputs #:allow-other-keys)
667 (let* ((out (assoc-ref outputs "out"))
668 (python (assoc-ref inputs "python"))
669 (file (string-append out "/bin/kicad"))
670 (path (string-append
671 out
672 "/lib/python2.7/site-packages:"
673 (getenv "PYTHONPATH"))))
674 (wrap-program file
675 `("PYTHONPATH" ":" prefix (,path))
676 `("PATH" ":" prefix
677 (,(string-append python "/bin:")))))
678 #t)))))
679 (native-inputs
680 `(("boost" ,boost)
681 ("gettext" ,gnu-gettext)
682 ("pkg-config" ,pkg-config)
683 ("swig" ,swig)
684 ("zlib" ,zlib)))
685 (inputs
686 `(("cairo" ,cairo)
687 ("curl" ,curl)
688 ("desktop-file-utils" ,desktop-file-utils)
689 ("glew" ,glew)
690 ("glm" ,glm)
691 ("hicolor-icon-theme" ,hicolor-icon-theme)
692 ("libsm" ,libsm)
693 ("mesa" ,mesa)
694 ("openssl" ,openssl)
695 ("python" ,python-2)
696 ("wxwidgets" ,wxwidgets-gtk2)
697 ("wxpython" ,python2-wxpython)))
698 (home-page "http://kicad-pcb.org/")
699 (synopsis "Electronics Design Automation Suite")
700 (description "Kicad is a program for the formation of printed circuit
701 boards and electrical circuits. The software has a number of programs that
702 perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
703 electrical diagrams), gerbview (viewing Gerber files) and others.")
704 (license license:gpl3+))))
705
706 (define-public kicad-library
707 (let ((version "4.0.4"))
708 (package
709 (name "kicad-library")
710 (version version)
711 (source (origin
712 (method url-fetch)
713 (uri (string-append
714 "http://downloads.kicad-pcb.org/libraries/kicad-library-"
715 version ".tar.gz"))
716 (sha256
717 (base32
718 "1wyda58y39lhxml0xv1ngvddi0nqihx9bnlza46ajzms38ajvh12"))))
719 (build-system cmake-build-system)
720 (arguments
721 `(#:out-of-source? #t
722 #:tests? #f ; no tests
723 #:phases
724 (modify-phases %standard-phases
725 (add-after 'install 'install-footprints ; from footprints tarball
726 (lambda* (#:key inputs outputs #:allow-other-keys)
727 (zero? (system* "tar" "xvf"
728 (assoc-ref inputs "kicad-footprints")
729 "-C" (string-append (assoc-ref outputs "out")
730 "/share/kicad/modules")
731 "--strip-components=1"))))
732 ;; We change the default global footprint file, which is generated if
733 ;; it doesn't exist in user's home directory, from the one using the
734 ;; github plugin, to the one using the KISYSMOD environment path.
735 (add-after 'install-footprints 'use-pretty-footprint-table
736 (lambda* (#:key outputs #:allow-other-keys)
737 (let* ((out (assoc-ref outputs "out"))
738 (template-dir (string-append out "/share/kicad/template"))
739 (fp-lib-table (string-append template-dir "/fp-lib-table")))
740 (delete-file fp-lib-table)
741 (copy-file (string-append fp-lib-table ".for-pretty")
742 fp-lib-table))
743 #t)))))
744 (native-search-paths
745 (list (search-path-specification
746 (variable "KISYSMOD") ; footprint path
747 (files '("share/kicad/modules")))
748 (search-path-specification
749 (variable "KISYS3DMOD") ; 3D model path
750 (files '("share/kicad/modules/packages3d")))))
751 ;; Kicad distributes footprints in a separate tarball
752 (native-inputs
753 `(("kicad-footprints"
754 ,(origin
755 (method url-fetch)
756 (uri (string-append
757 "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
758 version ".tar.gz"))
759 (sha256
760 (base32
761 "0ya4gg6clz3vp2wrb67xwg0bhwh5q8ag39jjmpcp4zjcqs1f48rb"))))))
762 (home-page "http://kicad-pcb.org/")
763 (synopsis "Libraries for kicad")
764 (description "This package provides Kicad component, footprint and 3D
765 render model libraries.")
766 (license license:lgpl2.0+))))
767
768 (define-public linsmith
769 (package
770 (name "linsmith")
771 (version "0.99.30")
772 (source (origin
773 (method url-fetch)
774 (uri (string-append
775 "mirror://sourceforge/linsmith/linsmith/linsmith-"
776 version "/linsmith-" version ".tar.gz"))
777 (sha256
778 (base32
779 "18qslhr2r45rhpj4v6bjcqx189vs0bflvsj271wr7w8kvh69qwvn"))))
780 (build-system gnu-build-system)
781 (native-inputs
782 `(("pkg-config" ,pkg-config)
783 ("gtk" ,gtk+-2)
784 ("libgnome" ,libgnomeui)))
785 (home-page "http://jcoppens.com/soft/linsmith/index.en.php")
786 (synopsis "Smith Charting program")
787 (description "LinSmith is a Smith Charting program, mainly designed for
788 educational use. As such, there is an emphasis on capabilities that improve
789 the 'showing the effect of'-style of operation.")
790 (license license:gpl2+)))
791
792 (define-public volk
793 (package
794 (name "volk")
795 (version "1.3")
796 (source
797 (origin
798 (method url-fetch)
799 (uri (string-append "http://libvolk.org/releases/volk-"
800 version ".tar.gz"))
801 (sha256
802 (base32
803 "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
804 (build-system cmake-build-system)
805 (inputs
806 `(("boost" ,boost)))
807 (native-inputs
808 `(("python-2", python-2)
809 ("python2-cheetah" ,python2-cheetah)))
810 (home-page "http://libvolk.org/")
811 (synopsis "Vector-Optimized Library of Kernels")
812 (description
813 "@code{volk} contains procedures with machine-specific optimizations
814 for mathematical functions. It also provides an machine-independent
815 interface to select the best such procedures to use on a given system.")
816 (license license:gpl3+)))
817
818 (define-public minicom
819 (package
820 (name "minicom")
821 (version "2.7.1")
822 (source
823 (origin
824 (method url-fetch)
825 (uri (string-append "https://alioth.debian.org/frs/download.php/"
826 "file/4215/" name "-" version ".tar.gz"))
827 (sha256
828 (base32
829 "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
830 (build-system gnu-build-system)
831 (arguments
832 `(#:configure-flags '("--enable-lock-dir=/var/lock")
833 #:phases
834 (modify-phases %standard-phases
835 (add-after 'unpack 'patch-lock-check
836 (lambda _
837 (substitute* "configure"
838 (("test -d [$]UUCPLOCK") "true"))
839 #t)))))
840 (inputs
841 `(("ncurses" ,ncurses)))
842 (home-page "https://alioth.debian.org/projects/minicom/")
843 (synopsis "Serial terminal emulator")
844 (description "@code{minicom} is a serial terminal emulator.")
845 (license license:gpl2+)))