gnu: glfw: Propagate the relevant inputs.
[jackhill/guix/guix.git] / gnu / packages / engineering.scm
CommitLineData
ffb010b5
RW
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015 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>
ffb010b5
RW
6;;;
7;;; This file is part of GNU Guix.
8;;;
9;;; GNU Guix is free software; you can redistribute it and/or modify it
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
14;;; GNU Guix is distributed in the hope that it will be useful, but
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
40fbd52a 22(define-module (gnu packages engineering)
ffb010b5
RW
23 #:use-module (guix packages)
24 #:use-module (guix download)
93094501 25 #:use-module (guix gexp)
ffb010b5 26 #:use-module (guix git-download)
93094501
FB
27 #:use-module (guix monads)
28 #:use-module (guix store)
412726ee 29 #:use-module (guix utils)
ffb010b5
RW
30 #:use-module ((guix licenses) #:prefix license:)
31 #:use-module (guix build-system gnu)
32 #:use-module (gnu packages)
95283f3f 33 #:use-module (gnu packages autotools)
5699a3cf 34 #:use-module (gnu packages base)
20500662 35 #:use-module (gnu packages bison)
ffb010b5 36 #:use-module (gnu packages boost)
93094501 37 #:use-module (gnu packages compression)
20500662 38 #:use-module (gnu packages flex)
ffb010b5 39 #:use-module (gnu packages fontutils)
20500662 40 #:use-module (gnu packages gd)
95283f3f 41 #:use-module (gnu packages gettext)
93094501 42 #:use-module (gnu packages ghostscript)
20500662 43 #:use-module (gnu packages gl)
412726ee
RW
44 #:use-module (gnu packages glib)
45 #:use-module (gnu packages gnome)
46 #:use-module (gnu packages gtk)
47 #:use-module (gnu packages guile)
38cf2ba0 48 #:use-module (gnu packages linux) ;FIXME: for pcb
0de98139 49 #:use-module (gnu packages m4)
ffb010b5 50 #:use-module (gnu packages maths)
412726ee 51 #:use-module (gnu packages perl)
ffb010b5
RW
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages qt)
20500662 54 #:use-module (gnu packages tcl)
8f9ac901 55 #:use-module (gnu packages tex)
ffb010b5
RW
56 #:use-module (srfi srfi-1))
57
58(define-public librecad
59 (package
60 (name "librecad")
d7d7f99c 61 (version "2.1.1")
ffb010b5
RW
62 (source (origin
63 (method url-fetch)
64 (uri (string-append
65 "https://github.com/LibreCAD/LibreCAD/archive/"
66 version ".tar.gz"))
d8a4b932 67 (file-name (string-append name "-" version ".tar.gz"))
ffb010b5
RW
68 (sha256
69 (base32
d7d7f99c 70 "132vv9pzbx64zmbnikyg06d4j47yzlmwi4mywxnd9gkaik4yd2kb"))))
ffb010b5
RW
71 (build-system gnu-build-system)
72 (arguments
73 '(#:phases
d694230a
EF
74 (modify-phases %standard-phases
75 (add-after 'unpack 'patch-paths
76 (lambda* (#:key outputs #:allow-other-keys)
77 (let ((out (assoc-ref outputs "out")))
78 (substitute* "librecad/src/lib/engine/rs_system.cpp"
79 (("/usr/share") (string-append out "/share"))))))
80 (replace 'configure
ffb010b5
RW
81 (lambda* (#:key inputs #:allow-other-keys)
82 (system* "qmake" (string-append "BOOST_DIR="
d694230a
EF
83 (assoc-ref inputs "boost")))))
84 (replace 'install
85 (lambda* (#:key outputs #:allow-other-keys)
86 (let ((out (assoc-ref outputs "out")))
87 (mkdir-p (string-append out "/bin"))
88 (mkdir-p (string-append out "/share/librecad"))
89 (copy-file "unix/librecad"
90 (string-append out "/bin/librecad"))
91 (copy-recursively "unix/resources"
92 (string-append out "/share/librecad"))))))))
ffb010b5
RW
93 (inputs
94 `(("boost" ,boost)
95 ("muparser" ,muparser)
96 ("freetype" ,freetype)
d8a4b932 97 ("qt" ,qt)))
ffb010b5
RW
98 (native-inputs
99 `(("pkg-config" ,pkg-config)
100 ("which" ,which)))
101 (home-page "http://librecad.org/")
102 (synopsis "Computer-aided design (CAD) application")
103 (description
104 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
105plans and designs.")
106 (license license:gpl2)))
412726ee
RW
107
108(define-public geda-gaf
109 (package
110 (name "geda-gaf")
12356eb8 111 (version "1.9.2")
412726ee
RW
112 (source (origin
113 (method url-fetch)
114 (uri (string-append
12356eb8 115 "http://ftp.geda-project.org/geda-gaf/unstable/v"
412726ee
RW
116 (version-major+minor version) "/"
117 version "/geda-gaf-" version ".tar.gz"))
118 (sha256
119 (base32
12356eb8 120 "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
412726ee
RW
121 (build-system gnu-build-system)
122 (arguments
123 '(#:phases
2352c97d
RW
124 (modify-phases %standard-phases
125 ;; tests require a writable HOME
126 (add-before 'check 'set-home
127 (lambda _
128 (setenv "HOME" (getenv "TMPDIR"))
129 #t)))
0de98139
DT
130 #:configure-flags
131 (let ((pcb (assoc-ref %build-inputs "pcb")))
132 (list (string-append "--with-pcb-datadir=" pcb "/share")
133 (string-append "--with-pcb-lib-path="
134 pcb "/share/pcb/pcblib-newlib:"
135 pcb "/share/pcb/newlib")))))
412726ee
RW
136 (inputs
137 `(("glib" ,glib)
138 ("gtk" ,gtk+-2)
139 ("guile" ,guile-2.0)
140 ("desktop-file-utils" ,desktop-file-utils)
0de98139
DT
141 ("shared-mime-info" ,shared-mime-info)
142 ("m4" ,m4)
143 ("pcb" ,pcb)))
412726ee
RW
144 (native-inputs
145 `(("pkg-config" ,pkg-config)
146 ("perl" ,perl))) ; for tests
147 (home-page "http://geda-project.org/")
148 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
149 (description
a124bbd2 150 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
412726ee
RW
151suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
152which currently includes: gschem, a schematic capture program; gnetlist, a
153netlist generation program; gsymcheck, a syntax checker for schematic symbols;
154gattrib, a spreadsheet programm that manipulates the properties of symbols of
155a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
156tool to forward annotation from your schematic to layout using PCB; some minor
157utilities.")
158 (license license:gpl2+)))
159
20500662
RW
160(define-public pcb
161 (package
162 (name "pcb")
163 (version "20140316")
164 (source (origin
165 (method url-fetch)
166 (uri (string-append
167 "http://ftp.geda-project.org/pcb/pcb-" version "/pcb-"
168 version ".tar.gz"))
169 (sha256
170 (base32
171 "0l6944hq79qsyp60i5ai02xwyp8l47q7xdm3js0jfkpf72ag7i42"))))
172 (build-system gnu-build-system)
173 (arguments
174 `(#:phases
175 (alist-cons-after
176 'unpack 'use-wish8.6
177 (lambda _
178 (substitute* "configure"
179 (("wish85") "wish8.6")))
180 (alist-cons-after
181 'install 'wrap
182 (lambda* (#:key inputs outputs #:allow-other-keys)
183 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
184 ;; fix of the mesa package we wrap the pcb executable such that
185 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
186 (let* ((out (assoc-ref outputs "out"))
187 (path (string-append (assoc-ref inputs "udev") "/lib")))
188 (wrap-program (string-append out "/bin/pcb")
189 `("LD_LIBRARY_PATH" ":" prefix (,path)))))
190 %standard-phases))))
191 (inputs
192 `(("dbus" ,dbus)
193 ("mesa" ,mesa)
194 ("udev" ,eudev) ;FIXME: required by mesa
195 ("glu" ,glu)
196 ("gd" ,gd)
197 ("gtk" ,gtk+-2)
198 ("gtkglext" ,gtkglext)
199 ("desktop-file-utils" ,desktop-file-utils)
200 ("shared-mime-info" ,shared-mime-info)
201 ("tk" ,tk)))
202 (native-inputs
203 `(("pkg-config" ,pkg-config)
204 ("intltool" ,intltool)
205 ("bison" ,bison)
206 ("flex" ,flex)))
207 (home-page "http://pcb.geda-project.org/")
208 (synopsis "Design printed circuit board layouts")
209 (description
210 "GNU PCB is an interactive tool for editing printed circuit board
211layouts. It features a rats-nest implementation, schematic/netlist import,
212and design rule checking. It also includes an autorouter and a trace
213optimizer; and it can produce photorealistic and design review images.")
214 (license license:gpl2+)))
93094501 215
93094501
FB
216(define-public fastcap
217 (package
218 (name "fastcap")
219 (version "2.0-18Sep92")
220 (source (origin
95001d4b 221 (method url-fetch/tarbomb)
93094501
FB
222 (file-name (string-append name "-" version ".tar.gz"))
223 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
224 name "-" version ".tgz"))
225 (sha256
226 (base32
227 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
3dac53be
FB
228 (snippet
229 ;; Remove a non-free file.
230 '(delete-file "doc/psfig.sty"))
fc1adab1
AK
231 (patches (search-patches "fastcap-mulSetup.patch"
232 "fastcap-mulGlobal.patch"))))
93094501
FB
233 (build-system gnu-build-system)
234 (native-inputs
235 `(("texlive" ,texlive)
acac969f 236 ("ghostscript" ,ghostscript)
e83a13fa 237 ("ghostscript" ,ghostscript-gs)))
93094501
FB
238 (arguments
239 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
240 #:parallel-build? #f
241 #:tests? #f ;; no tests-suite
242 #:modules ((srfi srfi-1)
243 ,@%gnu-build-system-modules)
244 #:phases
245 (modify-phases %standard-phases
246 (add-after 'build 'make-doc
247 (lambda _
248 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
249 "manual"))))
250 (add-before 'make-doc 'fix-doc
251 (lambda _
252 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
253 (substitute* (find-files "doc" "\\.tex")
254 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
255 all file scale)
256 (string-append "\\includegraphics[scale=" scale "]{"
1f7ffd6f
FB
257 file "}"))
258 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
259 all file width)
260 (string-append "\\includegraphics[width=" width "]{"
261 file "}"))
262 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
263 all file height)
264 (string-append "\\includegraphics[height=" height "]{"
265 file "}"))
266 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
267 (string-append "\\includegraphics{" file "}")))
268 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
93094501
FB
269 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
270 all options class)
271 (string-append "\\documentclass[" options "]{"
272 class "}\n"
273 "\\usepackage{graphicx}\n"
274 "\\usepackage{robinspace}"))
275 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
276 (string-append "%" all))
277 (("\\\\setstretch\\{.*\\}" all)
278 (string-append "%" all)))
279 #t))
280 (delete 'configure)
281 (add-before 'install 'clean-bin
282 (lambda _
283 (delete-file (string-append (getcwd) "/bin/README"))
284 #t))
285 (add-before 'install 'make-pdf
286 (lambda _
287 (with-directory-excursion "doc"
288 (and
289 (every (lambda (file)
290 (zero? (system* "dvips" file "-o")))
291 (find-files "." "\\.dvi"))
292 (every (lambda (file)
293 (zero? (system* "ps2pdf" file)))
294 '("mtt.ps" "ug.ps" "tcad.ps"))
295 (zero? (system* "make" "clean"))))))
296 (replace 'install
297 (lambda* (#:key outputs #:allow-other-keys)
298 (let* ((out (assoc-ref outputs "out"))
299 (data (string-append out "/share"))
300 (bin (string-append out "/bin"))
301 (doc (string-append data "/doc/" ,name "-" ,version))
302 (examples (string-append doc "/examples")))
303 (with-directory-excursion "bin"
96c46210
LC
304 (for-each (lambda (f)
305 (install-file f bin))
306 (find-files "." ".*")))
93094501
FB
307 (copy-recursively "doc" doc)
308 (copy-recursively "examples" examples)
309 #t))))))
310 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
311 (synopsis "Multipole-accelerated capacitance extraction program")
312 (description
313 "Fastcap is a capacitance extraction program based on a
314multipole-accelerated algorithm.")
315 (license (license:non-copyleft #f "See fastcap.c."))))
23bae7bb
FB
316
317(define-public fasthenry
318 (package
319 (name "fasthenry")
320 (version "3.0-12Nov96")
321 (source (origin
322 (method url-fetch)
323 (file-name (string-append name "-" version ".tar.gz"))
324 (uri (string-append
325 "http://www.rle.mit.edu/cpg/codes/" name
326 "-" version ".tar.z"))
327 (sha256
328 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
fc1adab1
AK
329 (patches (search-patches "fasthenry-spAllocate.patch"
330 "fasthenry-spBuild.patch"
331 "fasthenry-spUtils.patch"
332 "fasthenry-spSolve.patch"
333 "fasthenry-spFactor.patch"))))
23bae7bb
FB
334 (build-system gnu-build-system)
335 (arguments
336 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
337 #:parallel-build? #f
338 #:tests? #f ;; no tests-suite
339 #:modules ((srfi srfi-1)
340 ,@%gnu-build-system-modules)
341 #:phases
342 (modify-phases %standard-phases
343 (delete 'configure)
344 (replace 'install
345 (lambda* (#:key outputs #:allow-other-keys)
346 (let* ((out (assoc-ref outputs "out"))
347 (data (string-append out "/share"))
348 (bin (string-append out "/bin"))
349 (doc (string-append data "/doc/" ,name "-" ,version))
350 (examples (string-append doc "/examples")))
351 (with-directory-excursion "bin"
96c46210
LC
352 (for-each (lambda (f)
353 (install-file f bin))
354 (find-files "." ".*")))
23bae7bb
FB
355 (copy-recursively "doc" doc)
356 (copy-recursively "examples" examples)
357 #t))))))
358 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
359 (synopsis "Multipole-accelerated inductance analysis program")
360 (description
361 "Fasthenry is an inductance extraction program based on a
362multipole-accelerated algorithm.")
363 (license (license:non-copyleft #f "See induct.c."))))
95283f3f 364
3d5fd240
RW
365(define-public fritzing
366 (package
367 (name "fritzing")
368 (version "0.9.2b")
369 (source (origin
370 (method url-fetch)
371 (uri (string-append "https://github.com/fritzing/"
372 "fritzing-app/archive/" version ".tar.gz"))
373 (file-name (string-append name "-" version ".tar.gz"))
374 (sha256
375 (base32
376 "0pvk57z2pxz89pcwwm61lkpvj4w9qxqz8mi0zkpj6pnaljabp7bf"))))
377 (build-system gnu-build-system)
378 (arguments
379 `(#:phases
380 (modify-phases %standard-phases
381 (replace 'configure
382 (lambda* (#:key inputs outputs #:allow-other-keys)
383 (and (zero? (system* "tar"
384 "-xvf" (assoc-ref inputs "fritzing-parts-db")
385 "-C" "parts"))
386 (zero? (system* "qmake"
387 (string-append "PREFIX="
388 (assoc-ref outputs "out"))
389 "phoenix.pro"))))))))
390 (inputs
a2b99351
DC
391 `(("qtbase" ,qtbase)
392 ("qtserialport" ,qtserialport)
393 ("qtsvg" ,qtsvg)
3d5fd240
RW
394 ("boost" ,boost)
395 ("zlib" ,zlib)
396 ("fritzing-parts-db"
397 ,(origin
398 (method url-fetch)
399 (uri (string-append "https://github.com/fritzing/"
400 "fritzing-parts/archive/" version ".tar.gz"))
401 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
402 (sha256
403 (base32
404 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
405 (home-page "http://fritzing.org")
406 (synopsis "Electronic circuit design")
407 (description
408 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
409software with a low entry barrier, suited for the needs of makers and
410hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
411library with many commonly used high-level components. Fritzing makes it very
412easy to communicate about circuits, as well as to turn them into PCB layouts
413ready for production.")
414 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
415 ;; released under GPLv3+.
416 (license (list license:gpl3+ license:cc-by-sa3.0))))
417
95283f3f
RW
418(define-public gerbv
419 (package
420 (name "gerbv")
421 (version "2.6.1")
422 (source (origin
423 (method url-fetch)
424 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
425 version "/gerbv-" version ".tar.gz"))
426 (sha256
427 (base32
428 "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
429 (build-system gnu-build-system)
430 (arguments
431 `(#:phases
432 (modify-phases %standard-phases
433 (add-before 'configure 'autoconf
434 (lambda _
435 ;; Build rules contain references to Russian translation, but the
436 ;; needed files are missing; see
437 ;; http://sourceforge.net/p/gerbv/bugs/174/
438 (delete-file "po/LINGUAS")
439 (substitute* "man/Makefile.am"
440 (("PO_FILES= gerbv.ru.1.in.po") "")
441 (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
442 (zero? (system* "autoreconf" "-vfi")))))))
443 (native-inputs
444 `(("autoconf" ,autoconf)
445 ("automake" ,automake)
446 ("libtool" ,libtool)
447 ("gettext" ,gnu-gettext)
448 ("po4a" ,po4a)
449 ("pkg-config" ,pkg-config)))
450 (inputs
451 `(("cairo" ,cairo)
452 ("gtk" ,gtk+-2)
453 ("desktop-file-utils" ,desktop-file-utils)))
454 (home-page "http://gerbv.geda-project.org/")
455 (synopsis "Gerber file viewer")
456 (description
457 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
458is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
459you load several files on top of each other, do measurements on the displayed
460image, etc. Besides viewing Gerbers, you may also view Excellon drill files
461as well as pick-place files.")
462 (license license:gpl2+)))