engineering.scm 130 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ricardo Wurmus <rekado@elephly.net>
  3. ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
  4. ;;; Copyright © 2016, 2018, 2020, 2021, 2022 Efraim Flashner <efraim@flashner.co.il>
  5. ;;; Copyright © 2016 David Thompson <davet@gnu.org>
  6. ;;; Copyright © 2016, 2017, 2018, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
  7. ;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <theodoros@foradis.org>
  8. ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
  9. ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  10. ;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
  11. ;;; Copyright © 2018, 2019 Jonathan Brielmaier <jonathan.brielmaier@web.de>
  12. ;;; Copyright © 2018, 2019, 2020 Arun Isaac <arunisaac@systemreboot.net>
  13. ;;; Copyright © 2019 Tim Stahel <swedneck@swedneck.xyz>
  14. ;;; Copyright © 2019 Jovany Leandro G.C <bit4bit@riseup.net>
  15. ;;; Copyright © 2019 Steve Sprang <scs@stevesprang.com>
  16. ;;; Copyright © 2019 John Soo <jsoo1@asu.edu>
  17. ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
  18. ;;; Copyright © 2020,2021 Vincent Legoll <vincent.legoll@gmail.com>
  19. ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
  20. ;;; Copyright © 2020, 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
  21. ;;; Copyright © 2020 B. Wilson <elaexuotee@wilsonb.com>
  22. ;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
  23. ;;; Copyright © 2020, 2021 Morgan Smith <Morgan.J.Smith@outlook.com>
  24. ;;; Copyright © 2021 qblade <qblade@protonmail.com>
  25. ;;; Copyright © 2021 Gerd Heber <gerd.heber@gmail.com>
  26. ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
  27. ;;; Copyright © 2021 Ivan Gankevich <i.gankevich@spbu.ru>
  28. ;;; Copyright © 2021, 2022 Petr Hodina <phodina@protonmail.com>
  29. ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
  30. ;;; Copyright © 2022 Evgeny Pisemsky <evgeny@pisemsky.com>
  31. ;;; Copyright © 2022 Olivier Dion <olivier.dion@polymtl.ca>
  32. ;;;
  33. ;;; This file is part of GNU Guix.
  34. ;;;
  35. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  36. ;;; under the terms of the GNU General Public License as published by
  37. ;;; the Free Software Foundation; either version 3 of the License, or (at
  38. ;;; your option) any later version.
  39. ;;;
  40. ;;; GNU Guix is distributed in the hope that it will be useful, but
  41. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  42. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  43. ;;; GNU General Public License for more details.
  44. ;;;
  45. ;;; You should have received a copy of the GNU General Public License
  46. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  47. (define-module (gnu packages engineering)
  48. #:use-module (guix packages)
  49. #:use-module (guix download)
  50. #:use-module (guix gexp)
  51. #:use-module (guix git-download)
  52. #:use-module (guix svn-download)
  53. #:use-module (guix monads)
  54. #:use-module (guix store)
  55. #:use-module (guix utils)
  56. #:use-module ((srfi srfi-1) #:hide (zip))
  57. #:use-module ((guix licenses) #:prefix license:)
  58. #:use-module (guix build-system ant)
  59. #:use-module (guix build-system cmake)
  60. #:use-module (guix build-system emacs)
  61. #:use-module (guix build-system gnu)
  62. #:use-module (guix build-system python)
  63. #:use-module (guix build-system qt)
  64. #:use-module (gnu packages)
  65. #:use-module (gnu packages algebra)
  66. #:use-module (gnu packages autotools)
  67. #:use-module (gnu packages base)
  68. #:use-module (gnu packages bash)
  69. #:use-module (gnu packages bdw-gc)
  70. #:use-module (gnu packages bison)
  71. #:use-module (gnu packages boost)
  72. #:use-module (gnu packages check)
  73. #:use-module (gnu packages cmake)
  74. #:use-module (gnu packages commencement)
  75. #:use-module (gnu packages compression)
  76. #:use-module (gnu packages curl)
  77. #:use-module (gnu packages dejagnu)
  78. #:use-module (gnu packages digest)
  79. #:use-module (gnu packages docbook)
  80. #:use-module (gnu packages documentation)
  81. #:use-module (gnu packages flex)
  82. #:use-module (gnu packages fontutils)
  83. #:use-module (gnu packages fpga)
  84. #:use-module (gnu packages freedesktop)
  85. #:use-module (gnu packages gcc)
  86. #:use-module (gnu packages gd)
  87. #:use-module (gnu packages geo)
  88. #:use-module (gnu packages gettext)
  89. #:use-module (gnu packages ghostscript)
  90. #:use-module (gnu packages gl)
  91. #:use-module (gnu packages glib)
  92. #:use-module (gnu packages gnome)
  93. #:use-module (gnu packages gperf)
  94. #:use-module (gnu packages graphics)
  95. #:use-module (gnu packages graphviz)
  96. #:use-module (gnu packages groff)
  97. #:use-module (gnu packages gtk)
  98. #:use-module (gnu packages guile)
  99. #:use-module (gnu packages image)
  100. #:use-module (gnu packages image-processing)
  101. #:use-module (gnu packages imagemagick)
  102. #:use-module (gnu packages kde-frameworks)
  103. #:use-module (gnu packages libevent)
  104. #:use-module (gnu packages libusb)
  105. #:use-module (gnu packages linux) ;FIXME: for pcb
  106. #:use-module (gnu packages lisp)
  107. #:use-module (gnu packages m4)
  108. #:use-module (gnu packages maths)
  109. #:use-module (gnu packages man)
  110. #:use-module (gnu packages multiprecision)
  111. #:use-module (gnu packages mpi)
  112. #:use-module (gnu packages ncurses)
  113. #:use-module (gnu packages parallel)
  114. #:use-module (gnu packages pcre)
  115. #:use-module (gnu packages perl)
  116. #:use-module (gnu packages pkg-config)
  117. #:use-module (gnu packages pretty-print)
  118. #:use-module (gnu packages python)
  119. #:use-module (gnu packages python-crypto)
  120. #:use-module (gnu packages python-xyz)
  121. #:use-module (gnu packages qt)
  122. #:use-module (gnu packages readline)
  123. #:use-module (gnu packages ruby)
  124. #:use-module (gnu packages serialization)
  125. #:use-module (gnu packages sqlite)
  126. #:use-module (gnu packages swig)
  127. #:use-module (gnu packages tbb)
  128. #:use-module (gnu packages tcl)
  129. #:use-module (gnu packages texinfo)
  130. #:use-module (gnu packages tls)
  131. #:use-module (gnu packages tex)
  132. #:use-module (gnu packages version-control)
  133. #:use-module (gnu packages web)
  134. #:use-module (gnu packages wxwidgets)
  135. #:use-module (gnu packages xml)
  136. #:use-module (gnu packages xiph)
  137. #:use-module (gnu packages openkinect)
  138. #:use-module (gnu packages xdisorg)
  139. #:use-module (gnu packages xorg))
  140. (define-public librecad
  141. (package
  142. (name "librecad")
  143. (version "2.2.0-rc2")
  144. (source (origin
  145. (method git-fetch)
  146. (uri (git-reference
  147. (url "https://github.com/LibreCAD/LibreCAD")
  148. (commit version)))
  149. (file-name (git-file-name name version))
  150. (sha256
  151. (base32
  152. "08cl4935c9vznz9qdw1zgd86rn7hl64zpfayxl07x21bhf53pn24"))
  153. (patches
  154. (search-patches "librecad-support-for-boost-1.76.patch"))))
  155. (build-system qt-build-system)
  156. (arguments
  157. '(#:test-target "check"
  158. #:phases
  159. (modify-phases %standard-phases
  160. ;; Without this patch boost complains that "make_array" is not a
  161. ;; member of "boost::serialization".
  162. (add-after 'unpack 'patch-boost-error
  163. (lambda _
  164. (substitute* "librecad/src/lib/math/lc_quadratic.h"
  165. (("#include \"rs_vector.h\"" line)
  166. (string-append line
  167. "\n#include <boost/serialization/array_wrapper.hpp>")))
  168. (substitute* "librecad/src/lib/math/rs_math.cpp"
  169. (("#include <boost/numeric/ublas/matrix.hpp>" line)
  170. (string-append "#include <boost/serialization/array_wrapper.hpp>\n"
  171. line)))
  172. #t))
  173. ;; Fix build against Qt 5.11.
  174. (add-after 'unpack 'add-missing-headers
  175. (lambda _
  176. (substitute* "librecad/src/ui/generic/widgetcreator.cpp"
  177. (("#include <QPushButton>") "#include <QPushButton>
  178. #include <QActionGroup>"))
  179. #t))
  180. (add-after 'unpack 'patch-paths
  181. (lambda* (#:key outputs #:allow-other-keys)
  182. (let ((out (assoc-ref outputs "out")))
  183. (substitute* "librecad/src/lib/engine/rs_system.cpp"
  184. (("/usr/share") (string-append out "/share"))))))
  185. (replace 'configure
  186. (lambda* (#:key inputs #:allow-other-keys)
  187. (system* "qmake" (string-append "BOOST_DIR="
  188. (assoc-ref inputs "boost")))))
  189. (replace 'install
  190. (lambda* (#:key outputs #:allow-other-keys)
  191. (let* ((out (assoc-ref outputs "out"))
  192. (bin (string-append out "/bin"))
  193. (share (string-append out "/share/librecad")))
  194. (mkdir-p bin)
  195. (install-file "unix/librecad" bin)
  196. (mkdir-p share)
  197. (copy-recursively "unix/resources" share))
  198. #t)))))
  199. (inputs
  200. (list boost muparser freetype qtbase-5 qtsvg))
  201. (native-inputs
  202. (list pkg-config which))
  203. (home-page "https://librecad.org/")
  204. (synopsis "Computer-aided design (CAD) application")
  205. (description
  206. "LibreCAD is a 2D Computer-aided design (CAD) application for creating
  207. plans and designs.")
  208. (license license:gpl2)))
  209. (define-public geda-gaf
  210. (package
  211. (name "geda-gaf")
  212. (version "1.10.2")
  213. (source (origin
  214. (method url-fetch)
  215. (uri (string-append
  216. "http://ftp.geda-project.org/geda-gaf/stable/v"
  217. (version-major+minor version) "/"
  218. version "/geda-gaf-" version ".tar.gz"))
  219. (sha256
  220. (base32
  221. "19688b0671imy2i3jphcnq1120b8ymhr4wz2psiqylr82ljanqp8"))))
  222. (build-system gnu-build-system)
  223. (arguments
  224. '(#:phases
  225. (modify-phases %standard-phases
  226. ;; tests require a writable HOME
  227. (add-before 'check 'set-home
  228. (lambda _
  229. (setenv "HOME" (getenv "TMPDIR"))
  230. #t))
  231. (add-after 'unpack 'disable-failing-tests
  232. (lambda _
  233. (substitute* "xorn/tests/Makefile.in"
  234. (("-Werror") ""))
  235. ;; This test returns its correct result in an unexpected order.
  236. (substitute* "libgeda/scheme/unit-tests/t0402-config.scm"
  237. (("\\(begin-config-test 'config-keys" m)
  238. (string-append "#;" m)))
  239. #t)))
  240. #:configure-flags
  241. (let ((pcb (assoc-ref %build-inputs "pcb")))
  242. (list (string-append "--with-pcb-datadir=" pcb "/share")
  243. (string-append "--with-pcb-lib-path="
  244. pcb "/share/pcb/pcblib-newlib:"
  245. pcb "/share/pcb/newlib")))))
  246. (inputs
  247. `(("gamin" ,gamin)
  248. ("glib" ,glib)
  249. ("gtk" ,gtk+-2)
  250. ("guile" ,guile-2.0)
  251. ("shared-mime-info" ,shared-mime-info)
  252. ("m4" ,m4)
  253. ("pcb" ,pcb)
  254. ("python" ,python-2))) ; for xorn
  255. (native-inputs
  256. (list groff pkg-config desktop-file-utils perl)) ; for tests
  257. (home-page "http://geda-project.org/")
  258. (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
  259. (description
  260. "Gaf stands for “gschem and friends”. It is a subset of the entire tool
  261. suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
  262. which currently includes: gschem, a schematic capture program; gnetlist, a
  263. netlist generation program; gsymcheck, a syntax checker for schematic symbols;
  264. gattrib, a spreadsheet programme that manipulates the properties of symbols of
  265. a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
  266. tool to forward annotation from your schematic to layout using PCB; some minor
  267. utilities.")
  268. (license license:gpl2+)))
  269. (define-public lepton-eda
  270. ;; This is a fork of gEDA/gaf started in late 2016. One of its goal is to
  271. ;; keep and to extend Guile support.
  272. (package
  273. (inherit geda-gaf)
  274. (name "lepton-eda")
  275. (version "1.9.14-20210407")
  276. (home-page "https://github.com/lepton-eda/lepton-eda")
  277. (source (origin
  278. (method git-fetch)
  279. (uri (git-reference (url home-page) (commit version)))
  280. (sha256
  281. (base32
  282. "0kyq0g6271vlwraw98637fn8bq2l6q4rll6748nn8rwsmfz71d0m"))
  283. (file-name (git-file-name name version))))
  284. (native-inputs
  285. `(("autoconf" ,autoconf)
  286. ("automake" ,automake)
  287. ("desktop-file-utils" ,desktop-file-utils)
  288. ("libtool" ,libtool)
  289. ("gettext" ,gettext-minimal)
  290. ("texinfo" ,texinfo)
  291. ("groff" ,groff)
  292. ("which" ,which)
  293. ,@(package-native-inputs geda-gaf)))
  294. (inputs
  295. `(("glib" ,glib)
  296. ("gtk" ,gtk+)
  297. ("gtksheet" ,gtksheet)
  298. ("guile" ,guile-3.0)
  299. ("shared-mime-info" ,shared-mime-info)
  300. ("m4" ,m4)
  301. ("pcb" ,pcb)))
  302. (arguments
  303. `(#:configure-flags
  304. (let ((pcb (assoc-ref %build-inputs "pcb")))
  305. ;; When running "make", the POT files are built with the build time as
  306. ;; their "POT-Creation-Date". Later on, "make" notices that .pot
  307. ;; files were updated and goes on to run "msgmerge"; as a result, the
  308. ;; non-deterministic POT-Creation-Date finds its way into .po files,
  309. ;; and then in .gmo files. To avoid that, simply make sure 'msgmerge'
  310. ;; never runs. See <https://bugs.debian.org/792687>.
  311. (list "ac_cv_path_MSGMERGE=true"
  312. "--with-gtk3"
  313. (string-append "--with-pcb-datadir=" pcb "/share")
  314. (string-append "--with-pcb-lib-path="
  315. pcb "/share/pcb/pcblib-newlib:"
  316. pcb "/share/pcb/newlib")
  317. "CFLAGS=-fcommon"))
  318. #:phases
  319. (modify-phases %standard-phases
  320. (add-before 'build 'fix-dynamic-link
  321. (lambda* (#:key inputs outputs #:allow-other-keys)
  322. (substitute* "libleptongui/scheme/schematic/ffi.scm.in"
  323. (("@LIBLEPTONGUI@")
  324. (string-append (assoc-ref outputs "out")
  325. "/lib/libleptongui.so")))
  326. (substitute* '("libleptongui/scheme/schematic/ffi/gtk.scm.in"
  327. "utils/attrib/lepton-attrib.scm")
  328. (("@LIBGTK@")
  329. (search-input-file inputs "/lib/libgtk-3.so")))
  330. (substitute* '("libleptongui/scheme/schematic/ffi/gobject.scm.in")
  331. (("@LIBGOBJECT@")
  332. (search-input-file inputs "/lib/libgobject-2.0.so")))
  333. (substitute* "liblepton/scheme/lepton/ffi.scm.in"
  334. (("@LIBLEPTON@")
  335. (string-append (assoc-ref outputs "out")
  336. "/lib/liblepton.so")))
  337. (substitute* "utils/attrib/lepton-attrib.scm"
  338. (("@LIBLEPTONATTRIB@")
  339. (string-append (assoc-ref outputs "out")
  340. "/lib/libleptonattrib.so")))
  341. (substitute* "liblepton/scheme/lepton/log.scm.in"
  342. (("@LIBGLIB@")
  343. (search-input-file inputs "/lib/libglib-2.0.so")))
  344. ;; For finding libraries when running tests before installation.
  345. (setenv "LIBLEPTONGUI"
  346. (string-append (getcwd)
  347. "/libleptongui/src/.libs/libleptongui.so"))
  348. (setenv "LIBLEPTON"
  349. (string-append (getcwd)
  350. "/libleptongui/src/.libs/liblepton.so"))
  351. (setenv "LD_LIBRARY_PATH"
  352. (string-append (getcwd) "/libleptonattrib/src/.libs/:"
  353. (getenv "LIBRARY_PATH")))
  354. #t))
  355. (add-before 'bootstrap 'prepare
  356. (lambda _
  357. ;; Some of the scripts there are invoked by autogen.sh.
  358. (for-each patch-shebang (find-files "build-tools"))
  359. ;; Make sure 'msgmerge' can modify the PO files.
  360. (for-each (lambda (po)
  361. (chmod po #o666))
  362. (find-files "." "\\.po$"))
  363. ;; This would normally be created by invoking 'git', but it
  364. ;; doesn't work here.
  365. (call-with-output-file "version.h"
  366. (lambda (port)
  367. (format port "#define PACKAGE_DATE_VERSION \"~a\"~%"
  368. ,(string-drop version
  369. (+ 1 (string-index version #\-))))
  370. (format port "#define PACKAGE_DOTTED_VERSION \"~a\"~%"
  371. ,(string-take version
  372. (string-index version #\-)))
  373. (format port "#define PACKAGE_GIT_COMMIT \"cabbag3\"~%")))
  374. #t))
  375. (add-after 'install 'compile-scheme-files
  376. (lambda* (#:key outputs #:allow-other-keys)
  377. (unsetenv "LIBLEPTONGUI")
  378. (unsetenv "LIBLEPTON")
  379. (unsetenv "LD_LIBRARY_PATH")
  380. (invoke "make" "precompile")
  381. #t)))))
  382. (description
  383. "Lepton EDA ia an @dfn{electronic design automation} (EDA) tool set
  384. forked from gEDA/gaf in late 2016. EDA tools are used for electrical circuit
  385. design, schematic capture, simulation, prototyping, and production. Lepton
  386. EDA includes tools for schematic capture, attribute management, bill of
  387. materials (BOM) generation, netlisting into over 20 netlist formats, analog
  388. and digital simulation, and printed circuit board (PCB) layout, and many other
  389. features.")))
  390. (define-public pcb
  391. (package
  392. (name "pcb")
  393. (version "4.0.2")
  394. (source (origin
  395. (method url-fetch)
  396. (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
  397. "/pcb-" version ".tar.gz"))
  398. (sha256
  399. (base32
  400. "1a7rilp75faidny0r4fdwdxkflyrqp6svxv9lbg7h868293962iz"))))
  401. (build-system gnu-build-system)
  402. (arguments
  403. `(#:phases
  404. (modify-phases %standard-phases
  405. (add-after 'unpack 'use-wish8.6
  406. (lambda _
  407. (substitute* "configure"
  408. (("wish85") "wish8.6"))
  409. #t))
  410. ;; It checks for "xhost", which we don't have. This shouldn't
  411. ;; matter, because the test is supposed to be skipped, but it causes
  412. ;; "run_tests.sh" (and thus the "check" phase) to fail.
  413. (add-after 'unpack 'fix-check-for-display
  414. (lambda _
  415. (substitute* "tests/run_tests.sh"
  416. (("have_display=no") "have_display=yes"))
  417. #t))
  418. (add-after 'install 'wrap
  419. (lambda* (#:key inputs outputs #:allow-other-keys)
  420. ;; FIXME: Mesa tries to dlopen libudev.so.0 and fails. Pending a
  421. ;; fix of the mesa package we wrap the pcb executable such that
  422. ;; Mesa can find libudev.so.0 through LD_LIBRARY_PATH.
  423. (let* ((out (assoc-ref outputs "out"))
  424. (path (dirname
  425. (search-input-file inputs "/lib/libudev.so"))))
  426. (wrap-program (string-append out "/bin/pcb")
  427. `("LD_LIBRARY_PATH" ":" prefix (,path))))
  428. #t))
  429. (add-before 'check 'pre-check
  430. (lambda _
  431. (system "Xvfb :1 &")
  432. (setenv "DISPLAY" ":1")
  433. #t)))))
  434. (inputs
  435. `(("dbus" ,dbus)
  436. ("mesa" ,mesa)
  437. ("udev" ,eudev) ;FIXME: required by mesa
  438. ("glu" ,glu)
  439. ("gd" ,gd)
  440. ("gtk" ,gtk+-2)
  441. ("gtkglext" ,gtkglext)
  442. ("shared-mime-info" ,shared-mime-info)
  443. ("tk" ,tk)))
  444. (native-inputs
  445. `(("pkg-config" ,pkg-config)
  446. ("intltool" ,intltool)
  447. ("bison" ,bison)
  448. ("desktop-file-utils" ,desktop-file-utils)
  449. ("flex" ,flex)
  450. ;; For tests
  451. ("imagemagick" ,imagemagick)
  452. ("gerbv" ,gerbv)
  453. ("ghostscript" ,ghostscript)
  454. ("xvfb" ,xorg-server-for-tests)))
  455. (home-page "http://pcb.geda-project.org/")
  456. (synopsis "Design printed circuit board layouts")
  457. (description
  458. "GNU PCB is an interactive tool for editing printed circuit board
  459. layouts. It features a rats-nest implementation, schematic/netlist import,
  460. and design rule checking. It also includes an autorouter and a trace
  461. optimizer; and it can produce photorealistic and design review images.")
  462. (license license:gpl2+)))
  463. (define-public pcb-rnd
  464. (package (inherit pcb)
  465. (name "pcb-rnd")
  466. (version "2.2.4")
  467. (source (origin
  468. (method url-fetch)
  469. (uri (string-append "http://repo.hu/projects/pcb-rnd/releases/"
  470. "pcb-rnd-" version ".tar.gz"))
  471. (sha256
  472. (base32
  473. "06ylc2rd4yvzp3krk62q9dbi13h0yq1x257fbjkh10vfjn0ga5c2"))))
  474. (arguments
  475. `(#:tests? #f ; no check target
  476. #:phases
  477. (modify-phases %standard-phases
  478. (add-after 'unpack 'cc-is-gcc
  479. (lambda _ (setenv "CC" "gcc") #t))
  480. (replace 'configure
  481. ;; The configure script doesn't tolerate most of our configure flags.
  482. (lambda* (#:key outputs #:allow-other-keys)
  483. (invoke "sh" "configure"
  484. (string-append "--prefix="
  485. (assoc-ref outputs "out"))))))))
  486. (home-page "http://repo.hu/projects/pcb-rnd/")
  487. (description "PCB RND is a fork of the GNU PCB circuit board editing tool
  488. featuring various improvements and bug fixes.")))
  489. (define-public fastcap
  490. (package
  491. (name "fastcap")
  492. (version "2.0-18Sep92")
  493. (source (origin
  494. (method url-fetch/tarbomb)
  495. (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
  496. name "-" version ".tgz"))
  497. (sha256
  498. (base32
  499. "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
  500. (snippet
  501. ;; Remove a non-free file.
  502. '(begin
  503. (delete-file "doc/psfig.sty")
  504. #t))
  505. (patches (search-patches "fastcap-mulSetup.patch"
  506. "fastcap-mulGlobal.patch"))))
  507. (build-system gnu-build-system)
  508. (native-inputs
  509. ;; FIXME: with texlive-tiny citation references are rendered as question
  510. ;; marks. During the build warnings like these are printed:
  511. ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line 3.
  512. `(("texlive" ,(texlive-updmap.cfg (list texlive-amsfonts)))
  513. ("ghostscript" ,ghostscript)))
  514. (arguments
  515. `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
  516. #:parallel-build? #f
  517. #:tests? #f ;; no tests-suite
  518. #:modules ((srfi srfi-1)
  519. ,@%gnu-build-system-modules)
  520. #:phases
  521. (modify-phases %standard-phases
  522. (add-after 'build 'make-doc
  523. (lambda _
  524. (invoke "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
  525. (add-before 'make-doc 'fix-doc
  526. (lambda _
  527. (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
  528. (substitute* (find-files "doc" "\\.tex")
  529. (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
  530. all file scale)
  531. (string-append "\\includegraphics[scale=" scale "]{"
  532. file "}"))
  533. (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
  534. all file width)
  535. (string-append "\\includegraphics[width=" width "]{"
  536. file "}"))
  537. (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
  538. all file height)
  539. (string-append "\\includegraphics[height=" height "]{"
  540. file "}"))
  541. (("\\\\psfig\\{figure=([^,]*)\\}" all file)
  542. (string-append "\\includegraphics{" file "}")))
  543. (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
  544. (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
  545. all options class)
  546. (string-append "\\documentclass[" options "]{"
  547. class "}\n"
  548. "\\usepackage{graphicx}\n"
  549. "\\usepackage{robinspace}"))
  550. (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
  551. (string-append "%" all))
  552. (("\\\\setstretch\\{.*\\}" all)
  553. (string-append "%" all)))
  554. #t))
  555. (delete 'configure)
  556. (add-before 'install 'clean-bin
  557. (lambda _
  558. (delete-file (string-append (getcwd) "/bin/README"))
  559. #t))
  560. (add-before 'install 'make-pdf
  561. (lambda _
  562. (setenv "HOME" "/tmp") ; FIXME: for texlive font cache
  563. (with-directory-excursion "doc"
  564. (and
  565. (for-each (lambda (file)
  566. (invoke "dvips" file "-o"))
  567. (find-files "." "\\.dvi"))
  568. (for-each (lambda (file)
  569. (invoke "ps2pdf" file))
  570. '("mtt.ps" "ug.ps" "tcad.ps"))
  571. (invoke "make" "clean")))))
  572. (replace 'install
  573. (lambda* (#:key outputs #:allow-other-keys)
  574. (let* ((out (assoc-ref outputs "out"))
  575. (data (string-append out "/share"))
  576. (bin (string-append out "/bin"))
  577. (doc (string-append data "/doc/" ,name "-" ,version))
  578. (examples (string-append doc "/examples")))
  579. (with-directory-excursion "bin"
  580. (for-each (lambda (f)
  581. (install-file f bin))
  582. (find-files "." ".*")))
  583. (copy-recursively "doc" doc)
  584. (copy-recursively "examples" examples)
  585. #t))))))
  586. (home-page "https://www.rle.mit.edu/cpg/research_codes.htm")
  587. (synopsis "Multipole-accelerated capacitance extraction program")
  588. (description
  589. "Fastcap is a capacitance extraction program based on a
  590. multipole-accelerated algorithm.")
  591. (license (license:non-copyleft #f "See fastcap.c."))))
  592. (define-public fasthenry
  593. (package
  594. (name "fasthenry")
  595. (version "3.0-12Nov96")
  596. (source (origin
  597. (method url-fetch)
  598. (file-name (string-append name "-" version ".tar.gz"))
  599. (uri (string-append
  600. "http://www.rle.mit.edu/cpg/codes/" name
  601. "-" version ".tar.z"))
  602. (sha256
  603. (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
  604. (patches (search-patches "fasthenry-spAllocate.patch"
  605. "fasthenry-spBuild.patch"
  606. "fasthenry-spUtils.patch"
  607. "fasthenry-spSolve.patch"
  608. "fasthenry-spFactor.patch"))))
  609. (build-system gnu-build-system)
  610. (arguments
  611. `(#:make-flags '("CC=gcc" "RM=rm" "SHELL=sh" "all")
  612. #:parallel-build? #f
  613. #:tests? #f ;; no tests-suite
  614. #:modules ((srfi srfi-1)
  615. ,@%gnu-build-system-modules)
  616. #:phases
  617. (modify-phases %standard-phases
  618. (delete 'configure)
  619. (replace 'install
  620. (lambda* (#:key outputs #:allow-other-keys)
  621. (let* ((out (assoc-ref outputs "out"))
  622. (data (string-append out "/share"))
  623. (bin (string-append out "/bin"))
  624. (doc (string-append data "/doc/" ,name "-" ,version))
  625. (examples (string-append doc "/examples")))
  626. (with-directory-excursion "bin"
  627. (for-each (lambda (f)
  628. (install-file f bin))
  629. (find-files "." ".*")))
  630. (copy-recursively "doc" doc)
  631. (copy-recursively "examples" examples)
  632. #t))))))
  633. (home-page "https://www.rle.mit.edu/cpg/research_codes.htm")
  634. (synopsis "Multipole-accelerated inductance analysis program")
  635. (description
  636. "Fasthenry is an inductance extraction program based on a
  637. multipole-accelerated algorithm.")
  638. (license (license:non-copyleft #f "See induct.c."))))
  639. (define-public fritzing
  640. (package
  641. (name "fritzing")
  642. (version "0.9.3b")
  643. (source (origin
  644. (method git-fetch)
  645. (uri (git-reference
  646. (url "https://github.com/fritzing/fritzing-app")
  647. (commit version)))
  648. (file-name (git-file-name name version))
  649. (sha256
  650. (base32
  651. "0hpyc550xfhr6gmnc85nq60w00rm0ljm0y744dp0z88ikl04f4s3"))))
  652. (build-system gnu-build-system)
  653. (arguments
  654. `(#:phases
  655. (modify-phases %standard-phases
  656. (replace 'configure
  657. (lambda* (#:key inputs outputs #:allow-other-keys)
  658. (copy-recursively (assoc-ref inputs "fritzing-parts-db")
  659. "parts")
  660. ;; Make compatible with libgit2 > 0.24
  661. (substitute* "src/version/partschecker.cpp"
  662. (("error = git_remote_connect\\(remote, GIT_DIRECTION_FETCH, &callbacks\\)")
  663. "error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &callbacks, NULL, NULL)"))
  664. ;; Use system libgit2 and boost.
  665. (substitute* "phoenix.pro"
  666. (("^LIBGIT2INCLUDE =.*")
  667. (string-append "LIBGIT2INCLUDE="
  668. (assoc-ref inputs "libgit2") "/include\n"))
  669. (("^ LIBGIT2LIB =.*")
  670. (string-append " LIBGIT2LIB="
  671. (assoc-ref inputs "libgit2") "/lib\n")))
  672. ;; This file checks for old versions of Boost, insisting on
  673. ;; having us download the boost sources and placing them in the
  674. ;; build directory.
  675. (substitute* "pri/utils.pri"
  676. (("error\\(") "message("))
  677. (let ((out (assoc-ref outputs "out")))
  678. (invoke "qmake"
  679. (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," out "/lib")
  680. (string-append "PREFIX=" out)
  681. "phoenix.pro")))))))
  682. (inputs
  683. `(("qtbase" ,qtbase-5)
  684. ("qtserialport" ,qtserialport)
  685. ("qtsvg" ,qtsvg)
  686. ("libgit2" ,libgit2)
  687. ("boost" ,boost)
  688. ("zlib" ,zlib)
  689. ("fritzing-parts-db"
  690. ,(origin
  691. (method git-fetch)
  692. (uri (git-reference
  693. (url "https://github.com/fritzing/fritzing-parts")
  694. (commit version)))
  695. (file-name (git-file-name "fritzing-parts" version))
  696. (sha256
  697. (base32
  698. "1d2v8k7p176j0lczx4vx9n9gbg3vw09n2c4b6w0wj5wqmifywhc1"))))))
  699. (home-page "https://fritzing.org")
  700. (synopsis "Electronic circuit design")
  701. (description
  702. "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
  703. software with a low entry barrier, suited for the needs of makers and
  704. hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
  705. library with many commonly used high-level components. Fritzing makes it very
  706. easy to communicate about circuits, as well as to turn them into PCB layouts
  707. ready for production.")
  708. ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
  709. ;; released under GPLv3+.
  710. (license (list license:gpl3+ license:cc-by-sa3.0))))
  711. (define-public qelectrotech
  712. (package
  713. (name "qelectrotech")
  714. (version "0.8.0")
  715. (source
  716. (origin
  717. (method url-fetch)
  718. (uri (string-append "https://git.tuxfamily.org/qet/qet.git/"
  719. "snapshot/qet-" version ".tar.gz"))
  720. (sha256
  721. (base32 "0w70fqwhqqzga1kfp34v8z1xf9988nvvi3d5gwl2sg429p9mpsk2"))))
  722. (build-system qt-build-system)
  723. (arguments
  724. ;; XXX: tests are built for the CMake build option but it seems to be
  725. ;; broken in 0.8.0.
  726. `(#:tests? #f
  727. #:phases
  728. (modify-phases %standard-phases
  729. (replace 'configure
  730. (lambda* (#:key outputs #:allow-other-keys)
  731. (let ((out (assoc-ref outputs "out")))
  732. ;; Patch hardcoded path before running qmake.
  733. (substitute* "qelectrotech.pro" (("\\/usr\\/local") out))
  734. (invoke "qmake")))))))
  735. (native-inputs
  736. (list pkg-config qttools))
  737. (inputs
  738. (list kcoreaddons kwidgetsaddons qtbase-5 qtsvg sqlite))
  739. (home-page "https://qelectrotech.org/")
  740. (synopsis "CAD/CAE editor focusing on schematics drawing features")
  741. (description "QElectroTech, or QET in short, is a desktop application to
  742. create diagrams and schematics. The software is primarily intended to create
  743. electrical documentation but it can also be used to draw any kinds of diagrams,
  744. such as those made in pneumatics, hydraulics, process industries, electronics,
  745. and others.")
  746. (license license:gpl2+)))
  747. (define-public gerbv
  748. (package
  749. (name "gerbv")
  750. (version "2.7.0")
  751. (source (origin
  752. (method url-fetch)
  753. (uri (string-append "mirror://sourceforge/gerbv/gerbv/gerbv-"
  754. version "/gerbv-" version ".tar.gz"))
  755. (sha256
  756. (base32
  757. "1d2k43k7i4yvbpi4sw1263a8d0q98z2n7aqhmpinpkih8a681vn5"))))
  758. (build-system gnu-build-system)
  759. (arguments
  760. '(#:configure-flags '("CFLAGS=-fcommon")))
  761. (native-inputs
  762. `(("glib:bin" ,glib "bin") ; for glib-compile-schemas, etc.
  763. ("desktop-file-utils" ,desktop-file-utils)
  764. ("pkg-config" ,pkg-config)))
  765. (inputs
  766. `(("cairo" ,cairo)
  767. ("gtk" ,gtk+-2)))
  768. (home-page "http://gerbv.geda-project.org/")
  769. (synopsis "Gerber file viewer")
  770. (description
  771. "Gerbv is a viewer for files in the Gerber format (RS-274X only), which
  772. is commonly used to represent printed circuit board (PCB) layouts. Gerbv lets
  773. you load several files on top of each other, do measurements on the displayed
  774. image, etc. Besides viewing Gerbers, you may also view Excellon drill files
  775. as well as pick-place files.")
  776. (license license:gpl2+)))
  777. (define-public translate2geda
  778. ;; There has been no formal release yet.
  779. (let ((commit "4c19e7eefa338cea8f1ee999ea8b37f8d0698169")
  780. (revision "1"))
  781. (package
  782. (name "translate2geda")
  783. (version (git-version "0" revision commit))
  784. (source (origin
  785. (method git-fetch)
  786. (uri (git-reference
  787. (url "https://github.com/erichVK5/translate2geda")
  788. (commit commit)))
  789. (file-name (git-file-name name version))
  790. (sha256
  791. (base32
  792. "1h062bbpw8nk0jamkya1k4lsgaia796jyviiz2gkdi6k1bxhwgpa"))))
  793. (build-system ant-build-system)
  794. (arguments
  795. `(#:tests? #f ; there are no tests
  796. #:jar-name "translate2geda.jar"
  797. #:source-dir "."
  798. #:main-class "translate2geda"
  799. #:phases
  800. (modify-phases %standard-phases
  801. (add-after 'install 'install-bin
  802. (lambda* (#:key inputs outputs #:allow-other-keys)
  803. (let* ((out (assoc-ref outputs "out"))
  804. (bin (string-append out "/bin"))
  805. (wrapper (string-append bin "/translate2geda")))
  806. (mkdir-p bin)
  807. (with-output-to-file wrapper
  808. (lambda _
  809. (format #t "#!/bin/sh~%exec ~a -jar ~a/share/java/translate2geda.jar"
  810. (which "java") out)))
  811. (chmod wrapper #o555))
  812. #t)))))
  813. (home-page "https://github.com/erichVK5/translate2geda")
  814. (synopsis "Utility for converting symbol and footprint formats to gEDA")
  815. (description
  816. "This package provides a utility for converting Kicad (@file{.mod},
  817. @file{.lib}), Eagle (@file{.lbr}), gerber (@file{.gbr}, etc..),
  818. BXL (@file{.bxl}), IBIS (@file{.ibs}), symdef, LT-Spice (@file{.asc}),
  819. QUCS (@file{.sch}), and BSDL (@file{.bsd}) symbols and footprints and EggBot
  820. fonts to gEDA.")
  821. (license license:gpl2+))))
  822. (define-public libfive
  823. (let ((commit "8ca1b8685ef3fac7b64e66b10459b8421a3020c6")
  824. (revision "4"))
  825. (package
  826. (name "libfive")
  827. (version (git-version "0" revision commit))
  828. (source (origin
  829. (method git-fetch)
  830. (uri (git-reference
  831. (url "https://github.com/libfive/libfive")
  832. (commit commit)))
  833. (sha256
  834. (base32
  835. "1c762cd70iv2b9av0l9lq0py9138y98wk3dirhdmil7jncdhvq98"))
  836. (file-name (git-file-name name version))))
  837. (build-system cmake-build-system)
  838. (arguments
  839. `(#:test-target "libfive-test"
  840. #:phases
  841. (modify-phases %standard-phases
  842. (add-after 'unpack 'remove-native-compilation
  843. (lambda _
  844. (substitute* "CMakeLists.txt" (("-march=native") ""))
  845. #t)))))
  846. (native-inputs
  847. (list pkg-config))
  848. (inputs
  849. (list boost libpng qtbase-5 eigen guile-3.0))
  850. (home-page "https://libfive.com")
  851. (synopsis "Tool for programmatic computer-aided design")
  852. (description
  853. "Libfive is a tool for programmatic computer-aided design (CAD). In
  854. libfive, solid models are defined as Scheme scripts, and there are no opaque
  855. function calls into the geometry kernel: everything is visible to the user.
  856. Even fundamental, primitive shapes are represented as code in the user-level
  857. language.")
  858. (license (list license:mpl2.0 ;library
  859. license:gpl2+)) ;Guile bindings and GUI
  860. ;; Mark as tunable to take advantage of SIMD code in Eigen.
  861. (properties '((tunable? . #t))))))
  862. (define-public inspekt3d
  863. (let ((commit "703f52ccbfedad2bf5240bf8183d1b573c9d54ef")
  864. (revision "0"))
  865. (package
  866. (name "inspekt3d")
  867. (version (git-version "0" revision commit))
  868. (source (origin
  869. (method git-fetch)
  870. (uri (git-reference
  871. (url "https://gitlab.com/kavalogic-inc/inspekt3d.git")
  872. (commit commit)))
  873. (file-name (git-file-name name version))
  874. (sha256
  875. (base32
  876. "0lan6930g5a9z4ack9jj0zdd0mb2s6q2xzpiwcjdc3pvl9b1nbw4"))
  877. (modules '((guix build utils)))
  878. (snippet
  879. '(begin
  880. ;; Allow builds with Guile 3.0.
  881. (substitute* "configure.ac"
  882. (("2\\.2") "3.0 2.2"))
  883. #t))))
  884. (build-system gnu-build-system)
  885. (arguments
  886. `(#:phases
  887. (modify-phases %standard-phases
  888. (add-after 'unpack 'patch-libfive-guile-location
  889. (lambda* (#:key inputs #:allow-other-keys)
  890. (substitute* "inspekt3d/library.scm"
  891. (("\"libfive-guile")
  892. (string-append "\""
  893. (assoc-ref inputs "libfive")
  894. "/lib/libfive-guile")))
  895. #t)))))
  896. (native-inputs
  897. (list autoconf automake pkg-config))
  898. (inputs
  899. (list mesa guile-3.0))
  900. (propagated-inputs
  901. `(("libfive" ,libfive)
  902. ("guile-opengl" ,guile3.0-opengl)))
  903. (home-page "https://gitlab.com/kavalogic-inc/inspekt3d/")
  904. (synopsis "Lightweight 3D viewer for Libfive written in Guile Scheme")
  905. (description
  906. "Inspekt3d is a lightweight 3D viewer for Libfive written in Guile Scheme.
  907. The viewer can be used interactively with a REPL (for example Geiser in
  908. Emacs).")
  909. (license license:gpl3+))))
  910. (define-public kicad
  911. (package
  912. (name "kicad")
  913. (version "6.0.1")
  914. (source (origin
  915. (method git-fetch)
  916. (uri (git-reference
  917. (url "https://gitlab.com/kicad/code/kicad.git")
  918. (commit version)))
  919. (sha256
  920. (base32
  921. "1vpcbhhw8844hm6vpk3kk405wak531pvcvcpc66z0b48iprk3imr"))
  922. (file-name (git-file-name name version))))
  923. (build-system cmake-build-system)
  924. (arguments
  925. `(#:out-of-source? #t
  926. #:tests? #f ;no tests
  927. #:build-type "Release"
  928. #:configure-flags
  929. ,#~(list "-DKICAD_SCRIPTING_PYTHON3=ON"
  930. (string-append "-DOCC_INCLUDE_DIR="
  931. #$(this-package-input "opencascade-occt")
  932. "/include/opencascade")
  933. "-DKICAD_SCRIPTING_WXPYTHON_PHOENIX=ON"
  934. "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE")
  935. #:phases
  936. (modify-phases %standard-phases
  937. (add-after 'unpack 'fix-ngspice-detection
  938. (lambda* (#:key inputs #:allow-other-keys)
  939. (substitute* "eeschema/CMakeLists.txt"
  940. (("NGSPICE_DLL_FILE=\"\\$\\{NGSPICE_DLL_FILE\\}\"")
  941. (string-append "NGSPICE_DLL_FILE=\""
  942. (assoc-ref inputs "libngspice")
  943. "/lib/libngspice.so\"")))))
  944. (add-after 'unpack 'fix-python-detection
  945. (lambda _
  946. (substitute* "CMakeModules/FindPythonLibs.cmake"
  947. (("_PYTHON3_VERSIONS 3\\.8 3\\.7")
  948. "_PYTHON3_VERSIONS 3.9 3.8 3.7"))))
  949. (add-after 'unpack 'add-missing-include
  950. (lambda _
  951. (substitute* "common/lib_tree_model.cpp"
  952. (("#include <eda_pattern_match.h>" all)
  953. (string-append "#include <algorithm>\n" all)))))
  954. (add-after 'install 'wrap-program
  955. ;; Ensure correct Python at runtime.
  956. (lambda* (#:key inputs outputs #:allow-other-keys)
  957. (let* ((out (assoc-ref outputs "out"))
  958. (python (assoc-ref inputs "python"))
  959. (file (string-append out "/bin/kicad"))
  960. (path (string-append out "/lib/python"
  961. ,(version-major+minor (package-version
  962. python))
  963. "/site-packages:"
  964. (getenv "GUIX_PYTHONPATH"))))
  965. (wrap-program file
  966. `("GUIX_PYTHONPATH" ":" prefix
  967. (,path))
  968. `("PATH" ":" prefix
  969. (,(string-append python "/bin:"))))))))))
  970. (native-search-paths
  971. (list (search-path-specification
  972. (variable "KICAD") ;to find kicad-doc
  973. (files '("")))
  974. (search-path-specification
  975. (variable "KICAD_TEMPLATE_DIR")
  976. (files '("share/kicad/template")))
  977. (search-path-specification
  978. (variable "KICAD_SYMBOL_DIR") ;symbol path
  979. (files '("share/kicad/library")))
  980. (search-path-specification
  981. (variable "KISYSMOD") ;footprint path
  982. (files '("share/kicad/modules")))
  983. (search-path-specification
  984. (variable "KISYS3DMOD") ;3D model path
  985. (files '("share/kicad/modules/packages3d")))))
  986. (native-inputs (list boost
  987. desktop-file-utils
  988. gettext-minimal
  989. pkg-config
  990. swig
  991. zlib))
  992. (inputs (list bash-minimal
  993. cairo
  994. curl
  995. glew
  996. glm
  997. hicolor-icon-theme
  998. libngspice
  999. libsm
  1000. mesa
  1001. opencascade-occt
  1002. openssl
  1003. python-wrapper
  1004. gtk+
  1005. wxwidgets
  1006. python-wxpython))
  1007. (home-page "https://www.kicad.org/")
  1008. (synopsis "Electronics Design Automation Suite")
  1009. (description
  1010. "Kicad is a program for the formation of printed circuit
  1011. boards and electrical circuits. The software has a number of programs that
  1012. perform specific functions, for example, pcbnew (Editing PCB), eeschema (editing
  1013. electrical diagrams), gerbview (viewing Gerber files) and others.")
  1014. (license license:gpl3+)))
  1015. (define-public kicad-doc
  1016. (package
  1017. (name "kicad-doc")
  1018. (version (package-version kicad))
  1019. (source (origin
  1020. (method git-fetch)
  1021. (uri (git-reference
  1022. (url "https://gitlab.com/kicad/services/kicad-doc.git")
  1023. (commit version)))
  1024. (file-name (git-file-name name version))
  1025. (sha256
  1026. (base32
  1027. "0zaafa9ckvdgsim6nhp3flj4r2fzzmwn054lc3iijwgga82qy7il"))))
  1028. (build-system cmake-build-system)
  1029. (arguments
  1030. `(#:configure-flags (list "-DBUILD_FORMATS=html")
  1031. #:tests? #f ;no test suite
  1032. #:phases
  1033. (modify-phases %standard-phases
  1034. (delete 'build))))
  1035. (native-inputs (list asciidoc
  1036. gettext-minimal
  1037. git-minimal
  1038. perl
  1039. perl-unicode-linebreak
  1040. perl-yaml-tiny
  1041. po4a
  1042. ruby-asciidoctor
  1043. source-highlight))
  1044. (home-page "https://kicad.org")
  1045. (synopsis "KiCad official documentation")
  1046. (description "This repository contains the official KiCad documentation.")
  1047. (license license:gpl3+)))
  1048. (define-public kicad-symbols
  1049. (package
  1050. (name "kicad-symbols")
  1051. (version (package-version kicad))
  1052. (source (origin
  1053. (method git-fetch)
  1054. (uri (git-reference
  1055. (url "https://gitlab.com/kicad/libraries/kicad-symbols.git")
  1056. (commit version)))
  1057. (file-name (git-file-name name version))
  1058. (sha256
  1059. (base32
  1060. "1azjx1bmxaz8bniyw75lq60mc8hvay00jn9qdc2zp7isy3c9ibp0"))))
  1061. (build-system cmake-build-system)
  1062. (arguments
  1063. `(#:tests? #f)) ; no tests exist
  1064. (home-page (package-home-page kicad))
  1065. (synopsis "Official KiCad schematic symbol libraries")
  1066. (description "This package contains the official KiCad schematic symbol
  1067. libraries.")
  1068. ;; TODO: Exception: "To the extent that the creation of electronic designs
  1069. ;; that use 'Licensed Material' can be considered to be 'Adapted Material',
  1070. ;; then the copyright holder waives article 3 of the license with respect to
  1071. ;; these designs and any generated files which use data provided as part of
  1072. ;; the 'Licensed Material'."
  1073. ;; See <https://github.com/KiCad/kicad-symbols/blob/master/LICENSE.md>.
  1074. (license license:cc-by-sa4.0)))
  1075. (define-public kicad-footprints
  1076. (package
  1077. (inherit kicad-symbols)
  1078. (name "kicad-footprints")
  1079. (version (package-version kicad))
  1080. (source (origin
  1081. (method git-fetch)
  1082. (uri (git-reference
  1083. (url "https://gitlab.com/kicad/libraries/kicad-footprints.git")
  1084. (commit version)))
  1085. (file-name (git-file-name name version))
  1086. (sha256
  1087. (base32
  1088. "0mv9xs0mmmfn0yhzx1v55r5app13ckagb16249rabyiz3v5crdpb"))))
  1089. (synopsis "Official KiCad footprint libraries")
  1090. (description "This package contains the official KiCad footprint libraries.")))
  1091. (define-public kicad-packages3d
  1092. (package
  1093. (inherit kicad-symbols)
  1094. (name "kicad-packages3d")
  1095. (version (package-version kicad))
  1096. (source (origin
  1097. (method git-fetch)
  1098. (uri (git-reference
  1099. (url "https://gitlab.com/kicad/libraries/kicad-packages3D.git")
  1100. (commit version)))
  1101. (file-name (git-file-name name version))
  1102. (sha256
  1103. (base32
  1104. "0vwcbzq42hzjl4f0zjaswmiff1x59hv64g5n00mx1gl0gwngnyla"))))
  1105. (synopsis "Official KiCad 3D model libraries")
  1106. (description "This package contains the official KiCad 3D model libraries.")))
  1107. (define-public kicad-templates
  1108. (package
  1109. (inherit kicad-symbols)
  1110. (name "kicad-templates")
  1111. (version (package-version kicad))
  1112. (source (origin
  1113. (method git-fetch)
  1114. (uri (git-reference
  1115. (url "https://gitlab.com/kicad/libraries/kicad-templates.git")
  1116. (commit version)))
  1117. (file-name (git-file-name name version))
  1118. (sha256
  1119. (base32
  1120. "13h9ly6amiwm7zkwa2fd9730kh295ls8j95fszlfjp9rczv2yyzm"))))
  1121. (synopsis "Official KiCad project and worksheet templates")
  1122. (description "This package contains the official KiCad project and
  1123. worksheet templates.")))
  1124. (define-public linsmith
  1125. (package
  1126. (name "linsmith")
  1127. (version "0.99.31")
  1128. (source (origin
  1129. (method url-fetch)
  1130. (uri (string-append
  1131. "mirror://sourceforge/linsmith/linsmith/linsmith-"
  1132. version "/linsmith-" version ".tar.gz"))
  1133. (sha256
  1134. (base32
  1135. "13qj7n9826qc9shkkgd1p6vcpj78v4h9d67wbg45prg7rbnzkzds"))))
  1136. (build-system gnu-build-system)
  1137. (arguments
  1138. '(#:configure-flags '("CFLAGS=-fcommon")))
  1139. (native-inputs
  1140. `(("pkg-config" ,pkg-config)
  1141. ("gtk" ,gtk+-2)
  1142. ("libgnome" ,libgnomeui)))
  1143. (home-page "https://jcoppens.com/soft/linsmith/index.en.php")
  1144. (synopsis "Smith Charting program")
  1145. (description "LinSmith is a Smith Charting program, mainly designed for
  1146. educational use. As such, there is an emphasis on capabilities that improve
  1147. the 'showing the effect of'-style of operation.")
  1148. (license license:gpl2+)))
  1149. (define-public valeronoi
  1150. (package
  1151. (name "valeronoi")
  1152. (version "0.1.6")
  1153. (source
  1154. (origin
  1155. (method git-fetch)
  1156. (uri
  1157. (git-reference
  1158. (url "https://github.com/ccoors/Valeronoi")
  1159. (commit (string-append "v" version))))
  1160. (file-name (git-file-name name version))
  1161. (sha256
  1162. (base32 "1hpyh4mmjnxgkij7a6rynk2ril5413nkdvf8syn0lqvrmibdg7wv"))))
  1163. (build-system cmake-build-system)
  1164. (arguments
  1165. `(#:phases
  1166. (modify-phases %standard-phases
  1167. (replace 'check
  1168. (lambda* (#:key tests? #:allow-other-keys)
  1169. (when tests?
  1170. (invoke "./valeronoi-tests")))))))
  1171. (inputs
  1172. (list boost
  1173. cgal
  1174. gmp
  1175. libxkbcommon
  1176. mpfr
  1177. openssl
  1178. qtbase-5
  1179. qtsvg))
  1180. (home-page "https://github.com/ccoors/Valeronoi")
  1181. (synopsis "WiFi mapping companion application for Valetudo")
  1182. (description
  1183. "Valeronoi (Valetudo + Voronoi) is a companion for Valetudo for generating
  1184. WiFi signal strength maps. It visualizes them using a Voronoi diagram.")
  1185. (license license:gpl3+)))
  1186. (define-public volk
  1187. (package
  1188. (name "volk")
  1189. (version "2.4.1")
  1190. (source
  1191. (origin
  1192. (method git-fetch)
  1193. (uri (git-reference
  1194. (url "https://github.com/gnuradio/volk")
  1195. (commit (string-append "v" version))
  1196. (recursive? #t))) ; for cpu_features git submodule
  1197. (file-name (git-file-name name version))
  1198. (sha256
  1199. (base32 "1mkqiw0i2fbbsk46zvk8yv5swl7ifhq6y1dlfphq8dsmkvxckqby"))))
  1200. (build-system cmake-build-system)
  1201. (arguments
  1202. `(#:phases
  1203. (modify-phases %standard-phases
  1204. (add-after 'install 'remove-static-libraries
  1205. ;; Remove libcpu_features.a (and any others that might appear).
  1206. (lambda* (#:key outputs #:allow-other-keys)
  1207. (let* ((out (assoc-ref outputs "out"))
  1208. (lib (string-append out "/lib")))
  1209. (for-each delete-file (find-files lib "\\.a$"
  1210. #:fail-on-error? #t))
  1211. #t)))
  1212. (add-after 'install 'wrap-pythonpath
  1213. (lambda* (#:key inputs outputs #:allow-other-keys)
  1214. (let* ((out (assoc-ref outputs "out"))
  1215. (python (assoc-ref inputs "python"))
  1216. (file (string-append out "/bin/volk_modtool"))
  1217. (path (string-append
  1218. out
  1219. "/lib/python"
  1220. ,(version-major+minor
  1221. (package-version python))
  1222. "/site-packages:"
  1223. (getenv "GUIX_PYTHONPATH"))))
  1224. (wrap-program file
  1225. `("GUIX_PYTHONPATH" ":" prefix (,path))
  1226. `("PATH" ":" prefix
  1227. (,(string-append python "/bin:")))))
  1228. #t)))))
  1229. (inputs
  1230. `(("boost" ,boost)
  1231. ("python" ,python-wrapper)
  1232. ("python-mako" ,python-mako)))
  1233. (home-page "https://www.libvolk.org/")
  1234. (synopsis "Vector-Optimized Library of Kernels")
  1235. (description
  1236. "@acronym{VOLK, Vector-Optimized Library of Kernels} contains procedures
  1237. with machine-specific optimizations for mathematical functions. It also
  1238. provides a machine-independent interface to select the best such procedures to
  1239. use on a given system.")
  1240. (license license:gpl3+)))
  1241. (define-public libredwg
  1242. (package
  1243. (name "libredwg")
  1244. (version "0.12.5")
  1245. (source
  1246. (origin
  1247. (method url-fetch)
  1248. (uri (string-append "mirror://gnu/libredwg/libredwg-"
  1249. version ".tar.xz"))
  1250. (sha256
  1251. (base32 "1gginbl76vmpccjwx93cmg8ibap8l40swly3bjv7rhmdwv6ikpnk"))))
  1252. (build-system gnu-build-system)
  1253. (arguments
  1254. `(#:configure-flags '("--disable-bindings")))
  1255. (native-inputs
  1256. (list libxml2
  1257. parallel
  1258. perl
  1259. pkg-config
  1260. python-wrapper
  1261. python-libxml2))
  1262. (inputs
  1263. (list pcre2))
  1264. (home-page "https://www.gnu.org/software/libredwg/")
  1265. (synopsis "C library to handle DWG (CAD-related) files")
  1266. (description
  1267. "GNU LibreDWG is a C library to handle DWG files. It aims to be a free
  1268. replacement for the OpenDWG libraries.")
  1269. (license license:gpl3+)))
  1270. (define-public minicom
  1271. (package
  1272. (name "minicom")
  1273. (version "2.8")
  1274. (source
  1275. (origin
  1276. (method git-fetch)
  1277. (uri (git-reference
  1278. (url "https://salsa.debian.org/minicom-team/minicom.git")
  1279. (commit (string-append "v" version))))
  1280. (sha256
  1281. (base32 "0kfihxbh9qkjk9m1932ajyqx384c2aj3d9yaphh3i9i7y1shxlpx"))
  1282. (file-name (git-file-name name version))))
  1283. (build-system gnu-build-system)
  1284. (arguments
  1285. `(#:configure-flags '("--enable-lock-dir=/var/lock")
  1286. #:phases
  1287. (modify-phases %standard-phases
  1288. (add-after 'unpack 'make-git-checkout-writable
  1289. (lambda _
  1290. (for-each make-file-writable (find-files "."))))
  1291. (replace 'bootstrap
  1292. ;; autogen.sh needlessly hard-codes aclocal-1.14.
  1293. (lambda _
  1294. (invoke "autoreconf" "-vif")
  1295. #t))
  1296. (add-before 'configure 'patch-lock-check
  1297. (lambda _
  1298. (substitute* "configure"
  1299. (("test -d [$]UUCPLOCK") "true"))
  1300. #t)))))
  1301. (native-inputs
  1302. `(("autoconf" ,autoconf)
  1303. ("automake" ,automake)
  1304. ("gettext" ,gettext-minimal)
  1305. ("pkg-config" ,pkg-config)))
  1306. (inputs
  1307. (list ncurses))
  1308. (home-page "https://salsa.debian.org/minicom-team/minicom")
  1309. (synopsis "Serial terminal emulator")
  1310. (description "@code{minicom} is a serial terminal emulator.")
  1311. (license license:gpl2+)))
  1312. (define-public sterm
  1313. (package
  1314. (name "sterm")
  1315. (version "20200306")
  1316. (source (origin
  1317. (method git-fetch)
  1318. (uri (git-reference
  1319. (url "https://github.com/wentasah/sterm")
  1320. (commit version)))
  1321. (file-name (git-file-name name version))
  1322. (sha256
  1323. (base32
  1324. "031pd8yz2bfzqbari6za1c3xcqmw94ap4vbrjzb3v6izjcrca58c"))))
  1325. (build-system gnu-build-system)
  1326. (arguments
  1327. `(#:tests? #f ; no tests
  1328. #:make-flags
  1329. (list (string-append "CC=" ,(cc-for-target))
  1330. (string-append "PREFIX=" %output))
  1331. #:phases
  1332. (modify-phases %standard-phases (delete 'configure))))
  1333. (synopsis "Simple serial terminal")
  1334. (description "This is a minimalist terminal program like minicom or cu.
  1335. The only thing it does is creating a bidirectional connection between
  1336. stdin/stdout and a terminal device (e.g. serial line).
  1337. It can also set serial line baudrate, manipulate DTR/RTS modem lines,
  1338. send break and throttle transmission speed.")
  1339. (home-page "https://github.com/wentasah/sterm")
  1340. (license license:gpl3+)))
  1341. (define-public harminv
  1342. (package
  1343. (name "harminv")
  1344. (version "1.4.1")
  1345. (source (origin
  1346. (method url-fetch)
  1347. (uri
  1348. (string-append "https://github.com/stevengj/harminv/"
  1349. "releases/download/v" version "/"
  1350. name "-" version ".tar.gz"))
  1351. (sha256
  1352. (base32
  1353. "0w1n4d249vlpda0hi6z1v13qp21vlbp3ykn0m8qg4rd5132j7fg1"))))
  1354. (build-system gnu-build-system)
  1355. (arguments
  1356. `(#:configure-flags '("--enable-shared")
  1357. #:phases
  1358. (modify-phases %standard-phases
  1359. (add-before 'configure 'fix-tests
  1360. (lambda _
  1361. (substitute* "./sines-test.sh"
  1362. ; change test frequency range - default fails
  1363. (("0\\.15") "0.16"))
  1364. #t)))))
  1365. (native-inputs
  1366. `(("fortran" ,gfortran)))
  1367. (inputs
  1368. (list lapack))
  1369. (home-page "https://github.com/stevengj/harminv")
  1370. (synopsis "Harmonic inversion solver")
  1371. (description
  1372. "Harminv is a free program (and accompanying library) to solve the problem of
  1373. harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
  1374. of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
  1375. determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
  1376. (license license:gpl2+)))
  1377. (define-public guile-libctl
  1378. (package
  1379. (name "guile-libctl")
  1380. (version "4.2.0")
  1381. (source (origin
  1382. (method url-fetch)
  1383. (uri
  1384. (string-append
  1385. "https://github.com/NanoComp/libctl/releases/download/v"
  1386. version "/libctl-" version ".tar.gz"))
  1387. (sha256
  1388. (base32
  1389. "0x8r56lpfq83kfbq28vr25icl19xpfd6fjrxzcpdmv30l9pash83"))))
  1390. (build-system gnu-build-system)
  1391. (arguments
  1392. `(#:configure-flags '("--enable-shared")))
  1393. (native-inputs
  1394. `(("fortran" ,gfortran)))
  1395. (inputs
  1396. (list guile-2.2))
  1397. (home-page "http://ab-initio.mit.edu/wiki/index.php/Libctl")
  1398. (synopsis "Flexible control files implementation for scientific simulations")
  1399. (description
  1400. "Libctl is a Guile-based library implementing flexible control files
  1401. for scientific simulations.")
  1402. (license license:gpl2+)))
  1403. (define-public mpb
  1404. (package
  1405. (name "mpb")
  1406. (version "1.8.0")
  1407. (source (origin
  1408. (method url-fetch)
  1409. (uri
  1410. (string-append
  1411. "https://github.com/NanoComp/mpb/releases/download/v"
  1412. version "/mpb-" version ".tar.gz"))
  1413. (sha256
  1414. (base32
  1415. "1jgrb7dd6qs6j6y1gnxmdgrh79l2bvqa6nk60a4pw1annsks4brd"))))
  1416. (build-system gnu-build-system)
  1417. (arguments
  1418. `(#:configure-flags
  1419. (list (string-append "--with-libctl="
  1420. (assoc-ref %build-inputs "libctl")
  1421. "/share/libctl")
  1422. "--enable-shared")))
  1423. (native-inputs
  1424. `(("fortran" ,gfortran)
  1425. ("pkg-config" ,pkg-config)
  1426. ("swig" ,swig)))
  1427. (inputs
  1428. `(("fftw" ,fftw)
  1429. ("gsl" ,gsl)
  1430. ("guile" ,guile-2.2)
  1431. ("hdf5" ,hdf5)
  1432. ("lapack" ,lapack)
  1433. ("libctl" ,guile-libctl)
  1434. ("readline" ,readline)
  1435. ("zlib" ,zlib)))
  1436. (home-page "http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands")
  1437. (synopsis "Computes band structures and electromagnetic modes of dielectric
  1438. structures")
  1439. (description
  1440. "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates (harmonic modes)
  1441. of Maxwell's equations in periodic dielectric structures for arbitrary wavevectors, using
  1442. fully-vectorial and three-dimensional methods.")
  1443. (license license:gpl2+)))
  1444. (define-public meep
  1445. (package
  1446. (name "meep")
  1447. (version "1.8.0")
  1448. (source (origin
  1449. (method url-fetch)
  1450. (uri
  1451. (string-append
  1452. "https://github.com/NanoComp/meep/releases/download/v"
  1453. version "/meep-" version ".tar.gz"))
  1454. (sha256
  1455. (base32
  1456. "14zyxmm3p80j5fz5b89sl7hgkgcisqjny5hjh4pi274ziqjqz8bm"))))
  1457. (build-system gnu-build-system)
  1458. (arguments
  1459. `(#:configure-flags
  1460. (list (string-append "--with-libctl="
  1461. (assoc-ref %build-inputs "libctl")
  1462. "/share/libctl"))))
  1463. (native-inputs
  1464. `(("fortran" ,gfortran)
  1465. ("pkg-config" ,pkg-config)
  1466. ("swig" ,swig)))
  1467. (inputs
  1468. `(("fftw" ,fftw)
  1469. ("gsl" ,gsl)
  1470. ("guile" ,guile-2.2)
  1471. ("harminv" ,harminv)
  1472. ("hdf5" ,hdf5)
  1473. ("lapack" ,lapack)
  1474. ("libctl" ,guile-libctl)
  1475. ("mpb" ,mpb)
  1476. ("zlib" ,zlib)))
  1477. (home-page "http://ab-initio.mit.edu/wiki/index.php/Meep")
  1478. (synopsis "Finite-difference time-domain (FDTD) simulation software")
  1479. (description
  1480. "Meep is a finite-difference time-domain (FDTD) simulation software package
  1481. developed at MIT to model electromagnetic systems.")
  1482. (license license:gpl2+)))
  1483. (define-public adms
  1484. (package
  1485. (name "adms")
  1486. (version "2.3.7")
  1487. (source (origin
  1488. (method git-fetch)
  1489. (uri (git-reference
  1490. (url "https://github.com/Qucs/ADMS")
  1491. (commit (string-append "release-" version))))
  1492. (file-name (git-file-name name version))
  1493. (sha256
  1494. (base32
  1495. "0i37c9k6q1iglmzp9736rrgsnx7sw8xn3djqbbjw29zsyl3pf62c"))))
  1496. (build-system gnu-build-system)
  1497. (native-inputs
  1498. (list autoconf
  1499. automake
  1500. bison
  1501. flex
  1502. libtool
  1503. perl
  1504. perl-xml-libxml))
  1505. (home-page "https://github.com/Qucs/ADMS")
  1506. (synopsis "Automatic device model synthesizer")
  1507. (description
  1508. "ADMS is a code generator that converts electrical compact device models
  1509. specified in high-level description language into ready-to-compile C code for
  1510. the API of spice simulators. Based on transformations specified in XML
  1511. language, ADMS transforms Verilog-AMS code into other target languages.")
  1512. (license license:gpl3)))
  1513. (define-public capstone
  1514. (package
  1515. (name "capstone")
  1516. (version "4.0.2")
  1517. (source (origin
  1518. (method git-fetch)
  1519. (uri (git-reference
  1520. (url "https://github.com/capstone-engine/capstone")
  1521. (commit version)))
  1522. (file-name (git-file-name name version))
  1523. (sha256
  1524. (base32
  1525. "0y5g74yjyliciawpn16zhdwya7bd3d7b1cccpcccc2wg8vni1k2w"))))
  1526. (build-system gnu-build-system)
  1527. (arguments
  1528. `(#:tests? #f
  1529. #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
  1530. "CC=gcc")
  1531. #:phases
  1532. (modify-phases %standard-phases
  1533. (delete 'configure) ; no configure script
  1534. ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
  1535. (add-before 'build 'fix-cstool-ldflags
  1536. (lambda* (#:key outputs #:allow-other-keys)
  1537. (setenv "LDFLAGS"
  1538. (string-append "-Wl,-rpath="
  1539. (assoc-ref outputs "out") "/lib")))))))
  1540. (home-page "https://github.com/capstone-engine/capstone")
  1541. (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
  1542. (description
  1543. "Capstone is a lightweight multi-platform, multi-architecture disassembly
  1544. framework. Capstone can disassemble machine code for many supported architectures
  1545. such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
  1546. bindings for Python, Java, OCaml and more.")
  1547. (license license:bsd-3)))
  1548. ;; FIXME: This package has a timestamp embedded in
  1549. ;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
  1550. (define-public python-capstone
  1551. (package
  1552. (inherit capstone)
  1553. (name "python-capstone")
  1554. (propagated-inputs
  1555. (list capstone))
  1556. (build-system python-build-system)
  1557. (arguments
  1558. `(#:phases
  1559. (modify-phases %standard-phases
  1560. (add-after 'unpack 'chdir-and-fix-setup-py
  1561. (lambda _
  1562. (chdir "bindings/python")
  1563. ;; Do not build the library again, because we already have it.
  1564. (substitute* "setup.py" ((".* build_libraries.*") ""))
  1565. ;; This substitution tells python-capstone where to find the
  1566. ;; library.
  1567. (substitute* "capstone/__init__.py"
  1568. (("pkg_resources.resource_filename.*")
  1569. (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
  1570. #t)))))))
  1571. (define-public python2-capstone
  1572. (package-with-python2 python-capstone))
  1573. (define-public python-esptool-3.0
  1574. (package
  1575. (name "python-esptool")
  1576. (version "3.0")
  1577. (source
  1578. (origin
  1579. (method url-fetch)
  1580. (uri (pypi-uri "esptool" version))
  1581. (sha256
  1582. (base32
  1583. "0d69rd9h8wrzjvfrc66vmz4qd5hly2fpdcwj2bdrlb7dbwikv5c7"))))
  1584. (build-system python-build-system)
  1585. (propagated-inputs
  1586. (list python-ecdsa python-pyaes python-pyserial python-reedsolo
  1587. python-cryptography python-bitstring))
  1588. (home-page "https://github.com/espressif/esptool")
  1589. (synopsis "Bootloader utility for Espressif ESP8266 & ESP32 chips")
  1590. (description
  1591. "@code{esptool.py} is a Python-based utility to communicate with the ROM
  1592. bootloader in Espressif ESP8266 & ESP32 series chips.")
  1593. (license license:gpl2+)))
  1594. (define-public radare2
  1595. (package
  1596. (name "radare2")
  1597. (version "5.1.1")
  1598. (source (origin
  1599. (method git-fetch)
  1600. (uri (git-reference
  1601. (url "https://github.com/radareorg/radare2")
  1602. (commit version)))
  1603. (sha256
  1604. (base32
  1605. "0hv9x31iabasj12g8f04incr1rbcdkxi3xnqn3ggp8gl4h6pf2f3"))
  1606. (file-name (git-file-name name version))))
  1607. (build-system gnu-build-system)
  1608. (arguments
  1609. '(#:tests? #f ; tests require git and network access
  1610. #:phases
  1611. (modify-phases %standard-phases
  1612. (add-before 'configure 'mklibdir
  1613. (lambda* (#:key inputs outputs #:allow-other-keys)
  1614. (mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
  1615. #t)))
  1616. #:configure-flags
  1617. (list "--with-openssl"
  1618. "--with-rpath"
  1619. "--with-syscapstone"
  1620. "--with-sysmagic"
  1621. "--with-syszip"
  1622. "--with-sysxxhash")
  1623. #:make-flags
  1624. (list "CC=gcc")))
  1625. ;; TODO: Add gmp and libzip and make the build system actually find them.
  1626. (inputs
  1627. (list capstone libuv openssl zip))
  1628. (native-inputs
  1629. (list pkg-config))
  1630. (propagated-inputs
  1631. ;; In the Libs: section of r_hash.pc.
  1632. (list xxhash))
  1633. (home-page "https://radare.org/")
  1634. (synopsis "Reverse engineering framework")
  1635. (description
  1636. "Radare2 is a complete framework for reverse-engineering, debugging, and
  1637. analyzing binaries. It is composed of a set of small utilities that can be
  1638. used together or independently from the command line.
  1639. Radare2 is built around a scriptable disassembler and hexadecimal editor that
  1640. support a variety of executable formats for different processors and operating
  1641. systems, through multiple back ends for local and remote files and disk
  1642. images.
  1643. It can also compare (@dfn{diff}) binaries with graphs and extract information
  1644. like relocation symbols. It is able to deal with malformed binaries, making
  1645. it suitable for security research and analysis.")
  1646. (license license:lgpl3)))
  1647. (define-public asco
  1648. (package
  1649. (name "asco")
  1650. (version "0.4.10")
  1651. (source (origin
  1652. (method url-fetch)
  1653. (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
  1654. version ".tar.gz"))
  1655. (sha256
  1656. (base32
  1657. "119rbc2dc8xzwxvykgji0v0nrzvymjmlizr1bc2mihspj686kxsl"))))
  1658. (build-system gnu-build-system)
  1659. (arguments
  1660. `(#:tests? #f ; no tests
  1661. #:make-flags '("all" "asco-mpi")
  1662. #:phases
  1663. (modify-phases %standard-phases
  1664. (delete 'configure)
  1665. (add-before 'build 'fix-paths
  1666. (lambda* (#:key inputs #:allow-other-keys)
  1667. (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
  1668. (substitute* '("errfunc.c" "asco.c")
  1669. (("cp ")
  1670. (string-append coreutils "/bin/cp "))
  1671. (("nice")
  1672. (string-append coreutils "/bin/nice")))
  1673. (substitute* "Makefile"
  1674. (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc")))
  1675. #t)))
  1676. (replace 'install ; no install target
  1677. (lambda* (#:key outputs #:allow-other-keys)
  1678. (for-each (lambda (file)
  1679. (install-file file (string-append
  1680. (assoc-ref outputs "out")
  1681. "/bin")))
  1682. '("asco" "asco-mpi" "asco-test"
  1683. "tools/alter/alter" "tools/log/log"))
  1684. #t)))))
  1685. (native-inputs
  1686. `(("mpi" ,openmpi)))
  1687. (inputs
  1688. (list coreutils-minimal))
  1689. (home-page "http://asco.sourceforge.net/")
  1690. (synopsis "SPICE circuit optimizer")
  1691. (description
  1692. "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
  1693. high-performance parallel differential evolution (DE) optimization algorithm.")
  1694. (license license:gpl2+)))
  1695. (define-public libngspice
  1696. ;; Note: The ngspice's build system does not allow us to build both the
  1697. ;; library and the executables in one go. Thus, we have two packages.
  1698. ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#236>.
  1699. (package
  1700. (name "libngspice")
  1701. (version "36")
  1702. (source
  1703. (origin
  1704. (method url-fetch)
  1705. (uri (list
  1706. (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
  1707. version "/ngspice-" version ".tar.gz")
  1708. (string-append "mirror://sourceforge/ngspice/ng-spice-rework/"
  1709. "old-releases/" version
  1710. "/ngspice-" version ".tar.gz")))
  1711. (sha256
  1712. (base32 "133za6m9grpnnlb46sijkda7ky41mrbvfdb60i0m695sxy3q50ag"))))
  1713. (build-system gnu-build-system)
  1714. (arguments
  1715. `(;; No tests for libngspice exist.
  1716. ;; The transient tests for ngspice fail.
  1717. #:tests? #f
  1718. #:phases
  1719. (modify-phases %standard-phases
  1720. (add-after 'unpack 'patch-timestamps
  1721. (lambda _
  1722. (substitute* "configure"
  1723. (("`date`") "Thu Jan 1 00:00:01 UTC 1970"))))
  1724. (add-after 'unpack 'delete-program-manuals
  1725. (lambda _
  1726. (substitute* "man/man1/Makefile.in"
  1727. (("^man_MANS = ngspice\\.1 ngnutmeg\\.1 ngsconvert\\.1 ngmultidec\\.1")
  1728. "man_MANS = "))))
  1729. (add-after 'install 'delete-scripts
  1730. (lambda* (#:key outputs #:allow-other-keys)
  1731. (delete-file-recursively
  1732. (string-append (assoc-ref outputs "out")
  1733. "/share/ngspice/scripts")))))
  1734. #:configure-flags
  1735. (list "--enable-openmp"
  1736. "--enable-ciderlib"
  1737. "--enable-xspice"
  1738. "--with-ngshared"
  1739. ;; Readline must be disabled to build KiCad with ngspice 34. See
  1740. ;; https://bugs.archlinux.org/task/70563 for reference.
  1741. "--with-readline=no")))
  1742. (native-inputs
  1743. (list bison flex))
  1744. (inputs
  1745. (list libxaw openmpi))
  1746. (home-page "http://ngspice.sourceforge.net/")
  1747. (synopsis "Mixed-level/mixed-signal circuit simulator")
  1748. (description
  1749. "Ngspice is a mixed-level/mixed-signal circuit simulator. It includes
  1750. @code{Spice3f5}, a circuit simulator, and @code{Xspice}, an extension that
  1751. provides code modeling support and simulation of digital components through
  1752. an embedded event driven algorithm.")
  1753. (license (list license:lgpl2.0+ ; code in frontend/numparam
  1754. (license:non-copyleft "file:///COPYING") ; spice3 bsd-style
  1755. license:bsd-3 ; ciderlib
  1756. license:public-domain)))) ; xspice
  1757. (define-public ngspice
  1758. ;; The ngspice executables (see libngpsice above.)
  1759. (package (inherit libngspice)
  1760. (name "ngspice")
  1761. (arguments
  1762. (substitute-keyword-arguments (package-arguments libngspice)
  1763. ((#:configure-flags flags)
  1764. `(delete "--with-ngshared" ,flags))
  1765. ((#:phases phases)
  1766. `(modify-phases ,phases
  1767. (add-after 'unpack 'delete-include-files
  1768. (lambda _
  1769. (substitute* "src/Makefile.in"
  1770. (("^SUBDIRS = misc maths frontend spicelib include/ngspice")
  1771. "SUBDIRS = misc maths frontend spicelib"))))
  1772. (delete 'delete-program-manuals)
  1773. (delete 'delete-script-files)))))
  1774. (inputs
  1775. (list libngspice readline))))
  1776. (define trilinos-serial-xyce
  1777. ;; Note: This is a Trilinos containing only the packages Xyce needs, so we
  1778. ;; keep it private. See
  1779. ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27344#248>.
  1780. ;; TODO: Remove when we have modular Trilinos packages?
  1781. (package
  1782. (name "trilinos-serial-xyce")
  1783. (version "12.12.1")
  1784. (source
  1785. (origin (method url-fetch)
  1786. (uri (string-append "https://trilinos.org/oldsite/download/files/trilinos-"
  1787. version "-Source.tar.gz"))
  1788. (sha256
  1789. (base32
  1790. "1zgrcksrcbmyy79mbdv0j4j4sh0chpigxk8vcrrwgaxyxwxxhrvw"))))
  1791. (build-system cmake-build-system)
  1792. (arguments
  1793. `(#:out-of-source? #t
  1794. #:phases
  1795. (modify-phases %standard-phases
  1796. ;; Delete unneeded tribits(build system) directory which makes validate-runpath
  1797. ;; phase to fail.
  1798. (add-before 'validate-runpath 'delete-tribits
  1799. (lambda* (#:key outputs #:allow-other-keys)
  1800. (delete-file-recursively
  1801. (string-append (assoc-ref outputs "out")
  1802. "/lib/cmake/tribits"))
  1803. #t)))
  1804. #:configure-flags
  1805. (list "-DCMAKE_CXX_FLAGS=-O3 -fPIC"
  1806. "-DCMAKE_C_FLAGS=-O3 -fPIC"
  1807. "-DCMAKE_Fortran_FLAGS=-O3 -fPIC"
  1808. "-DTrilinos_ENABLE_NOX=ON"
  1809. "-DNOX_ENABLE_LOCA=ON"
  1810. "-DTrilinos_ENABLE_EpetraExt=ON"
  1811. "-DEpetraExt_BUILD_BTF=ON"
  1812. "-DEpetraExt_BUILD_EXPERIMENTAL=ON"
  1813. "-DEpetraExt_BUILD_GRAPH_REORDERINGS=ON"
  1814. "-DTrilinos_ENABLE_TrilinosCouplings=ON"
  1815. "-DTrilinos_ENABLE_Ifpack=ON"
  1816. "-DTrilinos_ENABLE_Isorropia=ON"
  1817. "-DTrilinos_ENABLE_AztecOO=ON"
  1818. "-DTrilinos_ENABLE_Belos=ON"
  1819. "-DTrilinos_ENABLE_Teuchos=ON"
  1820. "-DTeuchos_ENABLE_COMPLEX=ON"
  1821. "-DTrilinos_ENABLE_Amesos=ON"
  1822. "-DAmesos_ENABLE_KLU=ON"
  1823. "-DAmesos_ENABLE_UMFPACK=ON"
  1824. "-DTrilinos_ENABLE_Sacado=ON"
  1825. "-DTrilinos_ENABLE_Kokkos=OFF"
  1826. "-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF"
  1827. "-DTPL_ENABLE_AMD=ON"
  1828. "-DTPL_ENABLE_UMFPACK=ON"
  1829. "-DTPL_ENABLE_BLAS=ON"
  1830. "-DTPL_ENABLE_LAPACK=ON")))
  1831. (native-inputs
  1832. `(("fortran" ,gfortran)
  1833. ("swig" ,swig)))
  1834. (inputs
  1835. `(("boost" ,boost)
  1836. ("lapack" ,lapack)
  1837. ("suitesparse" ,suitesparse)))
  1838. (home-page "https://trilinos.org")
  1839. (synopsis "Engineering and scientific problems algorithms")
  1840. (description
  1841. "The Trilinos Project is an effort to develop algorithms and enabling
  1842. technologies within an object-oriented software framework for the solution of
  1843. large-scale, complex multi-physics engineering and scientific problems. A
  1844. unique design feature of Trilinos is its focus on packages.")
  1845. (license (list license:lgpl2.1+
  1846. license:bsd-3))))
  1847. (define-public xyce-serial
  1848. (package
  1849. (name "xyce-serial")
  1850. (version "6.8")
  1851. (source
  1852. (origin (method url-fetch)
  1853. (uri (string-append "https://archive.org/download/Xyce-"
  1854. version "/Xyce-" version ".tar.gz"))
  1855. (sha256
  1856. (base32
  1857. "09flp1xywbb2laayd9rg8vd0fjsh115y6k1p71jacy0nrbdvvlcg"))))
  1858. (build-system gnu-build-system)
  1859. (arguments
  1860. `(#:tests? #f
  1861. #:configure-flags
  1862. (list
  1863. "CXXFLAGS=-O3"
  1864. (string-append "ARCHDIR="
  1865. (assoc-ref %build-inputs "trilinos")))))
  1866. (native-inputs
  1867. `(("bison" ,bison-3.0) ;'configure' fails with Bison 3.4
  1868. ("flex" ,flex)
  1869. ("fortran" ,gfortran)))
  1870. (inputs
  1871. `(("fftw" ,fftw)
  1872. ("suitesparse" ,suitesparse)
  1873. ("lapack" ,lapack)
  1874. ("trilinos" ,trilinos-serial-xyce)))
  1875. (home-page "https://xyce.sandia.gov/")
  1876. (synopsis "High-performance analog circuit simulator")
  1877. (description
  1878. "Xyce is a SPICE-compatible, high-performance analog circuit simulator,
  1879. capable of solving extremely large circuit problems by supporting large-scale
  1880. parallel computing platforms. It also supports serial execution.")
  1881. (license license:gpl3+)))
  1882. (define trilinos-parallel-xyce
  1883. (package (inherit trilinos-serial-xyce)
  1884. (name "trilinos-parallel-xyce")
  1885. (arguments
  1886. `(,@(substitute-keyword-arguments (package-arguments trilinos-serial-xyce)
  1887. ((#:configure-flags flags)
  1888. `(append (list "-DTrilinos_ENABLE_ShyLU=ON"
  1889. "-DTrilinos_ENABLE_Zoltan=ON"
  1890. "-DTPL_ENABLE_MPI=ON")
  1891. ,flags)))))
  1892. (inputs
  1893. `(("mpi" ,openmpi)
  1894. ,@(package-inputs trilinos-serial-xyce)))))
  1895. (define-public xyce-parallel
  1896. (package (inherit xyce-serial)
  1897. (name "xyce-parallel")
  1898. (arguments
  1899. `(,@(substitute-keyword-arguments (package-arguments xyce-serial)
  1900. ((#:configure-flags flags)
  1901. `(list "CXXFLAGS=-O3"
  1902. "CXX=mpiCC"
  1903. "CC=mpicc"
  1904. "F77=mpif77"
  1905. "--enable-mpi"
  1906. (string-append
  1907. "ARCHDIR="
  1908. (assoc-ref %build-inputs "trilinos")))))))
  1909. (propagated-inputs
  1910. `(("mpi" ,openmpi)))
  1911. (inputs
  1912. `(("trilinos" ,trilinos-parallel-xyce)
  1913. ,@(alist-delete "trilinos"
  1914. (package-inputs xyce-serial))))))
  1915. (define-public freehdl
  1916. (package
  1917. (name "freehdl")
  1918. (version "0.0.8")
  1919. (source (origin
  1920. (method url-fetch)
  1921. (uri (string-append "http://downloads.sourceforge.net/qucs/freehdl-"
  1922. version ".tar.gz"))
  1923. (sha256
  1924. (base32
  1925. "117dqs0d4pcgbzvr3jn5ppra7n7x2m6c161ywh6laa934pw7h2bz"))
  1926. (patches
  1927. (list (origin
  1928. ;; Fix build with GCC 7. Patch taken from Arch Linux:
  1929. ;; https://github.com/archlinux/svntogit-community/tree/packages/freehdl/trunk
  1930. (method url-fetch)
  1931. (uri (string-append "https://raw.githubusercontent.com"
  1932. "/archlinux/svntogit-community"
  1933. "/3bb90d64dfe6883e26083cd1fa96226d0d59175a"
  1934. "/trunk/build-fix.patch"))
  1935. (file-name "freehdl-c++-namespace.patch")
  1936. (sha256
  1937. (base32
  1938. "09df3c70rx81rnhlhry1wpdhji274nx9jb74rfprk06l4739zm08")))))))
  1939. (build-system gnu-build-system)
  1940. (arguments
  1941. `(#:phases
  1942. (modify-phases %standard-phases
  1943. (add-before 'configure 'patch-pkg-config
  1944. (lambda* (#:key inputs #:allow-other-keys)
  1945. (substitute* "freehdl/freehdl-config"
  1946. (("pkg-config")
  1947. (search-input-file inputs "/bin/pkg-config"))
  1948. (("cat")
  1949. (search-input-file inputs "/bin/cat")))))
  1950. (add-after 'patch-pkg-config 'setenv
  1951. (lambda* (#:key inputs #:allow-other-keys)
  1952. (setenv "CXX" (search-input-file inputs "/bin/g++"))
  1953. (setenv "SYSTEM_LIBTOOL"
  1954. (search-input-file inputs "/bin/libtool"))))
  1955. (add-after 'setenv 'patch-gvhdl
  1956. (lambda _
  1957. (substitute* "v2cc/gvhdl.in"
  1958. (("--mode=link") "--mode=link --tag=CXX")
  1959. (("-lm") "-lm FREEHDL/lib/freehdl/libieee.la"))
  1960. #t))
  1961. (add-after 'patch-gvhdl 'patch-freehdl-gennodes
  1962. (lambda* (#:key inputs #:allow-other-keys)
  1963. (substitute* "freehdl/freehdl-gennodes.in"
  1964. (("guile")
  1965. (search-input-file inputs "/bin/guile"))
  1966. (("\\(debug") ";(debug")
  1967. (("\\(@ ") "(apply-emit")
  1968. (("\\(@@ ") "(apply-mini-format"))
  1969. #t))
  1970. (add-after 'configure 'patch-freehdl-pc
  1971. (lambda* (#:key inputs #:allow-other-keys)
  1972. (substitute* "freehdl.pc"
  1973. (("=g\\+\\+")
  1974. (string-append "=" (assoc-ref inputs "gcc-toolchain")
  1975. "/bin/g++"))
  1976. (("=libtool")
  1977. (string-append "=" (assoc-ref inputs "libtool")
  1978. "/bin/libtool")))
  1979. #t))
  1980. (add-after 'install-scripts 'make-wrapper
  1981. (lambda* (#:key inputs outputs #:allow-other-keys)
  1982. (let ((out (assoc-ref outputs "out")))
  1983. ;; 'gvhdl' invokes the C compiler directly, so hard-code its
  1984. ;; file name.
  1985. (wrap-program (string-append out "/bin/gvhdl")
  1986. `("CPLUS_INCLUDE_PATH" ":" prefix
  1987. (,(string-append (assoc-ref inputs "gcc-toolchain")
  1988. "/include")))
  1989. `("LIBRARY_PATH" ":" prefix
  1990. (,(string-append (assoc-ref inputs "gcc-toolchain")
  1991. "/lib")))
  1992. `("PATH" ":" prefix
  1993. (,(string-append (assoc-ref inputs "gcc-toolchain")
  1994. "/bin")
  1995. ,(string-append (assoc-ref inputs "coreutils")
  1996. "/bin"))))
  1997. (wrap-program (string-append out "/bin/freehdl-config")
  1998. `("PKG_CONFIG_PATH" ":" prefix (,(string-append out "/lib/pkgconfig")))))
  1999. #t)))))
  2000. (inputs
  2001. (list coreutils
  2002. gcc-toolchain
  2003. guile-2.2
  2004. perl
  2005. pkg-config
  2006. libtool))
  2007. (native-inputs
  2008. `(("pkg-config-native" ,pkg-config)
  2009. ("libtool-native" ,libtool)))
  2010. (home-page "http://www.freehdl.seul.org/")
  2011. (synopsis "VHDL simulator")
  2012. (description
  2013. "FreeHDL is a compiler/simulator suite for the hardware description language VHDL.
  2014. VHDL'93 as well as VHDL'87 standards are supported.")
  2015. (license (list license:gpl2+
  2016. license:lgpl2.0+)))) ; freehdl's libraries
  2017. (define-public librepcb
  2018. (package
  2019. (name "librepcb")
  2020. (version "0.1.5")
  2021. (source
  2022. (origin
  2023. (method url-fetch)
  2024. (uri (string-append "https://download.librepcb.org/releases/"
  2025. version "/librepcb-" version "-source.zip"))
  2026. (sha256
  2027. (base32 "0smp1p7wnrj0vh4rmz1cr2krfawc2lzx0pbzmgyay7xdp6jxympr"))))
  2028. (build-system gnu-build-system)
  2029. (inputs
  2030. (list qtbase-5 qtsvg zlib))
  2031. (native-inputs
  2032. (list qttools ; for lrelease
  2033. unzip))
  2034. (arguments
  2035. `(#:phases
  2036. (modify-phases %standard-phases
  2037. (replace 'configure
  2038. (lambda* (#:key inputs outputs #:allow-other-keys)
  2039. (mkdir-p "build")
  2040. (chdir "build")
  2041. (let ((lrelease (search-input-file inputs "/bin/lrelease"))
  2042. (out (assoc-ref outputs "out")))
  2043. (invoke "qmake"
  2044. (string-append "QMAKE_LRELEASE=" lrelease)
  2045. (string-append "PREFIX=" out)
  2046. "../librepcb.pro")))))))
  2047. (home-page "https://librepcb.org/")
  2048. (synopsis "Electronic Design Automation tool")
  2049. (description "LibrePCB is @dfn{Electronic Design Automation} (EDA)
  2050. software to develop printed circuit boards. It features human readable file
  2051. formats and complete project management with library, schematic and board
  2052. editors.")
  2053. (license (list license:gpl3+
  2054. license:boost1.0 ; libs/clipper,
  2055. ; libs/optional/tests/catch.hpp,
  2056. ; libs/sexpresso/tests/catch.hpp
  2057. license:expat ; libs/delaunay-triangulation,
  2058. ; libs/parseagle, libs/type_safe
  2059. license:asl2.0 ; libs/fontobene, libs/googletest,
  2060. ; libs/parseagle
  2061. license:isc ; libs/hoedown
  2062. license:cc0 ; libs/optional, libs/sexpresso
  2063. license:bsd-2 ; libs/optional/tests/catch.hpp
  2064. license:lgpl2.1+)))) ; libs/quazip
  2065. (define-public gpx
  2066. (package
  2067. (name "gpx")
  2068. (version "2.5.2")
  2069. (source (origin
  2070. (method git-fetch)
  2071. (uri (git-reference
  2072. (url "https://github.com/markwal/GPX")
  2073. (commit version)))
  2074. (file-name (git-file-name name version))
  2075. (sha256
  2076. (base32
  2077. "1yab269x8qyf7rd04vaxyqyjv4pzz9lp4sc4dwh927k23avr3rw5"))))
  2078. (build-system gnu-build-system)
  2079. (home-page "https://github.com/markwal/GPX")
  2080. (synopsis "Converting gcode to x3g files for 3D printing")
  2081. (description
  2082. "GPX is a post processing utility for converting gcode output from 3D
  2083. slicing software to x3g files for standalone 3D printing on common 3D
  2084. printers.")
  2085. (license license:gpl2+)))
  2086. (define-public gnucap
  2087. (package
  2088. (name "gnucap")
  2089. (version "20171003")
  2090. (source
  2091. (origin
  2092. (method url-fetch)
  2093. (uri (string-append "https://git.savannah.gnu.org/cgit/gnucap.git/snapshot/gnucap-"
  2094. version ".tar.gz"))
  2095. (sha256
  2096. (base32
  2097. "16m09xa685qhj5fqq3bcgakrwnb74xhf5f7rpqkkf9fg8plzbb1g"))))
  2098. (build-system gnu-build-system)
  2099. (inputs
  2100. (list readline))
  2101. (arguments
  2102. `(#:phases
  2103. (modify-phases %standard-phases
  2104. (replace 'configure
  2105. (lambda* (#:key outputs #:allow-other-keys)
  2106. (let ((out (assoc-ref outputs "out")))
  2107. ;; Set correct rpath so that gnucap finds libgnucap.so.
  2108. (substitute* (list "apps/configure" "lib/configure"
  2109. "main/configure" "modelgen/configure")
  2110. (("LDFLAGS =")
  2111. (string-append "LDFLAGS = -Wl,-rpath=" out "/lib")))
  2112. ;; gnucap uses a hand-written configure script that expects the
  2113. ;; --prefix argument to be the first argument passed to it.
  2114. (invoke "./configure" (string-append "--prefix=" out)))))
  2115. (replace 'check
  2116. (lambda* (#:key outputs #:allow-other-keys)
  2117. (let ((out (assoc-ref outputs "out"))
  2118. (libpath "../lib/O:../apps/O"))
  2119. (with-directory-excursion "tests"
  2120. ;; Make test return non-zero exit code when a test fails.
  2121. (substitute* "test"
  2122. (("/bin/sh") "/bin/sh -e")
  2123. (("\\|\\| echo \"\\*\\*\\*\\* \\$ii fails \\*\\*\\*\\*\"") ""))
  2124. ;; Fix expected plugin search path for test c_attach.1.gc
  2125. (substitute* "==out/c_attach.1.gc.out"
  2126. (("/usr/local/lib/gnucap")
  2127. (string-append libpath ":" out "/lib/gnucap")))
  2128. ;; Set library path so that gnucap can find libgnucap.so
  2129. ;; while running the tests.
  2130. (setenv "LD_LIBRARY_PATH" libpath)
  2131. (invoke "./test" "../main/O/gnucap" "" "test-output" "==out"))))))))
  2132. (home-page "https://www.gnu.org/software/gnucap/")
  2133. (synopsis "Mixed analog and digital circuit simulator")
  2134. (description "GNUcap is a circuit analysis package. It offers a general
  2135. purpose circuit simulator and can perform DC and transient analyses, fourier
  2136. analysis and AC analysis. The engine is designed to do true mixed-mode
  2137. simulation.")
  2138. (license license:gpl3+)))
  2139. (define-public radare2-for-cutter
  2140. (package
  2141. (inherit radare2)
  2142. (name "radare2")
  2143. (version "5.0.0")
  2144. (source (origin
  2145. (method git-fetch)
  2146. (uri (git-reference
  2147. (url "https://github.com/radareorg/radare2")
  2148. (commit version)))
  2149. (sha256
  2150. (base32
  2151. "0aa7c27kd0l55fy5qfvxqmakp4pz6240v3hn84095qmqkzcbs420"))
  2152. (file-name (git-file-name name version))))))
  2153. (define-public cutter
  2154. (package
  2155. (name "cutter")
  2156. (version "1.12.0")
  2157. (source
  2158. (origin
  2159. (method git-fetch)
  2160. (uri (git-reference
  2161. (url "https://github.com/radareorg/cutter")
  2162. (commit (string-append "v" version))))
  2163. (file-name (git-file-name name version))
  2164. (sha256
  2165. (base32 "0ljj3j3apbbw628n2nyrxpbnclixx20bqjxm0xwggqzz9vywsar0"))))
  2166. (build-system gnu-build-system)
  2167. (arguments
  2168. `(#:phases
  2169. (modify-phases %standard-phases
  2170. (replace 'configure
  2171. (lambda* (#:key inputs outputs #:allow-other-keys)
  2172. (let ((out (assoc-ref outputs "out"))
  2173. (radare2 (assoc-ref inputs "radare2")))
  2174. ;; Fix pkg-config detection ./src/lib_radare2.pri:PREFIX=/usr/lib
  2175. ;; override `qmake PREFIX=`.
  2176. (substitute* "./src/lib_radare2.pri"
  2177. (("PREFIX") "R2PREFIX")
  2178. (("R2PREFIX=/usr") (string-append "R2PREFIX=" radare2)))
  2179. (invoke "qmake"
  2180. (string-append "PREFIX=" out)
  2181. "./src/Cutter.pro")))))))
  2182. (native-inputs
  2183. (list pkg-config))
  2184. (inputs
  2185. (list qtbase-5
  2186. qtsvg
  2187. openssl
  2188. ;; Depends on radare2 4.5.1 officially, builds and works fine with
  2189. ;; radare2 5.0.0 but fails to build with radare2 5.1.1.
  2190. radare2-for-cutter))
  2191. (home-page "https://github.com/radareorg/cutter")
  2192. (synopsis "GUI for radare2 reverse engineering framework")
  2193. (description "Cutter is a GUI for radare2 reverse engineering framework.
  2194. Its goal is making an advanced andcustomizable reverse-engineering platform
  2195. while keeping the user experience at mind. Cutter is created by reverse
  2196. engineers for reverse engineers.")
  2197. (license (list license:cc-by-sa3.0 ;the "Iconic" icon set
  2198. license:gpl3+)))) ;everything else
  2199. (define-public lib3mf
  2200. (package
  2201. (name "lib3mf")
  2202. (version "2.1.1")
  2203. (source
  2204. (origin
  2205. (method git-fetch)
  2206. (uri (git-reference (url "https://github.com/3MFConsortium/lib3mf")
  2207. (commit (string-append "v" version))))
  2208. (file-name (git-file-name name version))
  2209. (sha256
  2210. (base32
  2211. "1417xlxc1y5jnipixhbjfrrjgkrprbbraj8647sff9051m3hpxc3"))))
  2212. (build-system cmake-build-system)
  2213. (arguments
  2214. `(#:configure-flags (list "-DUSE_INCLUDED_ZLIB=0"
  2215. "-DUSE_INCLUDED_LIBZIP=0"
  2216. "-DUSE_INCLUDED_GTEST=0"
  2217. "-DUSE_INCLUDED_SSL=0")))
  2218. (native-inputs
  2219. (list googletest pkg-config))
  2220. (inputs
  2221. `(("libuuid" ,util-linux "lib")
  2222. ("libzip" ,libzip)
  2223. ("libressl" ,libressl)
  2224. ("zlib" ,zlib)))
  2225. (synopsis "Implementation of the 3D Manufacturing Format (3MF) file standard")
  2226. (description
  2227. "Lib3MF is a C++ implementation of the 3D Manufacturing Format (3MF) file
  2228. standard. It offers a way to integrate 3MF reading and writing capabilities, as
  2229. well as conversion and validation tools for input and output data. The
  2230. specification can be downloaded at @url{http://3mf.io/specification/}.")
  2231. (home-page "https://3mf.io/")
  2232. (license license:bsd-2)))
  2233. (define-public openscad
  2234. (package
  2235. (name "openscad")
  2236. (version "2021.01")
  2237. (source
  2238. (origin
  2239. (method url-fetch)
  2240. (uri (string-append "https://files.openscad.org/openscad-" version
  2241. ".src.tar.gz"))
  2242. (sha256
  2243. (base32
  2244. "0n83szr88h8snccjrslr96mgw3f65x3sq726n6x5vxp5wybw4f6r"))))
  2245. (build-system cmake-build-system)
  2246. (inputs
  2247. `(("boost" ,boost)
  2248. ("cgal" ,cgal)
  2249. ("double-conversion" ,double-conversion)
  2250. ("eigen" ,eigen)
  2251. ("fontconfig" ,fontconfig)
  2252. ("glew" ,glew)
  2253. ("gmp" ,gmp)
  2254. ("harfbuzz" ,harfbuzz)
  2255. ("lib3mf" ,lib3mf)
  2256. ("libxml2" ,libxml2)
  2257. ("libzip" ,libzip)
  2258. ("mpfr" ,mpfr)
  2259. ("opencsg" ,opencsg)
  2260. ("qscintilla" ,qscintilla)
  2261. ("qtbase" ,qtbase-5)
  2262. ("qtmultimedia" ,qtmultimedia)))
  2263. (native-inputs
  2264. `(("bison" ,bison)
  2265. ("flex" ,flex)
  2266. ("gettext" ,gettext-minimal)
  2267. ("pkg-config" ,pkg-config)
  2268. ("which" ,which)
  2269. ;; the following are only needed for tests
  2270. ("imagemagick" ,imagemagick)
  2271. ("ps" ,procps)
  2272. ("python" ,python)
  2273. ("xvfb" ,xorg-server-for-tests)))
  2274. (arguments
  2275. `(#:phases
  2276. (modify-phases %standard-phases
  2277. (replace 'configure
  2278. (lambda* (#:key outputs #:allow-other-keys)
  2279. (invoke "qmake"
  2280. (string-append "PREFIX=" (assoc-ref outputs "out")))
  2281. #t))
  2282. (replace 'check
  2283. (lambda _
  2284. (with-directory-excursion "tests"
  2285. (invoke "cmake" ".")
  2286. (invoke "make")
  2287. (invoke "ctest" "--exclude-regex"
  2288. (string-join
  2289. (list
  2290. "astdumptest_allexpressions"
  2291. "echotest_function-literal-compare"
  2292. "echotest_function-literal-tests"
  2293. "echotest_allexpressions"
  2294. "lazyunion-*"
  2295. "pdfexporttest_centered"
  2296. "pdfexporttest_simple-pdf"
  2297. ;; Broken due since cgal@5.2 +
  2298. ;; https://github.com/CGAL/cgal/pull/5371 (security)
  2299. ;; FIXME: Investigate or wait for future releases to
  2300. ;; fix it.
  2301. ;; Unsure if wrong test-suite or wrong security
  2302. ;; patch.
  2303. "cgalpngtest_nef3_broken"
  2304. "opencsgtest_nef3_broken"
  2305. "csgpngtest_nef3_broken"
  2306. "throwntogethertest_nef3_broken")
  2307. "|")))
  2308. ;; strip python test files since lib dir ends up in out/share
  2309. (for-each delete-file
  2310. (find-files "libraries/MCAD" ".*\\.py"))
  2311. #t)))))
  2312. (synopsis "Script-based 3D modeling application")
  2313. (description
  2314. "OpenSCAD is a 3D Computer-aided Design (CAD) application. Unlike an
  2315. interactive modeler, OpenSCAD generates 3D models from a script, giving you
  2316. full programmatic control over your models.")
  2317. (home-page "https://www.openscad.org/")
  2318. (license license:gpl2+)))
  2319. (define-public emacs-scad-mode
  2320. (package
  2321. (inherit openscad)
  2322. (name "emacs-scad-mode")
  2323. (native-inputs '())
  2324. (inputs '())
  2325. (build-system emacs-build-system)
  2326. (arguments
  2327. `(#:phases
  2328. (modify-phases %standard-phases
  2329. (add-after 'unpack 'chdir-elisp
  2330. ;; Elisp directory is not in root of the source.
  2331. (lambda _
  2332. (chdir "contrib")
  2333. #t)))))
  2334. (synopsis "Emacs major mode for editing editing OpenSCAD code")
  2335. (description "@code{scad-mode} provides an Emacs major mode for editing
  2336. OpenSCAD code. It supports syntax highlighting, indenting and refilling of
  2337. comments.")))
  2338. (define-public freecad
  2339. ;; FIXME: We use a commit directly because upstream has compatibility fixes
  2340. ;; that are not in a release yet for boost, opencascade-occt-7.6 and vtk-9.
  2341. ;; Switch back to a regular version (probably 0.20) when it is released.
  2342. (let ((commit "09a05a9cd0c4692a57a3e038268b4389b4657fc6")
  2343. (revision "0"))
  2344. (package
  2345. (name "freecad")
  2346. (version (git-version "0.19.3" revision commit))
  2347. (source
  2348. (origin
  2349. (method git-fetch)
  2350. (uri (git-reference
  2351. (url "https://github.com/FreeCAD/FreeCAD")
  2352. (commit commit)))
  2353. (file-name (git-file-name name version))
  2354. (sha256
  2355. (base32 "0818basym0n44dsgix0yv1l00xgv9igrr7wkszd8x74lh1rr591r"))))
  2356. (build-system qt-build-system)
  2357. (native-inputs
  2358. (list doxygen
  2359. graphviz
  2360. qttools
  2361. pkg-config
  2362. python-pyside-2-tools
  2363. swig))
  2364. (inputs
  2365. (list boost
  2366. coin3D
  2367. double-conversion
  2368. eigen
  2369. freetype
  2370. gl2ps
  2371. glew
  2372. hdf5-1.10
  2373. jsoncpp
  2374. libarea
  2375. libjpeg-turbo
  2376. libmedfile
  2377. libspnav
  2378. libtheora
  2379. libtiff
  2380. libxi
  2381. libxml++
  2382. libxmu
  2383. lz4
  2384. netcdf
  2385. opencascade-occt
  2386. openmpi
  2387. proj
  2388. python-gitpython
  2389. python-matplotlib
  2390. python-pivy
  2391. python-ply
  2392. python-pyside-2
  2393. python-pyyaml
  2394. python-shiboken-2
  2395. python-wrapper
  2396. qtbase-5
  2397. qtdeclarative
  2398. qtsvg
  2399. qtwebchannel
  2400. qtwebengine
  2401. qtx11extras
  2402. qtxmlpatterns
  2403. sqlite
  2404. tbb-2020 ; Same version as opencascade-occt
  2405. vtk
  2406. xerces-c
  2407. zlib))
  2408. (arguments
  2409. `(#:tests? #f ; Project has no tests
  2410. #:configure-flags
  2411. ,#~(list
  2412. "-DBUILD_QT5=ON"
  2413. "-DBUILD_FLAT_MESH:BOOL=ON"
  2414. "-DBUILD_ENABLE_CXX_STD:STRING=C++17"
  2415. (string-append "-DCMAKE_INSTALL_LIBDIR=" #$output "/lib"))
  2416. #:phases
  2417. (modify-phases %standard-phases
  2418. (add-before 'configure 'restore-pythonpath
  2419. (lambda _
  2420. (substitute* "src/Main/MainGui.cpp"
  2421. (("_?putenv\\(\"PYTHONPATH=\"\\);") ""))))
  2422. (add-after 'install 'wrap-pythonpath
  2423. (lambda* (#:key outputs #:allow-other-keys)
  2424. (let ((out (assoc-ref outputs "out")))
  2425. (wrap-program (string-append out "/bin/FreeCAD")
  2426. (list "GUIX_PYTHONPATH"
  2427. 'prefix (list (getenv "GUIX_PYTHONPATH"))))))))))
  2428. (home-page "https://www.freecadweb.org/")
  2429. (synopsis "Your Own 3D Parametric Modeler")
  2430. (description
  2431. "FreeCAD is a general purpose feature-based, parametric 3D modeler for
  2432. CAD, MCAD, CAx, CAE and PLM, aimed directly at mechanical engineering and
  2433. product design but also fits a wider range of uses in engineering, such as
  2434. architecture or other engineering specialties. It is 100% Open Source (LGPL2+
  2435. license) and extremely modular, allowing for very advanced extension and
  2436. customization.")
  2437. (license
  2438. (list
  2439. license:lgpl2.1+
  2440. license:lgpl2.0+
  2441. license:gpl3+
  2442. license:bsd-3)))))
  2443. (define-public libmedfile
  2444. (package
  2445. (name "libmedfile")
  2446. (version "4.0.0")
  2447. (source
  2448. (origin
  2449. (method url-fetch)
  2450. (uri (string-append
  2451. "https://files.salome-platform.org/Salome/other/med-"
  2452. version ".tar.gz"))
  2453. (sha256
  2454. (base32
  2455. "017h9p0x533fm4gn6pwc8kmp72rvqmcn6vznx72nkkl2b05yjx54"))))
  2456. (build-system cmake-build-system)
  2457. (inputs (list hdf5-1.10))
  2458. (arguments
  2459. `(#:phases
  2460. (modify-phases %standard-phases
  2461. (add-after 'install 'remove-test-output
  2462. (lambda* (#:key outputs #:allow-other-keys)
  2463. (let ((out (assoc-ref outputs "out")))
  2464. (delete-file-recursively
  2465. (string-append out "/bin/testc"))
  2466. #t))))))
  2467. (home-page "https://www.salome-platform.org")
  2468. (synopsis "Library to read and write MED files")
  2469. (description
  2470. "The purpose of the MED module is to provide a standard for storing and
  2471. recovering computer data associated to numerical meshes and fields, and to
  2472. facilitate the exchange between codes and solvers.
  2473. The persistent data storage is based upon HDF format (like CGNS, a standard
  2474. developed by Boeing and NASA in the area of Computational Fluid Dynamic).
  2475. MED also provides structures to hold data on meshes and fields. These
  2476. structures are exchanged between solvers, hide the communication level (CORBA
  2477. or MPI), and offer persistence (read/write in .med files).
  2478. The main benefit of a common exchange format is reduced complexity of code
  2479. coupling. It also allows sharing such high level functionalities as
  2480. computation of nodal connectivity of sub-elements (faces and edges),
  2481. arithmetic operations on fields, entity location functionalities, and
  2482. interpolation toolkit.")
  2483. (license license:gpl3+)))
  2484. (define-public libarea
  2485. (let ((revision "1")
  2486. (commit "8f8bac811c10f1f01fda0d742a18591f61dd76ee"))
  2487. (package
  2488. (name "libarea")
  2489. (version (git-version "0" revision commit))
  2490. (source
  2491. (origin
  2492. (method git-fetch)
  2493. (uri (git-reference (url "https://github.com/Heeks/libarea")
  2494. (commit commit)))
  2495. (file-name (git-file-name name version))
  2496. (sha256
  2497. (base32 "0pvqz6cabxqdz5y26wnj6alkn8v5d7gkx0d3h8xmg4lvy9r3kh3g"))))
  2498. (build-system gnu-build-system)
  2499. (inputs (list boost python-wrapper))
  2500. (native-inputs
  2501. `(("cmake" ,cmake-minimal)))
  2502. (arguments
  2503. `(#:tests? #f
  2504. #:phases
  2505. (modify-phases %standard-phases
  2506. (add-after 'configure 'cmake-configure
  2507. (lambda* (#:key inputs outputs #:allow-other-keys)
  2508. (let ((out (assoc-ref outputs "out"))
  2509. (cmake (assoc-ref inputs "cmake")))
  2510. (mkdir-p "build")
  2511. (invoke "cmake"
  2512. (string-append "-DCMAKE_INSTALL_PREFIX=" out)))))
  2513. (delete 'configure))))
  2514. (home-page "https://github.com/Heeks/libarea")
  2515. (synopsis
  2516. "Library and python module for pocketing and profiling operations")
  2517. (description
  2518. "Area is a CAM-related software for pocketing operation.
  2519. This project provides library and associated python-module to compute pocket
  2520. operations.")
  2521. (license (list
  2522. license:bsd-3
  2523. license:gpl3+)))))
  2524. (define-public libspnav
  2525. (package
  2526. (name "libspnav")
  2527. (version "0.2.3")
  2528. (source (origin
  2529. (method git-fetch)
  2530. (uri (git-reference
  2531. (url "https://github.com/FreeSpacenav/libspnav")
  2532. (commit (string-append "libspnav-" version))))
  2533. (sha256
  2534. (base32
  2535. "098h1jhlj87axpza5zgy58prp0zn94wyrbch6x0s7q4mzh7dc8ba"))
  2536. (file-name (git-file-name name version))))
  2537. (build-system gnu-build-system)
  2538. (inputs
  2539. (list libx11))
  2540. (arguments `(#:tests? #f))
  2541. (home-page "http://spacenav.sourceforge.net/")
  2542. (synopsis
  2543. "Library for communicating with spacenavd or 3dxsrv")
  2544. (description
  2545. "The libspnav library is provided as a replacement of the magellan
  2546. library. It provides a cleaner, and more orthogonal interface. libspnav
  2547. supports both the original X11 protocol for communicating with the driver, and
  2548. the new alternative non-X protocol. Programs that choose to use the X11
  2549. protocol, are automatically compatible with either the free spacenavd driver
  2550. or the official 3dxserv, as if they were using the magellan SDK.
  2551. Also, libspnav provides a magellan API wrapper on top of the new API. So, any
  2552. applications that were using the magellan library, can switch to libspnav
  2553. without any changes. And programmers that are familiar with the magellan API
  2554. can continue using it with a free library without the restrictions of the
  2555. official SDK.")
  2556. (license license:bsd-3)))
  2557. (define-public openctm
  2558. (let ((revision 603))
  2559. ;; Previous versions don't compile, they need to link libGL and libGLU.
  2560. ;; Fixed in this revision.
  2561. (package
  2562. (name "openctm")
  2563. (version (string-append "1.0.3." (number->string revision)))
  2564. (source
  2565. (origin
  2566. (method svn-fetch)
  2567. (uri (svn-reference
  2568. (url "https://svn.code.sf.net/p/openctm/code/trunk")
  2569. (revision revision)))
  2570. (file-name (string-append name "-" version "-checkout"))
  2571. (sha256
  2572. (base32 "01wb70m48xh5gwhv60a5brv4sxl0i0rh038w32cgnlxn5x86s9f1"))))
  2573. (build-system gnu-build-system)
  2574. (native-inputs
  2575. (list pkg-config))
  2576. (inputs
  2577. `(("mesa" ,mesa)
  2578. ("glu" ,glu)
  2579. ("glut" ,freeglut)
  2580. ("gtk" ,gtk+-2)))
  2581. (arguments
  2582. `(#:tests? #f ;no tests
  2583. #:phases
  2584. (modify-phases %standard-phases
  2585. (replace 'configure
  2586. (lambda* (#:key outputs #:allow-other-keys)
  2587. (rename-file "Makefile.linux" "Makefile")
  2588. (let ((out (assoc-ref outputs "out")))
  2589. ;; Create output directories.
  2590. (mkdir-p (string-append out "/lib"))
  2591. (mkdir-p (string-append out "/include"))
  2592. (mkdir-p (string-append out "/bin"))
  2593. ;; Fix rpath.
  2594. (substitute* "tools/Makefile.linux"
  2595. (("-rpath,\\.")
  2596. (string-append "-rpath," out "/lib/"))
  2597. (("/usr/local")
  2598. out))
  2599. ;; Set right output.
  2600. (substitute* "Makefile"
  2601. (("/usr/lib")
  2602. (string-append out "/lib"))
  2603. (("\\/usr\\/local")
  2604. out))
  2605. #t))))))
  2606. (synopsis "3D triangle mesh format and related tools and libraries")
  2607. (description "OpenCTM is a file format, a software library and a tool set
  2608. for compression of 3D triangle meshes. The geometry is compressed to a
  2609. fraction of comparable file formats (3DS, STL, COLLADA...), and the format is
  2610. accessible through a simple API")
  2611. (license license:zlib)
  2612. (home-page "http://openctm.sourceforge.net/"))))
  2613. (define-public lib3ds
  2614. (package
  2615. (name "lib3ds")
  2616. (version "1.3.0")
  2617. (source
  2618. (origin
  2619. (method url-fetch)
  2620. (uri (string-append
  2621. "https://storage.googleapis.com/google-code-archive-downloads"
  2622. "/v2/code.google.com/lib3ds/lib3ds-" version ".zip"))
  2623. (sha256
  2624. (base32 "1qr9arfdkjf7q11xhvxwzmhxqz3nhcjkyb8zzfjpz9jm54q0rc7m"))))
  2625. (build-system gnu-build-system)
  2626. (native-inputs
  2627. (list unzip))
  2628. (home-page "https://code.google.com/archive/p/lib3ds")
  2629. (synopsis "3DS format file toolkit")
  2630. (description "Lib3ds is a toolkit for handling the 3DS format for 3D
  2631. model files. Its main goal is to simplify the creation of 3DS import and
  2632. export filters.")
  2633. (license license:lgpl2.1+)))
  2634. (define-public meshlab
  2635. (package
  2636. (name "meshlab")
  2637. (version "2020.06")
  2638. (source (origin
  2639. (method git-fetch)
  2640. (uri (git-reference
  2641. (url "https://github.com/cnr-isti-vclab/meshlab")
  2642. (commit (string-append "Meshlab-" version))
  2643. (recursive? #t)))
  2644. (file-name (git-file-name name version))
  2645. (sha256
  2646. (base32 "1cgx24wxh2ah5pff51rcrk6x8qcdjpkxcdak7s4cfzmxvjlshydd"))))
  2647. (build-system cmake-build-system)
  2648. (inputs
  2649. (list qtbase-5
  2650. qtscript
  2651. qtxmlpatterns
  2652. mesa
  2653. glu
  2654. glew
  2655. muparser
  2656. gmp
  2657. eigen
  2658. libfreenect
  2659. lib3ds
  2660. openctm
  2661. ;; FIXME: Compilation fails with system qhull:
  2662. ;; https://github.com/cnr-isti-vclab/meshlab/issues/678
  2663. ;; ("qhull" ,qhull)
  2664. ))
  2665. (arguments
  2666. `(#:tests? #f ; Has no tests
  2667. #:phases
  2668. (modify-phases %standard-phases
  2669. (add-after 'unpack 'go-to-source-dir
  2670. (lambda _ (chdir "src") #t))
  2671. (add-after 'install 'move-files
  2672. (lambda* (#:key outputs #:allow-other-keys)
  2673. (let ((lib (string-append (assoc-ref outputs "out")
  2674. "/lib")))
  2675. (rename-file
  2676. (string-append lib "/meshlab/libmeshlab-common.so")
  2677. (string-append lib "/libmeshlab-common.so"))
  2678. #t))))))
  2679. (synopsis "3D triangular mesh processing and editing software")
  2680. (home-page "https://www.meshlab.net/")
  2681. (description "MeshLab is a system for the processing and
  2682. editing of unstructured large 3D triangular meshes. It is aimed to help the
  2683. processing of the typical not-so-small unstructured models arising in 3D
  2684. scanning, providing a set of tools for editing, cleaning, healing, inspecting,
  2685. rendering and converting this kind of meshes. These tools include MeshLab
  2686. proper, a versatile program with a graphical user interface, and meshlabserver,
  2687. a program that can perform mesh processing tasks in batch mode, without a
  2688. GUI.")
  2689. (license license:gpl3+)))
  2690. (define-public poke
  2691. (package
  2692. (name "poke")
  2693. (version "2.1")
  2694. (source (origin
  2695. (method url-fetch)
  2696. (uri (string-append "mirror://gnu/poke/poke-" version
  2697. ".tar.gz"))
  2698. (sha256
  2699. (base32 "0w168jcjahl3jawkhnh0dc10mcw4nwv4yawwc8xhqm5w3dn8wlnd"))
  2700. (modules '((guix build utils)))
  2701. (snippet
  2702. '(begin
  2703. ;; Delete files generated by Bison.
  2704. (delete-file "gl/parse-datetime.c")
  2705. (delete-file "gl/parse-datetime-gen.h")
  2706. (delete-file "jitter/example-vms/structured/structured-parser.c")
  2707. (delete-file "jitter/example-vms/structured/structured-parser.h")
  2708. (delete-file "jitter/jitterc/jitterc-parser.c")
  2709. (delete-file "jitter/jitterc/jitterc-parser.h")
  2710. (delete-file "jitter/jitter/jitter-routine-parser.c")
  2711. (delete-file "jitter/jitter/jitter-routine-parser.h")
  2712. (delete-file "libpoke/pkl-tab.c")
  2713. (delete-file "libpoke/pkl-tab.h")
  2714. (delete-file "poke/pk-map-tab.c")
  2715. (delete-file "poke/pk-map-tab.h")
  2716. ;; Delete files generated by flex.
  2717. (delete-file "jitter/example-vms/structured/structured-scanner.c")
  2718. (delete-file "jitter/example-vms/structured/structured-scanner.h")
  2719. (delete-file "jitter/jitterc/jitterc-scanner.c")
  2720. (delete-file "jitter/jitterc/jitterc-scanner.h")
  2721. (delete-file "jitter/jitter/jitter-routine-scanner.c")
  2722. (delete-file "jitter/jitter/jitter-routine-scanner.h")
  2723. (delete-file "libpoke/pkl-lex.c")
  2724. (delete-file "libpoke/pkl-lex.h")
  2725. (delete-file "poke/pk-map-lex.c")
  2726. (delete-file "poke/pk-map-lex.h")
  2727. ;; Other generated files:
  2728. (delete-file "jitter/example-vms/jitterlisp/jitterlispvm-vm1.c")
  2729. (delete-file "jitter/example-vms/jitterlisp/jitterlispvm-vm2.c")
  2730. (delete-file "jitter/example-vms/jitterlisp/jitterlispvm-vm.h")
  2731. (delete-file "jitter/example-vms/structured/structuredvm-vm1.c")
  2732. (delete-file "jitter/example-vms/structured/structuredvm-vm2.c")
  2733. (delete-file "jitter/example-vms/structured/structuredvm-vm.h")
  2734. (delete-file "jitter/example-vms/structured/structuredvm-vm-main.c")
  2735. (delete-file "jitter/example-vms/uninspired/uninspired-vm1.c")
  2736. (delete-file "jitter/example-vms/uninspired/uninspired-vm2.c")
  2737. (delete-file "jitter/example-vms/uninspired/uninspired-vm.h")
  2738. (delete-file "jitter/example-vms/uninspired/uninspired-vm-main.c")
  2739. (delete-file "libpoke/pvm-vm.h")
  2740. (delete-file "libpoke/pvm-vm1.c")
  2741. (delete-file "libpoke/pvm-vm2.c")))))
  2742. (build-system gnu-build-system)
  2743. ;; The GUI, which we elide, requires tcl and tk.
  2744. (native-inputs (list bison dejagnu flex libtool pkg-config))
  2745. ;; FIXME: Enable NBD support by adding `libnbd' (currently unpackaged).
  2746. (inputs (list json-c libgc readline libtextstyle))
  2747. (arguments
  2748. ;; To build the GUI, add the `--enable-gui' configure flag.
  2749. ;; To enable the "hyperlink server", add the `--enable-hserver' flag.
  2750. `(#:configure-flags '("--enable-mi")))
  2751. (home-page "https://www.gnu.org/software/poke/#documentation")
  2752. (synopsis "Editing of arbitrary binary data")
  2753. (description "GNU poke is an interactive, extensible editor for binary data.
  2754. Not limited to editing basic entities such as bits and bytes, it provides a
  2755. full-fledged procedural, interactive programming language designed to describe
  2756. data structures and to operate on them.")
  2757. (license license:gpl3+)))
  2758. (define-public pcb2gcode
  2759. (package
  2760. (name "pcb2gcode")
  2761. (version "2.1.0")
  2762. (source
  2763. (origin
  2764. (method git-fetch)
  2765. (uri (git-reference
  2766. (url "https://github.com/pcb2gcode/pcb2gcode")
  2767. (commit (string-append "v" version))
  2768. (recursive? #t)))
  2769. (file-name (git-file-name name version))
  2770. (sha256
  2771. (base32
  2772. "0nzglcyh6ban27cc73j4l7w7r9k38qivq0jz8iwnci02pfalw4ry"))))
  2773. (build-system gnu-build-system)
  2774. (inputs
  2775. (list boost
  2776. geos
  2777. gerbv
  2778. glibmm
  2779. gtkmm-2
  2780. librsvg))
  2781. (native-inputs
  2782. (list autoconf automake libtool pkg-config))
  2783. (home-page "https://github.com/pcb2gcode/pcb2gcode")
  2784. (synopsis "Generate G-code for milling PCBs")
  2785. (description "pcb2gcode is a command-line program for isolation routing
  2786. and drilling of PCBs. It takes Gerber files as input and outputs G-code files
  2787. for the milling of PCBs. It also includes an autoleveller for the automatic
  2788. dynamic calibration of the milling depth.")
  2789. (license license:gpl3+)))
  2790. (define-public syscall-intercept
  2791. ;; Upstream provides no tag. Also, last version update is 4 years old.
  2792. (let ((commit "304404581c57d43478438d175099d20260bae74e")
  2793. (revision "0"))
  2794. (package
  2795. (name "syscall-intercept")
  2796. (version (git-version "0.1.0" revision commit))
  2797. (source
  2798. (origin
  2799. (method git-fetch)
  2800. (uri
  2801. (git-reference
  2802. (url "https://github.com/pmem/syscall_intercept/")
  2803. (commit commit)))
  2804. (file-name (git-file-name name version))
  2805. (sha256
  2806. (base32 "17sw78xp5wjzv25adpbq3khl8fi0avj7bgpi57q3jnvl3c68xy5z"))))
  2807. (native-inputs
  2808. (list perl pkg-config))
  2809. (inputs
  2810. (list capstone))
  2811. (build-system cmake-build-system)
  2812. (arguments
  2813. `(#:build-type "Release"
  2814. ;; FIXME: "syscall_format_logging" test fails.
  2815. #:tests? #f))
  2816. (home-page "https://github.com/pmem/syscall_intercept")
  2817. (synopsis "System call intercepting library")
  2818. (description
  2819. "The system call intercepting library provides a low-level interface
  2820. for hooking Linux system calls in user space. This is achieved by
  2821. hot-patching the machine code of the standard C library in the memory of
  2822. a process.")
  2823. (license license:bsd-2))))
  2824. (define-public xfoil
  2825. (package
  2826. (name "xfoil")
  2827. (version "6.99")
  2828. (source
  2829. (origin
  2830. (method url-fetch)
  2831. (uri (string-append "https://web.mit.edu/drela/Public/web/xfoil/xfoil"
  2832. version ".tgz"))
  2833. (sha256
  2834. (base32
  2835. "0h5y5v0qlyvi4qc943x394npz4779i8f52iksxshxkjj7xj500jw"))))
  2836. (build-system gnu-build-system)
  2837. (arguments
  2838. `(#:phases
  2839. (modify-phases %standard-phases
  2840. (delete 'configure)
  2841. (add-after 'unpack 'edit-files
  2842. (lambda* (#:key outputs #:allow-other-keys)
  2843. ;; The instructions in orrs/README say that orrs/bin/osmap.f
  2844. ;; should be edited, but that file is never used by XFOIL.
  2845. ;; Instead, it is osrc/osmap.f that is used.
  2846. (substitute* "osrc/osmap.f"
  2847. (("^[ ]{6}DATA OSFILE / '/var/local/codes/orrs/osmap.dat' /")
  2848. (let ((replacement (string-append (make-string 6 #\space)
  2849. "DATA OSFILE / '"
  2850. (assoc-ref outputs "out")
  2851. "/share/xfoil/osmap.dat' /")))
  2852. ;; In fixed form Fortran, lines cannot exceed 72 columns.
  2853. ;; The Guix store path exceeds this limit.
  2854. (string-append
  2855. (substring replacement 0 72) "\n"
  2856. (make-string 5 #\space) "&" (substring replacement 72)))))
  2857. (substitute* "orrs/bin/Makefile_DP"
  2858. (("^FC = ifort")
  2859. "FC = gfortran")
  2860. (("^FLG = -O -r8")
  2861. "FLG = -O2 -fdefault-real-8"))
  2862. (substitute* "plotlib/Makefile"
  2863. (("^include ./config.make")
  2864. "include ./config.make.gfortranDP"))
  2865. (substitute* "bin/Makefile_gfortran"
  2866. (("^BINDIR = /home/codes/bin/")
  2867. (string-append "BINDIR = " (assoc-ref outputs "out") "/bin"))
  2868. (("^CC = cc")
  2869. "CC = gcc")
  2870. (("^CFLAGS = -O -DUNDERSCORE")
  2871. "CFLAGS = -O2 -DUNDERSCORE")
  2872. (("^FFLAGS = -O \\$\\(CHK\\) \\$\\(DBL\\)")
  2873. "FFLAGS = -O2 $(CHK) $(DBL)")
  2874. (("^FFLOPT = -O \\$\\(CHK\\) \\$\\(DBL\\)")
  2875. "FFLOPT = -O2 $(CHK) $(DBL)")
  2876. ;; Separate the build stage from the install stage.
  2877. (("\\$\\(INSTALLCMD\\) xfoil \\$\\(BINDIR\\)") "")
  2878. (("\\$\\(INSTALLCMD\\) pxplot \\$\\(BINDIR\\)") "")
  2879. (("\\$\\(INSTALLCMD\\) pplot \\$\\(BINDIR\\)") ""))))
  2880. (replace 'build
  2881. (lambda _
  2882. (invoke "make" "-C" "orrs/bin" "-f" "Makefile_DP" "osgen")
  2883. (with-directory-excursion "orrs"
  2884. (invoke "bin/osgen" "osmaps_ns.lst"))
  2885. (invoke "make" "-C" "plotlib")
  2886. (substitute* "bin/Makefile_gfortran"
  2887. (("^FFLAGS =(.*)$" _ suffix)
  2888. (string-append "FFLAGS = -fallow-argument-mismatch "
  2889. suffix "\n")))
  2890. (invoke "make" "-C" "bin" "-f" "Makefile_gfortran")))
  2891. (replace 'install
  2892. (lambda* (#:key outputs #:allow-other-keys)
  2893. (let* ((out (assoc-ref outputs "out"))
  2894. (bin-dir (string-append out "/bin"))
  2895. (data-dir (string-append out "/share/xfoil"))
  2896. (doc-dir (string-append out "/share/doc/xfoil")))
  2897. (mkdir-p bin-dir)
  2898. (invoke "make" "-C" "bin" "-f" "Makefile_gfortran" "install")
  2899. (mkdir-p data-dir)
  2900. (install-file "orrs/osmap.dat" data-dir)
  2901. (mkdir-p doc-dir)
  2902. (install-file "xfoil_doc.txt" doc-dir)))))
  2903. #:tests? #f))
  2904. (inputs
  2905. (list libx11))
  2906. (native-inputs
  2907. (list gfortran))
  2908. (home-page "https://web.mit.edu/drela/Public/web/xfoil/")
  2909. (synopsis "Program for the design and analysis of subsonic airfoils")
  2910. (description
  2911. "XFOIL is an interactive program for the design and analysis of subsonic
  2912. isolated airfoils. It consists of a collection of menu-driven routines which
  2913. perform various useful functions such as:
  2914. @itemize
  2915. @item Viscous (or inviscid) analysis of an existing airfoil
  2916. @item Airfoil design and redesign by interactive modification of surface speed
  2917. distributions
  2918. @item Airfoil redesign by interactive modification of geometric parameters
  2919. @item Blending of airfoils
  2920. @item Writing and reading of airfoil coordinates and polar save files
  2921. @item Plotting of geometry, pressure distributions, and multiple polars
  2922. @end itemize")
  2923. (license license:gpl2+)))
  2924. (define-public libigl
  2925. (package
  2926. (name "libigl")
  2927. (version "2.3.0")
  2928. (source
  2929. (origin
  2930. (method git-fetch)
  2931. (uri (git-reference
  2932. (url "https://github.com/libigl/libigl")
  2933. (commit (string-append "v" version))))
  2934. (file-name (git-file-name name version))
  2935. (sha256
  2936. (base32
  2937. "004a22ifq2vibgkgvrlyihqimpsfizvq5l448204kwfg3lkycajj"))))
  2938. (build-system cmake-build-system)
  2939. (arguments
  2940. `(#:configure-flags
  2941. '("-DLIBIGL_USE_STATIC_LIBRARY=OFF"
  2942. "-DLIBIGL_BUILD_TESTS=ON"
  2943. "-DLIBIGL_BUILD_TUTORIALS=OFF"
  2944. "-DLIBIGL_EXPORT_TARGETS=ON"
  2945. ;; The following options disable tests for the corresponding libraries.
  2946. ;; The options do not affect whether the libraries are linked to
  2947. ;; libigl or not, they are used for tests.
  2948. "-DLIBIGL_WITH_COMISO=OFF"
  2949. "-DLIBIGL_WITH_CORK=OFF"
  2950. "-DLIBIGL_WITH_MATLAB=OFF"
  2951. "-DLIBIGL_WITH_MOSEK=OFF"
  2952. "-DLIBIGL_WITH_TRIANGLE=OFF" ;; Undefined reference to "triangulate".
  2953. "-DLIBIGL_WITH_OPENGL_GLFW_IMGUI=OFF")
  2954. #:phases
  2955. (modify-phases %standard-phases
  2956. (add-after 'unpack 'unpack-external
  2957. (lambda _
  2958. (setenv "HOME" (getcwd)) ;; cmake needs this to export modules
  2959. (mkdir "external")
  2960. (copy-recursively (assoc-ref %build-inputs "libigl-glad") "external/glad")
  2961. (copy-recursively (assoc-ref %build-inputs "libigl-stb") "external/stb")
  2962. (copy-recursively (assoc-ref %build-inputs "libigl-tetgen") "external/tetgen")
  2963. (copy-recursively (assoc-ref %build-inputs "libigl-predicates") "external/predicates")))
  2964. (add-after 'unpack-external 'patch-cmake
  2965. (lambda _
  2966. ;; Fix references to external libraries
  2967. (substitute* "cmake/libigl.cmake"
  2968. (("if\\(NOT TARGET Eigen3::Eigen\\)" all)
  2969. (string-append "find_package(Eigen3 CONFIG REQUIRED)\n" all))
  2970. (("if\\(NOT TARGET CGAL::CGAL\\)" all)
  2971. (string-append "find_package(CGAL CONFIG COMPONENTS Core)\n" all))
  2972. (("if\\(NOT TARGET tinyxml2\\)" all)
  2973. (string-append "find_package(tinyxml2 CONFIG REQUIRED)\n"
  2974. "if (NOT TARGET tinyxml2::tinyxml2)"))
  2975. (("if\\(NOT TARGET embree\\)" all)
  2976. (string-append "find_package(embree 3 CONFIG REQUIRED)\n" all))
  2977. (("if\\(NOT TARGET glfw\\)" all)
  2978. (string-append "find_package(glfw3 CONFIG REQUIRED)\n" all))
  2979. (("igl_download_glad\\(\\)" all) "")
  2980. (("igl_download_stb\\(\\)" all) "")
  2981. (("igl_download_tetgen\\(\\)" all) "")
  2982. (("igl_download_triangle\\(\\)" all) "")
  2983. (("igl_download_predicates\\(\\)" all) ""))
  2984. (substitute* "tests/CMakeLists.txt"
  2985. (("igl_download_test_data\\(\\)") "")
  2986. (("set\\(IGL_TEST_DATA.*")
  2987. (format #f "set(IGL_TEST_DATA ~a)\n"
  2988. (assoc-ref %build-inputs "libigl-test-data")))
  2989. (("igl_download_catch2\\(\\)") "find_package(Catch2 CONFIG REQUIRED)")
  2990. (("list\\(APPEND CMAKE_MODULE_PATH \\$\\{LIBIGL_EXTERNAL\\}/catch2/contrib\\)")
  2991. "")
  2992. (("add_subdirectory\\(\\$\\{LIBIGL_EXTERNAL\\}/catch2 catch2\\)") ""))
  2993. ;; Install otherwise missing headers
  2994. (substitute* "cmake/libigl.cmake"
  2995. (("install_dir_files\\(copyleft\\)" all)
  2996. (string-join (list all
  2997. "install_dir_files(copyleft/cgal)"
  2998. "install_dir_files(copyleft/opengl)"
  2999. "install_dir_files(copyleft/tetgen)"
  3000. "install_dir_files(embree)"
  3001. "install_dir_files(opengl)"
  3002. "install_dir_files(png)"
  3003. "install_dir_files(predicates)"
  3004. "install_dir_files(xml)")
  3005. "\n"))))))))
  3006. ;; XXX: Inputs are currently only used to build tests.
  3007. ;; We would need to patch the CMake recipe to build a shared library
  3008. ;; with all of these.
  3009. (inputs
  3010. `(("boost" ,boost)
  3011. ("catch2" ,catch-framework2)
  3012. ("cgal" ,cgal)
  3013. ("eigen" ,eigen)
  3014. ("embree" ,embree)
  3015. ("glfw" ,glfw)
  3016. ("gmp" ,gmp)
  3017. ("mesa" ,mesa)
  3018. ("mpfr" ,mpfr)
  3019. ("tinyxml2" ,tinyxml2)
  3020. ;; When updating this package, update commit fields below according to
  3021. ;; the hashes listed in "cmake/LibiglDownloadExternal.cmake".
  3022. ("libigl-test-data"
  3023. ,(origin
  3024. (method git-fetch)
  3025. (uri (git-reference
  3026. (url "https://github.com/libigl/libigl-tests-data")
  3027. (commit "19cedf96d70702d8b3a83eb27934780c542356fe")))
  3028. (file-name (git-file-name "libigl-test-data" version))
  3029. (sha256 (base32 "1wxglrxw74xw4a4jmmjpm8719f3mnlbxbwygjb4ddfixxxyya4i2"))))
  3030. ("libigl-glad"
  3031. ,(origin
  3032. (method git-fetch)
  3033. (uri (git-reference
  3034. (url "https://github.com/libigl/libigl-glad")
  3035. (commit "09b4969c56779f7ddf8e6176ec1873184aec890f")))
  3036. (file-name (git-file-name "libigl-glad" version))
  3037. (sha256 (base32 "0rwrs7513ylp6gxv7crjzflapcg9p7x04nzfvywgl665vl53rawk"))))
  3038. ("libigl-stb"
  3039. ,(origin
  3040. (method git-fetch)
  3041. (uri (git-reference
  3042. (url "https://github.com/libigl/libigl-stb.git")
  3043. (commit "cd0fa3fcd90325c83be4d697b00214e029f94ca3")))
  3044. (file-name (git-file-name "libigl-stb" version))
  3045. (sha256 (base32 "0wwlb370z40y63ic3ny6q7lxibhixg2k1pjdkl4ymzv79zld28kj"))))
  3046. ("libigl-predicates"
  3047. ,(origin
  3048. (method git-fetch)
  3049. (uri (git-reference
  3050. (url "https://github.com/libigl/libigl-predicates.git")
  3051. (commit "488242fa2b1f98a9c5bd1441297fb4a99a6a9ae4")))
  3052. (file-name (git-file-name "libigl-predicates" version))
  3053. (sha256 (base32 "13bd98g8lgcq37i3crj66433z09grnb2xjrcqpwqmyn147rp5wyh"))))
  3054. ;; TODO: Package tetgen separately from <http://www.tetgen.org>
  3055. ("libigl-tetgen"
  3056. ,(origin
  3057. (method git-fetch)
  3058. (uri (git-reference
  3059. (url "https://github.com/libigl/tetgen.git")
  3060. (commit "4f3bfba3997f20aa1f96cfaff604313a8c2c85b6")))
  3061. (file-name (git-file-name "libigl-tetgen" version))
  3062. (sha256 (base32 "1k724syssw37py7kwmibk3sfwkkgyjyy7qkijnhn6rjm91g8qxsg"))))))
  3063. (home-page "https://libigl.github.io/")
  3064. (synopsis "Simple C++ geometry processing library")
  3065. (description "This library provides functionality for shape modelling,
  3066. visualization, matrix manipulation.")
  3067. (license (list license:gpl3 license:mpl2.0))))
  3068. (define-public prusa-slicer
  3069. (package
  3070. (name "prusa-slicer")
  3071. (version "2.4.1")
  3072. (source
  3073. (origin
  3074. (method git-fetch)
  3075. (uri
  3076. (git-reference
  3077. (url "https://github.com/prusa3d/PrusaSlicer")
  3078. (commit (string-append "version_" version))))
  3079. (file-name (git-file-name name version))
  3080. (sha256 (base32 "0q1m8fcz39s03r9csq411ss8vbbpjx45icj8vgkysy8hqgqz3gz0"))
  3081. (modules '((guix build utils)))
  3082. (snippet
  3083. '(begin
  3084. ;; Prusa slicer bundles a lot of dependencies in src/ directory.
  3085. ;; Most of them contain prusa-specific modifications (e.g. avrdude),
  3086. ;; but others do not. Here we replace the latter with Guix packages.
  3087. ;; Remove bundled libraries that were not modified by Prusa Slicer developers.
  3088. (delete-file-recursively "src/hidapi")
  3089. (delete-file-recursively "src/eigen")
  3090. (delete-file-recursively "src/libigl/igl")
  3091. (substitute* "src/CMakeLists.txt"
  3092. (("add_subdirectory\\(libigl\\)" all)
  3093. (string-append
  3094. all "\ninclude_directories(libigl INTERFACE libigl::core)"))
  3095. (("add_subdirectory\\(hidapi\\)")
  3096. "pkg_check_modules(HIDAPI REQUIRED hidapi-hidraw)")
  3097. (("include_directories\\(hidapi/include\\)")
  3098. "include_directories()"))
  3099. (substitute* "src/slic3r/CMakeLists.txt"
  3100. (("add_library\\(libslic3r_gui.*" all)
  3101. (string-append
  3102. all
  3103. "\ntarget_include_directories(libslic3r_gui PUBLIC ${HIDAPI_INCLUDE_DIRS})\n"))
  3104. (("\\bhidapi\\b") "${HIDAPI_LIBRARIES}"))))))
  3105. (build-system cmake-build-system)
  3106. (arguments
  3107. `(#:configure-flags
  3108. '("-DSLIC3R_FHS=1" ;; Use The Filesystem Hierarchy Standard.
  3109. "-DSLIC3R_GTK=3" ;; Use GTK+
  3110. ;; Use wxWidgets 3.0.x.x to prevent GUI crashes when adding support enforcers.
  3111. "-DSLIC3R_WX_STABLE=1")))
  3112. (native-inputs
  3113. (list pkg-config))
  3114. (inputs
  3115. (list boost
  3116. cereal
  3117. cgal
  3118. curl
  3119. dbus
  3120. eigen
  3121. expat
  3122. glew
  3123. glib
  3124. gmp
  3125. gtk+
  3126. hidapi
  3127. ilmbase
  3128. libigl
  3129. libpng
  3130. mesa
  3131. mpfr
  3132. nlopt
  3133. openvdb
  3134. pango
  3135. tbb
  3136. eudev
  3137. wxwidgets
  3138. zlib))
  3139. (home-page "https://www.prusa3d.com/prusaslicer/")
  3140. (synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)")
  3141. (description "PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts them into
  3142. G-code instructions for FFF printers or PNG layers for mSLA 3D printers.")
  3143. (license license:agpl3)
  3144. ;; Mark as tunable to take advantage of SIMD code in Eigen and in libigl.
  3145. (properties '((tunable? . #t)))))
  3146. (define-public wireviz
  3147. (package
  3148. (name "wireviz")
  3149. (version "0.3.2")
  3150. (source (origin
  3151. (method url-fetch)
  3152. (uri (pypi-uri "wireviz" version))
  3153. (sha256
  3154. (base32
  3155. "1dgnlxxlna2m1fh0ybivw0psym0sa5cqsl72mjl79bwfspnif61h"))))
  3156. (build-system python-build-system)
  3157. (propagated-inputs (list python-graphviz python-pillow python-pyyaml))
  3158. (home-page "https://github.com/formatc1702/WireViz")
  3159. (synopsis "Easily document cables and wiring harnesses")
  3160. (description
  3161. "WireViz is a tool for easily documenting cables, wiring harnesses and
  3162. connector pinouts. It takes plain text, YAML-formatted files as input and
  3163. produces beautiful graphical output thanks to GraphViz. It handles automatic
  3164. BOM creation and has a lot of extra features.")
  3165. (license license:gpl3)))