engineering.scm 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283
  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@foradis.org>
  8. ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
  9. ;;;
  10. ;;; This file is part of GNU Guix.
  11. ;;;
  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.
  16. ;;;
  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.
  21. ;;;
  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/>.
  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 python)
  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 gcc)
  49. #:use-module (gnu packages gd)
  50. #:use-module (gnu packages gettext)
  51. #:use-module (gnu packages ghostscript)
  52. #:use-module (gnu packages gl)
  53. #:use-module (gnu packages glib)
  54. #:use-module (gnu packages gnome)
  55. #:use-module (gnu packages gtk)
  56. #:use-module (gnu packages guile)
  57. #:use-module (gnu packages image)
  58. #:use-module (gnu packages imagemagick)
  59. #:use-module (gnu packages linux) ;FIXME: for pcb
  60. #:use-module (gnu packages m4)
  61. #:use-module (gnu packages maths)
  62. #:use-module (gnu packages multiprecision)
  63. #:use-module (gnu packages mpi)
  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))
  76. (define-public librecad
  77. (package
  78. (name "librecad")
  79. (version "2.1.3")
  80. (source (origin
  81. (method url-fetch)
  82. (uri (string-append
  83. "https://github.com/LibreCAD/LibreCAD/archive/"
  84. version ".tar.gz"))
  85. (file-name (string-append name "-" version ".tar.gz"))
  86. (sha256
  87. (base32
  88. "01nvc1g3si05r5np1pzn62ah9w84p8nxa32wqrjh6gdi17jfvi3l"))))
  89. (build-system gnu-build-system)
  90. (arguments
  91. '(#:phases
  92. (modify-phases %standard-phases
  93. (add-after 'unpack 'patch-paths
  94. (lambda* (#:key outputs #:allow-other-keys)
  95. (let ((out (assoc-ref outputs "out")))
  96. (substitute* "librecad/src/lib/engine/rs_system.cpp"
  97. (("/usr/share") (string-append out "/share"))))))
  98. (replace 'configure
  99. (lambda* (#:key inputs #:allow-other-keys)
  100. (system* "qmake" (string-append "BOOST_DIR="
  101. (assoc-ref inputs "boost")))))
  102. (replace 'install
  103. (lambda* (#:key outputs #:allow-other-keys)
  104. (let* ((out (assoc-ref outputs "out"))
  105. (bin (string-append out "/bin"))
  106. (share (string-append out "/share/librecad")))
  107. (mkdir-p bin)
  108. (install-file "unix/librecad" bin)
  109. (mkdir-p share)
  110. (copy-recursively "unix/resources" share)))))))
  111. (inputs
  112. `(("boost" ,boost)
  113. ("muparser" ,muparser)
  114. ("freetype" ,freetype)
  115. ("qtbase" ,qtbase)
  116. ("qtsvg" ,qtsvg)))
  117. (native-inputs
  118. `(("pkg-config" ,pkg-config)
  119. ("which" ,which)))
  120. (home-page "http://librecad.org/")
  121. (synopsis "Computer-aided design (CAD) application")
  122. (description
  123. "LibreCAD is a 2D Computer-aided design (CAD) application for creating
  124. plans and designs.")
  125. (license license:gpl2)))
  126. (define-public geda-gaf
  127. (package
  128. (name "geda-gaf")
  129. (version "1.9.2")
  130. (source (origin
  131. (method url-fetch)
  132. (uri (string-append
  133. "http://ftp.geda-project.org/geda-gaf/unstable/v"
  134. (version-major+minor version) "/"
  135. version "/geda-gaf-" version ".tar.gz"))
  136. (sha256
  137. (base32
  138. "14mk45pfz11v54q66gafw2l68n1p5ssvvjmdm8ffgc8x1w5ajfrz"))))
  139. (build-system gnu-build-system)
  140. (arguments
  141. '(#:phases
  142. (modify-phases %standard-phases
  143. ;; tests require a writable HOME
  144. (add-before 'check 'set-home
  145. (lambda _
  146. (setenv "HOME" (getenv "TMPDIR"))
  147. #t)))
  148. #:configure-flags
  149. (let ((pcb (assoc-ref %build-inputs "pcb")))
  150. (list (string-append "--with-pcb-datadir=" pcb "/share")
  151. (string-append "--with-pcb-lib-path="
  152. pcb "/share/pcb/pcblib-newlib:"
  153. pcb "/share/pcb/newlib")))))
  154. (inputs
  155. `(("glib" ,glib)
  156. ("gtk" ,gtk+-2)
  157. ("guile" ,guile-2.0)
  158. ("desktop-file-utils" ,desktop-file-utils)
  159. ("shared-mime-info" ,shared-mime-info)
  160. ("m4" ,m4)
  161. ("pcb" ,pcb)))
  162. (native-inputs
  163. `(("pkg-config" ,pkg-config)
  164. ("perl" ,perl))) ; for tests
  165. (home-page "http://geda-project.org/")
  166. (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
  167. (description
  168. "Gaf stands for “gschem and friends”. It is a subset of the entire tool
  169. suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
  170. which currently includes: gschem, a schematic capture program; gnetlist, a
  171. netlist generation program; gsymcheck, a syntax checker for schematic symbols;
  172. gattrib, a spreadsheet programm that manipulates the properties of symbols of
  173. a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
  174. tool to forward annotation from your schematic to layout using PCB; some minor
  175. utilities.")
  176. (license license:gpl2+)))
  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. (define-public pcb-rnd
  243. (package (inherit pcb)
  244. (name "pcb-rnd")
  245. (version "1.1.3")
  246. (source (origin
  247. (method url-fetch)
  248. (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
  249. "pcb-rnd-" version ".tar.gz"))
  250. (sha256
  251. (base32
  252. "0pycynla60b96jkb6fh6f4sx663pqbzjwnixhw5ym8sym2absm09"))))
  253. (arguments
  254. `(#:tests? #f ; no check target
  255. #:phases
  256. (modify-phases %standard-phases
  257. (add-after 'unpack 'cc-is-gcc
  258. (lambda _ (setenv "CC" "gcc") #t))
  259. (replace 'configure
  260. ;; The configure script doesn't tolerate most of our configure flags.
  261. (lambda* (#:key outputs #:allow-other-keys)
  262. (zero? (system* "sh" "configure"
  263. (string-append "--prefix="
  264. (assoc-ref outputs "out")))))))))
  265. (home-page "http://repo.hu/projects/pcb-rnd/")
  266. (description "PCB RND is a fork of the GNU PCB circuit board editing tool
  267. featuring various improvements and bug fixes.")))
  268. (define-public fastcap
  269. (package
  270. (name "fastcap")
  271. (version "2.0-18Sep92")
  272. (source (origin
  273. (method url-fetch/tarbomb)
  274. (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
  275. name "-" version ".tgz"))
  276. (sha256
  277. (base32
  278. "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
  279. (snippet
  280. ;; Remove a non-free file.
  281. '(delete-file "doc/psfig.sty"))
  282. (patches (search-patches "fastcap-mulSetup.patch"
  283. "fastcap-mulGlobal.patch"))))
  284. (build-system gnu-build-system)
  285. (native-inputs
  286. `(("texlive" ,texlive)
  287. ("ghostscript" ,ghostscript)))
  288. (arguments
  289. `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
  290. #:parallel-build? #f
  291. #:tests? #f ;; no tests-suite
  292. #:modules ((srfi srfi-1)
  293. ,@%gnu-build-system-modules)
  294. #:phases
  295. (modify-phases %standard-phases
  296. (add-after 'build 'make-doc
  297. (lambda _
  298. (zero? (system* "make" "CC=gcc" "RM=rm" "SHELL=sh"
  299. "manual"))))
  300. (add-before 'make-doc 'fix-doc
  301. (lambda _
  302. (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
  303. (substitute* (find-files "doc" "\\.tex")
  304. (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
  305. all file scale)
  306. (string-append "\\includegraphics[scale=" scale "]{"
  307. file "}"))
  308. (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
  309. all file width)
  310. (string-append "\\includegraphics[width=" width "]{"
  311. file "}"))
  312. (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
  313. all file height)
  314. (string-append "\\includegraphics[height=" height "]{"
  315. file "}"))
  316. (("\\\\psfig\\{figure=([^,]*)\\}" all file)
  317. (string-append "\\includegraphics{" file "}")))
  318. (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
  319. (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
  320. all options class)
  321. (string-append "\\documentclass[" options "]{"
  322. class "}\n"
  323. "\\usepackage{graphicx}\n"
  324. "\\usepackage{robinspace}"))
  325. (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
  326. (string-append "%" all))
  327. (("\\\\setstretch\\{.*\\}" all)
  328. (string-append "%" all)))
  329. #t))
  330. (delete 'configure)
  331. (add-before 'install 'clean-bin
  332. (lambda _
  333. (delete-file (string-append (getcwd) "/bin/README"))
  334. #t))
  335. (add-before 'install 'make-pdf
  336. (lambda _
  337. (with-directory-excursion "doc"
  338. (and
  339. (every (lambda (file)
  340. (zero? (system* "dvips" file "-o")))
  341. (find-files "." "\\.dvi"))
  342. (every (lambda (file)
  343. (zero? (system* "ps2pdf" file)))
  344. '("mtt.ps" "ug.ps" "tcad.ps"))
  345. (zero? (system* "make" "clean"))))))
  346. (replace 'install
  347. (lambda* (#:key outputs #:allow-other-keys)
  348. (let* ((out (assoc-ref outputs "out"))
  349. (data (string-append out "/share"))
  350. (bin (string-append out "/bin"))
  351. (doc (string-append data "/doc/" ,name "-" ,version))
  352. (examples (string-append doc "/examples")))
  353. (with-directory-excursion "bin"
  354. (for-each (lambda (f)
  355. (install-file f bin))
  356. (find-files "." ".*")))
  357. (copy-recursively "doc" doc)
  358. (copy-recursively "examples" examples)
  359. #t))))))
  360. (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
  361. (synopsis "Multipole-accelerated capacitance extraction program")
  362. (description
  363. "Fastcap is a capacitance extraction program based on a
  364. multipole-accelerated algorithm.")
  365. (license (license:non-copyleft #f "See fastcap.c."))))
  366. (define-public fasthenry
  367. (package
  368. (name "fasthenry")
  369. (version "3.0-12Nov96")
  370. (source (origin
  371. (method url-fetch)
  372. (file-name (string-append name "-" version ".tar.gz"))
  373. (uri (string-append
  374. "http://www.rle.mit.edu/cpg/codes/" name
  375. "-" version ".tar.z"))
  376. (sha256
  377. (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
  378. (patches (search-patches "fasthenry-spAllocate.patch"
  379. "fasthenry-spBuild.patch"
  380. "fasthenry-spUtils.patch"
  381. "fasthenry-spSolve.patch"
  382. "fasthenry-spFactor.patch"))))
  383. (build-system gnu-build-system)
  384. (arguments
  385. `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
  386. #:parallel-build? #f
  387. #:tests? #f ;; no tests-suite
  388. #:modules ((srfi srfi-1)
  389. ,@%gnu-build-system-modules)
  390. #:phases
  391. (modify-phases %standard-phases
  392. (delete 'configure)
  393. (replace 'install
  394. (lambda* (#:key outputs #:allow-other-keys)
  395. (let* ((out (assoc-ref outputs "out"))
  396. (data (string-append out "/share"))
  397. (bin (string-append out "/bin"))
  398. (doc (string-append data "/doc/" ,name "-" ,version))
  399. (examples (string-append doc "/examples")))
  400. (with-directory-excursion "bin"
  401. (for-each (lambda (f)
  402. (install-file f bin))
  403. (find-files "." ".*")))
  404. (copy-recursively "doc" doc)
  405. (copy-recursively "examples" examples)
  406. #t))))))
  407. (home-page "http://www.rle.mit.edu/cpg/research_codes.htm")
  408. (synopsis "Multipole-accelerated inductance analysis program")
  409. (description
  410. "Fasthenry is an inductance extraction program based on a
  411. multipole-accelerated algorithm.")
  412. (license (license:non-copyleft #f "See induct.c."))))
  413. (define-public fritzing
  414. (package
  415. (name "fritzing")
  416. (version "0.9.2b")
  417. (source (origin
  418. (method url-fetch)
  419. (uri (string-append "https://github.com/fritzing/"
  420. "fritzing-app/archive/" version ".tar.gz"))
  421. (file-name (string-append name "-" version ".tar.gz"))
  422. (sha256
  423. (base32
  424. "0pvk57z2pxz89pcwwm61lkpvj4w9qxqz8mi0zkpj6pnaljabp7bf"))))
  425. (build-system gnu-build-system)
  426. (arguments
  427. `(#:phases
  428. (modify-phases %standard-phases
  429. (replace 'configure
  430. (lambda* (#:key inputs outputs #:allow-other-keys)
  431. (and (zero? (system* "tar"
  432. "-xvf" (assoc-ref inputs "fritzing-parts-db")
  433. "-C" "parts"))
  434. (zero? (system* "qmake"
  435. (string-append "PREFIX="
  436. (assoc-ref outputs "out"))
  437. "phoenix.pro"))))))))
  438. (inputs
  439. `(("qtbase" ,qtbase)
  440. ("qtserialport" ,qtserialport)
  441. ("qtsvg" ,qtsvg)
  442. ("boost" ,boost)
  443. ("zlib" ,zlib)
  444. ("fritzing-parts-db"
  445. ,(origin
  446. (method url-fetch)
  447. (uri (string-append "https://github.com/fritzing/"
  448. "fritzing-parts/archive/" version ".tar.gz"))
  449. (file-name (string-append "fritzing-parts-" version ".tar.gz"))
  450. (sha256
  451. (base32
  452. "0jqr8yjg7177f3pk1fcns584r0qavwpr280nggsi2ff3pwk5wpsz"))))))
  453. (home-page "http://fritzing.org")
  454. (synopsis "Electronic circuit design")
  455. (description
  456. "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
  457. software with a low entry barrier, suited for the needs of makers and
  458. hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
  459. library with many commonly used high-level components. Fritzing makes it very
  460. easy to communicate about circuits, as well as to turn them into PCB layouts
  461. ready for production.")
  462. ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
  463. ;; released under GPLv3+.
  464. (license (list license:gpl3+ license:cc-by-sa3.0))))
  465. (define-public gerbv
  466. (package
  467. (name "gerbv")
  468. (version "2.6.1")
  469. (source (origin
  470. (method url-fetch)
  471. (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
  472. version "/gerbv-" version ".tar.gz"))
  473. (sha256
  474. (base32
  475. "0v6ry0mxi5qym4z0y0lpblxsw9dfjpgxs4c4v2ngg7yw4b3a59ks"))))
  476. (build-system gnu-build-system)
  477. (arguments
  478. `(#:phases
  479. (modify-phases %standard-phases
  480. (add-after 'unpack 'autoconf
  481. (lambda _
  482. ;; Build rules contain references to Russian translation, but the
  483. ;; needed files are missing; see
  484. ;; http://sourceforge.net/p/gerbv/bugs/174/
  485. (delete-file "po/LINGUAS")
  486. (substitute* "man/Makefile.am"
  487. (("PO_FILES= gerbv.ru.1.in.po") "")
  488. (("man_MANS = gerbv.1 gerbv.ru.1") "man_MANS = gerbv.1"))
  489. (zero? (system* "autoreconf" "-vfi")))))))
  490. (native-inputs
  491. `(("autoconf" ,autoconf)
  492. ("automake" ,automake)
  493. ("libtool" ,libtool)
  494. ("gettext" ,gettext-minimal)
  495. ("po4a" ,po4a)
  496. ("pkg-config" ,pkg-config)))
  497. (inputs
  498. `(("cairo" ,cairo)
  499. ("gtk" ,gtk+-2)
  500. ("desktop-file-utils" ,desktop-file-utils)))
  501. (home-page "http://gerbv.geda-project.org/")
  502. (synopsis "Gerber file viewer")
  503. (description
  504. "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
  505. is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
  506. you load several files on top of each other, do measurements on the displayed
  507. image, etc. Besides viewing Gerbers, you may also view Excellon drill files
  508. as well as pick-place files.")
  509. (license license:gpl2+)))
  510. (define-public ao
  511. (let ((commit "0bc2354b8dcd1a82a0fd6647706b126045e52734"))
  512. (package
  513. (name "ao-cad") ;XXX: really "ao", but it collides with libao
  514. (version (string-append "0." (string-take commit 7)))
  515. (source (origin
  516. (method git-fetch)
  517. (uri (git-reference
  518. (url "https://github.com/mkeeter/ao")
  519. (commit commit)))
  520. (sha256
  521. (base32
  522. "0lm7iljklafs8dhlvaab2yhwx4xymrdjrqk9c5xvn59hlvbgl1j5"))
  523. (file-name (string-append name "-" version "-checkout"))
  524. (modules '((guix build utils)))
  525. (snippet
  526. ;; Remove bundled libraries: Eigen, glm, and catch. TODO:
  527. ;; Unbundle efsw <https://github.com/diegostamigni/efsw>.
  528. '(begin
  529. (delete-file-recursively "vendor")
  530. ;; Use #include <catch.hpp>.
  531. (substitute* (find-files "." "\\.[ch]pp$")
  532. (("catch/catch\\.hpp")
  533. "catch.hpp"))))))
  534. (build-system cmake-build-system)
  535. (arguments
  536. `(;; Have the RUNPATH of libao.so point to $libdir, where libefsw.so
  537. ;; lives.
  538. #:configure-flags (list (string-append "-DCMAKE_SHARED_LINKER_FLAGS="
  539. "-Wl,-rpath="
  540. (assoc-ref %outputs "out")
  541. "/lib"))
  542. #:phases
  543. (modify-phases %standard-phases
  544. (add-before 'build 'add-eigen-to-search-path
  545. (lambda* (#:key inputs #:allow-other-keys)
  546. ;; Allow things to find our own Eigen and Catch.
  547. (let ((eigen (assoc-ref inputs "eigen")))
  548. (setenv "CPLUS_INCLUDE_PATH"
  549. (string-append eigen "/include/eigen3:"
  550. (getenv "CPLUS_INCLUDE_PATH")))
  551. #t)))
  552. (add-after 'install 'install-guile-bindings
  553. (lambda* (#:key inputs outputs #:allow-other-keys)
  554. ;; Install the Guile bindings (the build system only installs
  555. ;; libao.so.)
  556. (let* ((out (assoc-ref outputs "out"))
  557. (moddir (string-append out "/share/guile/site/2.0")))
  558. (install-file "bind/libao.so"
  559. (string-append out "/lib"))
  560. ;; Go to the source directory.
  561. (with-directory-excursion ,(string-append "../"
  562. name "-" version
  563. "-checkout")
  564. (substitute* "bind/guile/ao/bind.scm"
  565. (("\\(define libao \\(dynamic-link .*$")
  566. (string-append "(define libao (dynamic-link \""
  567. out "/lib/libao\")) ;")))
  568. (for-each (lambda (file)
  569. (install-file file
  570. (string-append moddir
  571. "/ao")))
  572. (find-files "bind/guile" "\\.scm$"))
  573. (substitute* "bin/ao-guile"
  574. (("\\(add-to-load-path .*")
  575. (string-append "(add-to-load-path \"" moddir "\")")))
  576. (install-file "bin/ao-guile"
  577. (string-append out "/bin"))
  578. ;; Allow Ao to dlopen the relevant GL libraries. Otherwise
  579. ;; it fails with:
  580. ;; Couldn't find current GLX or EGL context.
  581. (let ((mesa (assoc-ref inputs "mesa")))
  582. (wrap-program (string-append out "/bin/ao-guile")
  583. `("LD_LIBRARY_PATH" ":" prefix
  584. (,(string-append mesa "/lib")))))
  585. #t)))))))
  586. (native-inputs
  587. `(("pkg-config" ,pkg-config)))
  588. (inputs
  589. `(("boost" ,boost)
  590. ("catch" ,catch-framework)
  591. ("libpng" ,libpng)
  592. ("glfw" ,glfw)
  593. ("libepoxy" ,libepoxy)
  594. ("mesa" ,mesa)
  595. ("eigen" ,eigen)
  596. ("glm" ,glm)
  597. ("guile" ,guile-2.0)))
  598. (home-page "http://www.mattkeeter.com/projects/ao/")
  599. (synopsis "Tool for programmatic computer-aided design")
  600. (description
  601. "Ao is a tool for programmatic computer-aided design (CAD). In Ao,
  602. solid models are defined as Scheme scripts, and there are no opaque function
  603. calls into the geometry kernel: everything is visible to the user. Even
  604. fundamental, primitive shapes are represented as code in the user-level
  605. language.")
  606. (license (list license:lgpl2.1+ ;library
  607. license:gpl2+))))) ;Guile bindings
  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. (define-public kicad-library
  692. (let ((version "4.0.4"))
  693. (package
  694. (name "kicad-library")
  695. (version version)
  696. (source (origin
  697. (method url-fetch)
  698. (uri (string-append
  699. "http://downloads.kicad-pcb.org/libraries/kicad-library-"
  700. version ".tar.gz"))
  701. (sha256
  702. (base32
  703. "1wyda58y39lhxml0xv1ngvddi0nqihx9bnlza46ajzms38ajvh12"))))
  704. (build-system cmake-build-system)
  705. (arguments
  706. `(#:out-of-source? #t
  707. #:tests? #f ; no tests
  708. #:phases
  709. (modify-phases %standard-phases
  710. (add-after 'install 'install-footprints ; from footprints tarball
  711. (lambda* (#:key inputs outputs #:allow-other-keys)
  712. (zero? (system* "tar" "xvf"
  713. (assoc-ref inputs "kicad-footprints")
  714. "-C" (string-append (assoc-ref outputs "out")
  715. "/share/kicad/modules")
  716. "--strip-components=1"))))
  717. ;; We change the default global footprint file, which is generated if
  718. ;; it doesn't exist in user's home directory, from the one using the
  719. ;; github plugin, to the one using the KISYSMOD environment path.
  720. (add-after 'install-footprints 'use-pretty-footprint-table
  721. (lambda* (#:key outputs #:allow-other-keys)
  722. (let* ((out (assoc-ref outputs "out"))
  723. (template-dir (string-append out "/share/kicad/template"))
  724. (fp-lib-table (string-append template-dir "/fp-lib-table")))
  725. (delete-file fp-lib-table)
  726. (copy-file (string-append fp-lib-table ".for-pretty")
  727. fp-lib-table))
  728. #t)))))
  729. (native-search-paths
  730. (list (search-path-specification
  731. (variable "KISYSMOD") ; footprint path
  732. (files '("share/kicad/modules")))
  733. (search-path-specification
  734. (variable "KISYS3DMOD") ; 3D model path
  735. (files '("share/kicad/modules/packages3d")))))
  736. ;; Kicad distributes footprints in a separate tarball
  737. (native-inputs
  738. `(("kicad-footprints"
  739. ,(origin
  740. (method url-fetch)
  741. (uri (string-append
  742. "http://downloads.kicad-pcb.org/libraries/kicad-footprints-"
  743. version ".tar.gz"))
  744. (sha256
  745. (base32
  746. "0ya4gg6clz3vp2wrb67xwg0bhwh5q8ag39jjmpcp4zjcqs1f48rb"))))))
  747. (home-page "http://kicad-pcb.org/")
  748. (synopsis "Libraries for kicad")
  749. (description "This package provides Kicad component, footprint and 3D
  750. render model libraries.")
  751. (license license:lgpl2.0+))))
  752. (define-public linsmith
  753. (package
  754. (name "linsmith")
  755. (version "0.99.30")
  756. (source (origin
  757. (method url-fetch)
  758. (uri (string-append
  759. "mirror://sourceforge/linsmith/linsmith/linsmith-"
  760. version "/linsmith-" version ".tar.gz"))
  761. (sha256
  762. (base32
  763. "18qslhr2r45rhpj4v6bjcqx189vs0bflvsj271wr7w8kvh69qwvn"))))
  764. (build-system gnu-build-system)
  765. (native-inputs
  766. `(("pkg-config" ,pkg-config)
  767. ("gtk" ,gtk+-2)
  768. ("libgnome" ,libgnomeui)))
  769. (home-page "http://jcoppens.com/soft/linsmith/index.en.php")
  770. (synopsis "Smith Charting program")
  771. (description "LinSmith is a Smith Charting program, mainly designed for
  772. educational use. As such, there is an emphasis on capabilities that improve
  773. the 'showing the effect of'-style of operation.")
  774. (license license:gpl2+)))
  775. (define-public volk
  776. (package
  777. (name "volk")
  778. (version "1.3")
  779. (source
  780. (origin
  781. (method url-fetch)
  782. (uri (string-append "http://libvolk.org/releases/volk-"
  783. version ".tar.gz"))
  784. (sha256
  785. (base32
  786. "1bz3ywc6y5wmz3i8p4z2wbzhns8bc0ywdkl9qnxpcvfcscarbdlh"))))
  787. (build-system cmake-build-system)
  788. (inputs
  789. `(("boost" ,boost)))
  790. (native-inputs
  791. `(("python-2", python-2)
  792. ("python2-cheetah" ,python2-cheetah)))
  793. (home-page "http://libvolk.org/")
  794. (synopsis "Vector-Optimized Library of Kernels")
  795. (description
  796. "@code{volk} contains procedures with machine-specific optimizations
  797. for mathematical functions. It also provides an machine-independent
  798. interface to select the best such procedures to use on a given system.")
  799. (license license:gpl3+)))
  800. (define-public minicom
  801. (package
  802. (name "minicom")
  803. (version "2.7.1")
  804. (source
  805. (origin
  806. (method url-fetch)
  807. (uri (string-append "https://alioth.debian.org/frs/download.php/"
  808. "file/4215/" name "-" version ".tar.gz"))
  809. (sha256
  810. (base32
  811. "1wa1l36fa4npd21xa9nz60yrqwkk5cq713fa3p5v0zk7g9mq6bsk"))))
  812. (build-system gnu-build-system)
  813. (arguments
  814. `(#:configure-flags '("--enable-lock-dir=/var/lock")
  815. #:phases
  816. (modify-phases %standard-phases
  817. (add-after 'unpack 'patch-lock-check
  818. (lambda _
  819. (substitute* "configure"
  820. (("test -d [$]UUCPLOCK") "true"))
  821. #t)))))
  822. (inputs
  823. `(("ncurses" ,ncurses)))
  824. (home-page "https://alioth.debian.org/projects/minicom/")
  825. (synopsis "Serial terminal emulator")
  826. (description "@code{minicom} is a serial terminal emulator.")
  827. (license license:gpl2+)))
  828. (define-public harminv
  829. (package
  830. (name "harminv")
  831. (version "1.4")
  832. (source (origin
  833. (method url-fetch)
  834. (uri
  835. (string-append
  836. "http://ab-initio.mit.edu/harminv/harminv-"
  837. version ".tar.gz"))
  838. (sha256
  839. (base32
  840. "1pmm8d6fx9ahhnk7w12bfa6zx3afbkg4gkvlvgwhpjxbcrvrp3jk"))))
  841. (build-system gnu-build-system)
  842. (arguments
  843. `(#:phases
  844. (modify-phases %standard-phases
  845. (add-before 'configure 'fix-tests
  846. (lambda _
  847. (substitute* "./sines-test.sh"
  848. ; change test frequency range - default fails
  849. (("0\\.15") "0.16"))
  850. #t)))))
  851. (native-inputs
  852. `(("fortran" ,gfortran)))
  853. (inputs
  854. `(("lapack" ,lapack)))
  855. (home-page "http://ab-initio.mit.edu/wiki/index.php/Harminv")
  856. (synopsis "Harmonic inversion solver")
  857. (description
  858. "Harminv is a free program (and accompanying library) to solve the problem of
  859. harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
  860. of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
  861. determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
  862. (license license:gpl2+)))
  863. (define-public guile-libctl
  864. (package
  865. (name "guile-libctl")
  866. (version "3.2.2")
  867. (source (origin
  868. (method url-fetch)
  869. (uri
  870. (string-append
  871. "http://ab-initio.mit.edu/libctl/libctl-"
  872. version ".tar.gz"))
  873. (sha256
  874. (base32
  875. "1g7gqybq20jhdnw5vg18bgbj9jz0408gfmjvs8b4xs30pic8pgca"))))
  876. (build-system gnu-build-system)
  877. (native-inputs
  878. `(("fortran" ,gfortran)))
  879. (inputs
  880. `(("guile" ,guile-2.2)))
  881. (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
  882. (synopsis "Flexible control files implementation for scientific simulations")
  883. (description
  884. "Libctl is a Guile-based library implementing flexible control files
  885. for scientific simulations.")
  886. (license license:gpl2+)))
  887. (define-public mpb
  888. (package
  889. (name "mpb")
  890. (version "1.5")
  891. (source (origin
  892. (method url-fetch)
  893. (uri
  894. (string-append
  895. "http://ab-initio.mit.edu/mpb/mpb-"
  896. version ".tar.gz"))
  897. (sha256
  898. (base32
  899. "1mqb2d8jq957nksayjygq58iy8i42vjryzg9iy5fpfay31wzxsix"))))
  900. (build-system gnu-build-system)
  901. (arguments
  902. `(#:configure-flags
  903. (list (string-append "--with-libctl="
  904. (assoc-ref %build-inputs "libctl")
  905. "/share/libctl"))))
  906. (native-inputs
  907. `(("fortran" ,gfortran)
  908. ("pkg-config" ,pkg-config)
  909. ("swig" ,swig)))
  910. (inputs
  911. `(("fftw" ,fftw)
  912. ("gsl" ,gsl)
  913. ("guile" ,guile-2.2)
  914. ("hdf5" ,hdf5)
  915. ("lapack" ,lapack)
  916. ("libctl" ,guile-libctl)
  917. ("readline" ,readline)
  918. ("zlib" ,zlib)))
  919. (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
  920. (synopsis "Computes band structures and electromagnetic modes of dielectric
  921. structures")
  922. (description
  923. "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
  924. of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
  925. fully-vectorial and three-dimensional methods.")
  926. (license license:gpl2+)))
  927. (define-public meep
  928. (package
  929. (name "meep")
  930. (version "1.3")
  931. (source (origin
  932. (method url-fetch)
  933. (uri
  934. (string-append
  935. "http://ab-initio.mit.edu/meep/meep-"
  936. version ".tar.gz"))
  937. (sha256
  938. (base32
  939. "0f6lbw2hrksg7xscwdqs78jc9nmzx9fs8j0hz1y4i8qknkqiyk2n"))))
  940. (build-system gnu-build-system)
  941. (arguments
  942. `(#:configure-flags
  943. (list (string-append "--with-libctl="
  944. (assoc-ref %build-inputs "libctl")
  945. "/share/libctl"))))
  946. (native-inputs
  947. `(("fortran" ,gfortran)
  948. ("pkg-config" ,pkg-config)
  949. ("swig" ,swig)))
  950. (inputs
  951. `(("fftw" ,fftw)
  952. ("gsl" ,gsl)
  953. ("guile" ,guile-2.0) ; doesn't build with guile-2.2
  954. ("harminv" ,harminv)
  955. ("hdf5" ,hdf5)
  956. ("lapack" ,lapack)
  957. ("libctl" ,guile-libctl)
  958. ("mpb" ,mpb)
  959. ("zlib" ,zlib)))
  960. (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
  961. (synopsis "Finite-difference time-domain (FDTD) simulation software")
  962. (description
  963. "Meep is a finite-difference time-domain (FDTD) simulation software package
  964. developed at MIT to model electromagnetic systems.")
  965. (license license:gpl2+)))
  966. (define-public adms
  967. (package
  968. (name "adms")
  969. (version "2.3.6")
  970. (source (origin
  971. (method url-fetch)
  972. (uri
  973. (string-append
  974. "mirror://sourceforge/mot-adms/adms-source/"
  975. (version-major+minor version) "/adms-" version ".tar.gz"))
  976. (sha256
  977. (base32
  978. "1rn98l6jxcjhi6ai5f7p588khra9z80m0m0lql4n4sb7773fh1vk"))))
  979. (build-system gnu-build-system)
  980. (native-inputs
  981. `(("flex" ,flex)
  982. ("bison" ,bison)))
  983. (home-page "https://sourceforge.net/projects/mot-adms")
  984. (synopsis "Automatic device model synthesizer")
  985. (description
  986. "ADMS is a code generator that converts electrical compact device models
  987. specified in high-level description language into ready-to-compile C code for
  988. the API of spice simulators. Based on transformations specified in XML
  989. language, ADMS transforms Verilog-AMS code into other target languages.")
  990. (license license:gpl3)))
  991. (define-public capstone
  992. (package
  993. (name "capstone")
  994. (version "3.0.5-rc2")
  995. (source (origin
  996. (method url-fetch)
  997. (uri (string-append "https://github.com/aquynh/capstone/archive/"
  998. version ".tar.gz"))
  999. (file-name (string-append name "-" version ".tar.gz"))
  1000. (sha256
  1001. (base32
  1002. "1cqms9r2p43aiwp5spd84zaccp16ih03r7sjhrv16nddahj0jz2q"))))
  1003. (build-system gnu-build-system)
  1004. (arguments
  1005. `(#:tests? #f
  1006. #:make-flags (list (string-append "PREFIX=" %output)
  1007. "CC=gcc")
  1008. #:phases
  1009. (modify-phases %standard-phases
  1010. (delete 'configure)
  1011. ;; cstool's Makefile overrides LDFLAGS, so we cannot pass it as a make flag.
  1012. (add-before 'build 'fix-cstool-ldflags
  1013. (lambda* (#:key outputs #:allow-other-keys)
  1014. (substitute* "cstool/Makefile"
  1015. (("LDFLAGS =")
  1016. (string-append "LDFLAGS = -Wl,-rpath=" (assoc-ref outputs "out")
  1017. "/lib")))
  1018. #t)))))
  1019. (home-page "http://www.capstone-engine.org")
  1020. (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
  1021. (description
  1022. "Capstone is a lightweight multi-platform, multi-architecture disassembly
  1023. framework. Capstone can disassemble machine code for many supported architectures
  1024. such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
  1025. bindings for Python, Java, OCaml and more.")
  1026. (license license:bsd-3)))
  1027. ;; FIXME: This package has a timestamp embedded in
  1028. ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
  1029. (define-public python-capstone
  1030. (package
  1031. (inherit capstone)
  1032. (name "python-capstone")
  1033. (propagated-inputs
  1034. `(("capstone" ,capstone)))
  1035. (build-system python-build-system)
  1036. (arguments
  1037. `(#:phases
  1038. (modify-phases %standard-phases
  1039. (add-after 'unpack 'chdir-and-fix-setup-py
  1040. (lambda _
  1041. (chdir "bindings/python")
  1042. ;; Do not build the library again, because we already have it.
  1043. (substitute* "setup.py" ((".* build_libraries.*") ""))
  1044. ;; This substitution tells python-capstone where to find the
  1045. ;; library.
  1046. (substitute* "capstone/__init__.py"
  1047. (("pkg_resources.resource_filename.*")
  1048. (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
  1049. #t)))))))
  1050. (define-public python2-capstone
  1051. (package-with-python2 python-capstone))
  1052. (define-public radare2
  1053. (package
  1054. (name "radare2")
  1055. (version "1.6.0")
  1056. (source (origin
  1057. (method url-fetch)
  1058. (uri (string-append "http://radare.mikelloc.com/get/" version "/"
  1059. name "-" version ".tar.gz"))
  1060. (sha256
  1061. (base32
  1062. "16ggsk40zz6hyvclvqj1r4bh4hb78jf0d6ppry1jk4r0j30wm7cm"))
  1063. (modules '((guix build utils)))
  1064. (snippet
  1065. '(begin
  1066. (substitute* "libr/asm/p/Makefile"
  1067. (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
  1068. (substitute* "libr/parse/p/Makefile"
  1069. (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))
  1070. (substitute* "libr/bin/p/Makefile"
  1071. (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) "))))))
  1072. (build-system gnu-build-system)
  1073. (arguments
  1074. '(#:tests? #f; tests require git and network access
  1075. #:phases
  1076. (modify-phases %standard-phases
  1077. (add-before 'configure 'mklibdir
  1078. (lambda* (#:key inputs #:allow-other-keys)
  1079. (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
  1080. #t)))
  1081. #:configure-flags
  1082. (list "--with-sysmagic" "--with-syszip" "--with-openssl"
  1083. "--without-nonpic" "--with-rpath" "--with-syscapstone")
  1084. #:make-flags
  1085. (list "CC=gcc")))
  1086. (inputs
  1087. `(("openssl" ,openssl)
  1088. ("zip" ,zip)
  1089. ("gmp" ,gmp)
  1090. ("capstone" ,capstone)))
  1091. (native-inputs
  1092. `(("pkg-config" ,pkg-config)))
  1093. (home-page "https://radare.org/")
  1094. (synopsis "Portable reversing framework")
  1095. (description
  1096. "Radare project started as a forensics tool, a scriptable commandline
  1097. hexadecimal editor able to open disk files, but later support for analyzing
  1098. binaries, disassembling code, debugging programs, attaching to remote gdb
  1099. servers, ...")
  1100. (license license:lgpl3)))
  1101. (define-public asco
  1102. (package
  1103. (name "asco")
  1104. (version "0.4.10")
  1105. (source (origin
  1106. (method url-fetch)
  1107. (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
  1108. version ".tar.gz"))
  1109. (sha256
  1110. (base32
  1111. "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
  1112. (build-system gnu-build-system)
  1113. (arguments
  1114. `(#:tests? #f ; no tests
  1115. #:make-flags '("all" "asco-mpi")
  1116. #:phases
  1117. (modify-phases %standard-phases
  1118. (delete 'configure)
  1119. (add-before 'build 'fix-paths
  1120. (lambda* (#:key inputs #:allow-other-keys)
  1121. (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
  1122. (substitute* '("errfunc.c" "asco.c")
  1123. (("cp ")
  1124. (string-append coreutils "/bin/cp "))
  1125. (("nice")
  1126. (string-append coreutils "/bin/nice")))
  1127. (substitute* "Makefile"
  1128. (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
  1129. #t)))
  1130. (replace 'install ; no install target
  1131. (lambda* (#:key outputs #:allow-other-keys)
  1132. (for-each (lambda (file)
  1133. (install-file file (string-append
  1134. (assoc-ref outputs "out")
  1135. "/bin")))
  1136. '("asco" "asco-mpi" "asco-test"
  1137. "tools/alter/alter" "tools/log/log"))
  1138. #t)))))
  1139. (native-inputs
  1140. `(("mpi" ,openmpi)))
  1141. (inputs
  1142. `(("coreutils-minimal" ,coreutils-minimal)))
  1143. (home-page "http://asco.sourceforge.net/")
  1144. (synopsis "SPICE circuit optimizer")
  1145. (description
  1146. "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
  1147. high-performance parallel differential evolution (DE) optimization algorithm.")
  1148. (license license:gpl2+)))
  1149. (define-public libngspice
  1150. ;; Note: The ngspice's build system does not allow us to build both the
  1151. ;; library and the executables in one go. Thus, we have two packages.
  1152. ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
  1153. (package
  1154. (name "libngspice")
  1155. (version "26")
  1156. (source (origin
  1157. (method url-fetch)
  1158. (uri (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
  1159. version "/ngspice-" version ".tar.gz"))
  1160. (sha256
  1161. (base32
  1162. "02019ndcl057nq9z41nxycqba7wxlb081ibvfj9jv010nz431qji"))
  1163. (modules '((guix build utils)))
  1164. ;; We remove the non-free cider and build without it.
  1165. (snippet
  1166. '(begin
  1167. (delete-file-recursively "src/ciderlib")
  1168. (delete-file "src/ciderinit")
  1169. (substitute* "configure"
  1170. (("src/ciderlib/Makefile") "")
  1171. (("src/ciderlib/input/Makefile") "")
  1172. (("src/ciderlib/support/Makefile") "")
  1173. (("src/ciderlib/oned/Makefile") "")
  1174. (("src/ciderlib/twod/Makefile") ""))))))
  1175. (build-system gnu-build-system)
  1176. (arguments
  1177. `(;; No tests for libngspice exist.
  1178. ;; The transient tests for ngspice fail.
  1179. #:tests? #f
  1180. #:phases
  1181. (modify-phases %standard-phases
  1182. (add-after 'unpack 'patch-timestamps
  1183. (lambda _
  1184. (substitute* "configure"
  1185. (("`date`") "Do 1. Jan 00:00:00 UTC 1970"))
  1186. #t))
  1187. (add-after 'unpack 'delete-program-manuals
  1188. (lambda _
  1189. (substitute* "man/man1/Makefile.in"
  1190. (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
  1191. "man_MANS = "))
  1192. #t))
  1193. (add-after 'install 'delete-script-files
  1194. (lambda* (#:key outputs #:allow-other-keys)
  1195. (delete-file-recursively
  1196. (string-append (assoc-ref outputs "out")
  1197. "/share/ngspice/scripts")))))
  1198. #:configure-flags
  1199. (list "--enable-openmp"
  1200. "--enable-xspice"
  1201. "--with-ngshared"
  1202. "--with-readline=yes")))
  1203. (native-inputs
  1204. `(("bison" ,bison)
  1205. ("flex" ,flex)))
  1206. (inputs
  1207. `(("libxaw" ,libxaw)
  1208. ("mpi" ,openmpi)
  1209. ("readline" ,readline)))
  1210. (home-page "http://ngspice.sourceforge.net/")
  1211. (synopsis "Mixed-level/mixed-signal circuit simulator")
  1212. (description
  1213. "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
  1214. @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
  1215. provides code modeling support and simulation of digital components through
  1216. an embedded event driven algorithm.")
  1217. (license (list license:lgpl2.0+ ; code in frontend/numparam
  1218. (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
  1219. license:public-domain)))) ; xspice
  1220. (define-public ngspice
  1221. ;; The ngspice executables (see libngpsice above.)
  1222. (package (inherit libngspice)
  1223. (name "ngspice")
  1224. (arguments
  1225. (substitute-keyword-arguments (package-arguments libngspice)
  1226. ((#:configure-flags flags)
  1227. `(delete "--with-ngshared" ,flags))
  1228. ((#:phases phases)
  1229. `(modify-phases ,phases
  1230. (add-after 'unpack 'delete-include-files
  1231. (lambda _
  1232. (substitute* "src/Makefile.in"
  1233. (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
  1234. "SUBDIRS = misc maths frontend spicelib"))
  1235. #t))
  1236. (add-after 'install 'delete-cmpp-dlmain
  1237. (lambda* (#:key outputs #:allow-other-keys)
  1238. (for-each (lambda (file)
  1239. (delete-file
  1240. (string-append (assoc-ref outputs "out")
  1241. file)))
  1242. '("/bin/cmpp" "/share/ngspice/dlmain.c"))
  1243. #t))
  1244. (delete 'delete-program-manuals)
  1245. (delete 'delete-script-files)))))
  1246. (inputs
  1247. `(("libngspice" ,libngspice)
  1248. ("readline" ,readline)))))