gnu: ccache: Update to 3.2.5.
[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")
111 (version "1.8.2")
112 (source (origin
113 (method url-fetch)
114 (uri (string-append
115 "http://ftp.geda-project.org/geda-gaf/stable/v"
116 (version-major+minor version) "/"
117 version "/geda-gaf-" version ".tar.gz"))
118 (sha256
119 (base32
120 "08dpa506xk4gjbbi8vnxcb640wq4ihlgmhzlssl52nhvxwx7gx5v"))))
121 (build-system gnu-build-system)
122 (arguments
123 '(#:phases
124 ;; tests require a writable HOME
125 (alist-cons-before
126 'check 'set-home
127 (lambda _
128 (setenv "HOME" (getenv "TMPDIR")))
0de98139
DT
129 %standard-phases
130 )
131 #:configure-flags
132 (let ((pcb (assoc-ref %build-inputs "pcb")))
133 (list (string-append "--with-pcb-datadir=" pcb "/share")
134 (string-append "--with-pcb-lib-path="
135 pcb "/share/pcb/pcblib-newlib:"
136 pcb "/share/pcb/newlib")))))
412726ee
RW
137 (inputs
138 `(("glib" ,glib)
139 ("gtk" ,gtk+-2)
140 ("guile" ,guile-2.0)
141 ("desktop-file-utils" ,desktop-file-utils)
0de98139
DT
142 ("shared-mime-info" ,shared-mime-info)
143 ("m4" ,m4)
144 ("pcb" ,pcb)))
412726ee
RW
145 (native-inputs
146 `(("pkg-config" ,pkg-config)
147 ("perl" ,perl))) ; for tests
148 (home-page "http://geda-project.org/")
149 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
150 (description
a124bbd2 151 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
412726ee
RW
152suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
153which currently includes: gschem, a schematic capture program; gnetlist, a
154netlist generation program; gsymcheck, a syntax checker for schematic symbols;
155gattrib, a spreadsheet programm that manipulates the properties of symbols of
156a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
157tool to forward annotation from your schematic to layout using PCB; some minor
158utilities.")
159 (license license:gpl2+)))
160
20500662
RW
161(define-public pcb
162 (package
163 (name "pcb")
164 (version "20140316")
165 (source (origin
166 (method url-fetch)
167 (uri (string-append
168 "http://ftp.geda-project.org/pcb/pcb-" version "/pcb-"
169 version ".tar.gz"))
170 (sha256
171 (base32
172 "0l6944hq79qsyp60i5ai02xwyp8l47q7xdm3js0jfkpf72ag7i42"))))
173 (build-system gnu-build-system)
174 (arguments
175 `(#:phases
176 (alist-cons-after
177 'unpack 'use-wish8.6
178 (lambda _
179 (substitute* "configure"
180 (("wish85") "wish8.6")))
181 (alist-cons-after
182 'install 'wrap
183 (lambda* (#:key inputs outputs #:allow-other-keys)
184 ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
185 ;; fix of the mesa package we wrap the pcb executable such that
186 ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
187 (let* ((out (assoc-ref outputs "out"))
188 (path (string-append (assoc-ref inputs "udev") "/lib")))
189 (wrap-program (string-append out "/bin/pcb")
190 `("LD_LIBRARY_PATH" ":" prefix (,path)))))
191 %standard-phases))))
192 (inputs
193 `(("dbus" ,dbus)
194 ("mesa" ,mesa)
195 ("udev" ,eudev) ;FIXME: required by mesa
196 ("glu" ,glu)
197 ("gd" ,gd)
198 ("gtk" ,gtk+-2)
199 ("gtkglext" ,gtkglext)
200 ("desktop-file-utils" ,desktop-file-utils)
201 ("shared-mime-info" ,shared-mime-info)
202 ("tk" ,tk)))
203 (native-inputs
204 `(("pkg-config" ,pkg-config)
205 ("intltool" ,intltool)
206 ("bison" ,bison)
207 ("flex" ,flex)))
208 (home-page "http://pcb.geda-project.org/")
209 (synopsis "Design printed circuit board layouts")
210 (description
211 "GNU PCB is an interactive tool for editing printed circuit board
212layouts. It features a rats-nest implementation, schematic/netlist import,
213and design rule checking. It also includes an autorouter and a trace
214optimizer; and it can produce photorealistic and design review images.")
215 (license license:gpl2+)))
93094501 216
93094501
FB
217(define-public fastcap
218 (package
219 (name "fastcap")
220 (version "2.0-18Sep92")
221 (source (origin
95001d4b 222 (method url-fetch/tarbomb)
93094501
FB
223 (file-name (string-append name "-" version ".tar.gz"))
224 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
225 name "-" version ".tgz"))
226 (sha256
227 (base32
228 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
3dac53be
FB
229 (snippet
230 ;; Remove a non-free file.
231 '(delete-file "doc/psfig.sty"))
93094501
FB
232 (modules '((guix build utils)
233 (guix build download)
234 (guix ftp-client)))
a7db719f 235 (imported-modules modules)
fc1adab1
AK
236 (patches (search-patches "fastcap-mulSetup.patch"
237 "fastcap-mulGlobal.patch"))))
93094501
FB
238 (build-system gnu-build-system)
239 (native-inputs
240 `(("texlive" ,texlive)
241 ("ghostscript" ,ghostscript)))
242 (arguments
243 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
244 #:parallel-build? #f
245 #:tests? #f ;; no tests-suite
246 #:modules ((srfi srfi-1)
247 ,@%gnu-build-system-modules)
248 #:phases
249 (modify-phases %standard-phases
250 (add-after 'build 'make-doc
251 (lambda _
252 (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
253 "manual"))))
254 (add-before 'make-doc 'fix-doc
255 (lambda _
256 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
257 (substitute* (find-files "doc" "\\.tex")
258 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
259 all file scale)
260 (string-append "\\includegraphics[scale=" scale "]{"
1f7ffd6f
FB
261 file "}"))
262 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
263 all file width)
264 (string-append "\\includegraphics[width=" width "]{"
265 file "}"))
266 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
267 all file height)
268 (string-append "\\includegraphics[height=" height "]{"
269 file "}"))
270 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
271 (string-append "\\includegraphics{" file "}")))
272 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
93094501
FB
273 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
274 all options class)
275 (string-append "\\documentclass[" options "]{"
276 class "}\n"
277 "\\usepackage{graphicx}\n"
278 "\\usepackage{robinspace}"))
279 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
280 (string-append "%" all))
281 (("\\\\setstretch\\{.*\\}" all)
282 (string-append "%" all)))
283 #t))
284 (delete 'configure)
285 (add-before 'install 'clean-bin
286 (lambda _
287 (delete-file (string-append (getcwd) "/bin/README"))
288 #t))
289 (add-before 'install 'make-pdf
290 (lambda _
291 (with-directory-excursion "doc"
292 (and
293 (every (lambda (file)
294 (zero? (system* "dvips" file "-o")))
295 (find-files "." "\\.dvi"))
296 (every (lambda (file)
297 (zero? (system* "ps2pdf" file)))
298 '("mtt.ps" "ug.ps" "tcad.ps"))
299 (zero? (system* "make" "clean"))))))
300 (replace 'install
301 (lambda* (#:key outputs #:allow-other-keys)
302 (let* ((out (assoc-ref outputs "out"))
303 (data (string-append out "/share"))
304 (bin (string-append out "/bin"))
305 (doc (string-append data "/doc/" ,name "-" ,version))
306 (examples (string-append doc "/examples")))
307 (with-directory-excursion "bin"
96c46210
LC
308 (for-each (lambda (f)
309 (install-file f bin))
310 (find-files "." ".*")))
93094501
FB
311 (copy-recursively "doc" doc)
312 (copy-recursively "examples" examples)
313 #t))))))
314 (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
315 (synopsis "Multipole-accelerated capacitance extraction program")
316 (description
317 "Fastcap is a capacitance extraction program based on a
318multipole-accelerated algorithm.")
319 (license (license:non-copyleft #f "See fastcap.c."))))
23bae7bb
FB
320
321(define-public fasthenry
322 (package
323 (name "fasthenry")
324 (version "3.0-12Nov96")
325 (source (origin
326 (method url-fetch)
327 (file-name (string-append name "-" version ".tar.gz"))
328 (uri (string-append
329 "http://www.rle.mit.edu/cpg/codes/" name
330 "-" version ".tar.z"))
331 (sha256
332 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
fc1adab1
AK
333 (patches (search-patches "fasthenry-spAllocate.patch"
334 "fasthenry-spBuild.patch"
335 "fasthenry-spUtils.patch"
336 "fasthenry-spSolve.patch"
337 "fasthenry-spFactor.patch"))))
23bae7bb
FB
338 (build-system gnu-build-system)
339 (arguments
340 `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
341 #:parallel-build? #f
342 #:tests? #f ;; no tests-suite
343 #:modules ((srfi srfi-1)
344 ,@%gnu-build-system-modules)
345 #:phases
346 (modify-phases %standard-phases
347 (delete 'configure)
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"
96c46210
LC
356 (for-each (lambda (f)
357 (install-file f bin))
358 (find-files "." ".*")))
23bae7bb
FB
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 inductance analysis program")
364 (description
365 "Fasthenry is an inductance extraction program based on a
366multipole-accelerated algorithm.")
367 (license (license:non-copyleft #f "See induct.c."))))
95283f3f 368
3d5fd240
RW
369(define-public fritzing
370 (package
371 (name "fritzing")
372 (version "0.9.2b")
373 (source (origin
374 (method url-fetch)
375 (uri (string-append "https://github.com/fritzing/"
376 "fritzing-app/archive/" version ".tar.gz"))
377 (file-name (string-append name "-" version ".tar.gz"))
378 (sha256
379 (base32
380 "0pvk57z2pxz89pcwwm61lkpvj4w9qxqz8mi0zkpj6pnaljabp7bf"))))
381 (build-system gnu-build-system)
382 (arguments
383 `(#:phases
384 (modify-phases %standard-phases
385 (replace 'configure
386 (lambda* (#:key inputs outputs #:allow-other-keys)
387 (and (zero? (system* "tar"
388 "-xvf" (assoc-ref inputs "fritzing-parts-db")
389 "-C" "parts"))
390 (zero? (system* "qmake"
391 (string-append "PREFIX="
392 (assoc-ref outputs "out"))
393 "phoenix.pro"))))))))
394 (inputs
395 `(("qt" ,qt)
396 ("boost" ,boost)
397 ("zlib" ,zlib)
398 ("fritzing-parts-db"
399 ,(origin
400 (method url-fetch)
401 (uri (string-append "https://github.com/fritzing/"
402 "fritzing-parts/archive/" version ".tar.gz"))
403 (file-name (string-append "fritzing-parts-" version ".tar.gz"))
404 (sha256
405 (base32
406 "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
407 (home-page "http://fritzing.org")
408 (synopsis "Electronic circuit design")
409 (description
410 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
411software with a low entry barrier, suited for the needs of makers and
412hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
413library with many commonly used high-level components. Fritzing makes it very
414easy to communicate about circuits, as well as to turn them into PCB layouts
415ready for production.")
416 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
417 ;; released under GPLv3+.
418 (license (list license:gpl3+ license:cc-by-sa3.0))))
419
95283f3f
RW
420(define-public gerbv
421 (package
422 (name "gerbv")
423 (version "2.6.1")
424 (source (origin
425 (method url-fetch)
426 (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
427 version "/gerbv-" version ".tar.gz"))
428 (sha256
429 (base32
430 "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
431 (build-system gnu-build-system)
432 (arguments
433 `(#:phases
434 (modify-phases %standard-phases
435 (add-before 'configure 'autoconf
436 (lambda _
437 ;; Build rules contain references to Russian translation, but the
438 ;; needed files are missing; see
439 ;; http://sourceforge.net/p/gerbv/bugs/174/
440 (delete-file "po/LINGUAS")
441 (substitute* "man/Makefile.am"
442 (("PO_FILES= gerbv.ru.1.in.po") "")
443 (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
444 (zero? (system* "autoreconf" "-vfi")))))))
445 (native-inputs
446 `(("autoconf" ,autoconf)
447 ("automake" ,automake)
448 ("libtool" ,libtool)
449 ("gettext" ,gnu-gettext)
450 ("po4a" ,po4a)
451 ("pkg-config" ,pkg-config)))
452 (inputs
453 `(("cairo" ,cairo)
454 ("gtk" ,gtk+-2)
455 ("desktop-file-utils" ,desktop-file-utils)))
456 (home-page "http://gerbv.geda-project.org/")
457 (synopsis "Gerber file viewer")
458 (description
459 "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
460is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
461you load several files on top of each other, do measurements on the displayed
462image, etc. Besides viewing Gerbers, you may also view Excellon drill files
463as well as pick-place files.")
464 (license license:gpl2+)))