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