projects/guix·blob ruby-team · refs

5558 lines · 223.0 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2015-2025 Ricardo Wurmus <[email protected]>
3;;; Copyright © 2015 Federico Beffa <[email protected]>
4;;; Copyright © 2016, 2018, 2020-2026 Efraim Flashner <[email protected]>
5;;; Copyright © 2016 David Thompson <[email protected]>
6;;; Copyright © 2016-2019, 2021, 2023 Ludovic Courtès <[email protected]>
7;;; Copyright © 2016, 2017, 2018 Theodoros Foradis <[email protected]>
8;;; Copyright © 2016 John Darrington <[email protected]>
9;;; Copyright © 2017 Julien Lepiller <[email protected]>
10;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
11;;; Copyright © 2018 Clément Lassieur <[email protected]>
12;;; Copyright © 2018, 2019 Jonathan Brielmaier <[email protected]>
13;;; Copyright © 2018, 2019, 2020 Arun Isaac <[email protected]>
14;;; Copyright © 2019 Tim Stahel <[email protected]>
15;;; Copyright © 2019 Jovany Leandro G.C <[email protected]>
16;;; Copyright © 2019 Steve Sprang <[email protected]>
17;;; Copyright © 2019 John Soo <[email protected]>
18;;; Copyright © 2020 Brice Waegeneire <[email protected]>
19;;; Copyright © 2020,2021,2024 Vincent Legoll <[email protected]>
20;;; Copyright © 2020, 2023 Marius Bakke <[email protected]>
21;;; Copyright © 2020, 2021, 2025 Ekaitz Zarraga <[email protected]>
22;;; Copyright © 2020 B. Wilson <[email protected]>
23;;; Copyright © 2020, 2021, 2022, 2023, 2024, 2025 Vinicius Monego <[email protected]>
24;;; Copyright © 2021, 2023 Morgan Smith <[email protected]>
25;;; Copyright © 2021 qblade <[email protected]>
26;;; Copyright © 2021 Gerd Heber <[email protected]>
27;;; Copyright © 2021, 2022, 2026 Guillaume Le Vaillant <[email protected]>
28;;; Copyright © 2021 Ivan Gankevich <[email protected]>
29;;; Copyright © 2021, 2022 Petr Hodina <[email protected]>
30;;; Copyright © 2021 Foo Chuan Wei <[email protected]>
31;;; Copyright © 2022, 2025 Evgeny Pisemsky <[email protected]>
32;;; Copyright © 2022 Olivier Dion <[email protected]>
33;;; Copyright © 2022 Peter Polidoro <[email protected]>
34;;; Copyright © 2022 Malte Frank Gerdes <[email protected]>
35;;; Copyright © 2022 Greg Hogan <[email protected]>
36;;; Copyright © 2022, 2024-2026 Artyom V. Poptsov <[email protected]>
37;;; Copyright © 2022, 2025 Maxim Cournoyer <[email protected]>
38;;; Copyright © 2022, 2023, 2025 Felix Gruber <[email protected]>
39;;; Copyright © 2023 Theofilos Pechlivanis <[email protected]>
40;;; Copyright © 2023 Sharlatan Hellseher <[email protected]>
41;;; Copyright © 2023 pinoaffe <[email protected]>
42;;; Copyright © 2024 Juliana Sims <[email protected]>
43;;; Copyright © 2024 Nguyễn Gia Phong <[email protected]>
44;;; Copyright © 2025 Frederick Muriuki Muriithi <[email protected]>
45;;; Copyright © 2025, 2026 nomike Postmann <[email protected]>
46;;; Copyright © 2025 Matthew Elwin <[email protected]>
47;;; Copyright © 2025 Janneke Nieuwenhuizen <[email protected]>
48;;; Copyright © 2025 Remco van 't Veer <[email protected]>
49;;; Copyright © 2025-2026 bdunahu <[email protected]>
50;;; Copyright © 2026 Cayetano Santos <[email protected]>
51;;; Copyright © 2026 Thomas Kramer <[email protected]>
52;;; Copyright © 2026 Daniel Khodabakhsh <[email protected]>
53;;; Copyright © 2026 Spencer King <[email protected]>
54;;; Copyright © 2026 Brent Wedderburn <[email protected]>
55;;; Copyright © 2026 Orahcio Felício de Sousa <[email protected]>
56;;;
57;;; This file is part of GNU Guix.
58;;;
59;;; GNU Guix is free software; you can redistribute it and/or modify it
60;;; under the terms of the GNU General Public License as published by
61;;; the Free Software Foundation; either version 3 of the License, or (at
62;;; your option) any later version.
63;;;
64;;; GNU Guix is distributed in the hope that it will be useful, but
65;;; WITHOUT ANY WARRANTY; without even the implied warranty of
66;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67;;; GNU General Public License for more details.
68;;;
69;;; You should have received a copy of the GNU General Public License
70;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
71
72;;; Packages for computer-aided engineering workflows, including CAD/CAM,
73;;; physical modeling and simulation, field solvers, manufacturing, robotics,
74;;; surveying, and engineering computation tools.
75
76(define-module (gnu packages engineering)
77 #:use-module ((guix licenses) #:prefix license:)
78 #:use-module (guix build-system ant)
79 #:use-module (guix build-system cmake)
80 #:use-module (guix build-system copy)
81 #:use-module (guix build-system emacs)
82 #:use-module (guix build-system go)
83 #:use-module (guix build-system guile)
84 #:use-module (guix build-system gnu)
85 #:use-module (guix build-system meson)
86 #:use-module (guix build-system pyproject)
87 #:use-module (guix build-system qt)
88 #:use-module (guix deprecation)
89 #:use-module (guix download)
90 #:use-module (guix gexp)
91 #:use-module (guix git-download)
92 #:use-module (guix monads)
93 #:use-module (guix packages)
94 #:use-module (guix store)
95 #:use-module (guix svn-download)
96 #:use-module (guix utils)
97 #:use-module (gnu packages)
98 #:use-module (gnu packages aidc)
99 #:use-module (gnu packages algebra)
100 #:use-module (gnu packages autotools)
101 #:use-module (gnu packages backup)
102 #:use-module (gnu packages base)
103 #:use-module (gnu packages bash)
104 #:use-module (gnu packages bdw-gc)
105 #:use-module (gnu packages bison)
106 #:use-module (gnu packages boost)
107 #:use-module (gnu packages c)
108 #:use-module (gnu packages check)
109 #:use-module (gnu packages cmake)
110 #:use-module (gnu packages code)
111 #:use-module (gnu packages compression)
112 #:use-module (gnu packages cpp)
113 #:use-module (gnu packages crypto)
114 #:use-module (gnu packages curl)
115 #:use-module (gnu packages databases)
116 #:use-module (gnu packages dejagnu)
117 #:use-module (gnu packages digest)
118 #:use-module (gnu packages docbook)
119 #:use-module (gnu packages documentation)
120 #:use-module (gnu packages electronics)
121 #:use-module (gnu packages emacs-build)
122 #:use-module (gnu packages emacs-xyz)
123 #:use-module (gnu packages file)
124 #:use-module (gnu packages compiler-tools)
125 #:use-module (gnu packages fontutils)
126 #:use-module (gnu packages freedesktop)
127 #:use-module (gnu packages gawk)
128 #:use-module (gnu packages gcc)
129 #:use-module (gnu packages gd)
130 #:use-module (gnu packages geo)
131 #:use-module (gnu packages gettext)
132 #:use-module (gnu packages ghostscript)
133 #:use-module (gnu packages gl)
134 #:use-module (gnu packages glib)
135 #:use-module (gnu packages gnome)
136 #:use-module (gnu packages golang)
137 #:use-module (gnu packages golang-build)
138 #:use-module (gnu packages golang-check)
139 #:use-module (gnu packages golang-compression)
140 #:use-module (gnu packages golang-crypto)
141 #:use-module (gnu packages golang-maths)
142 #:use-module (gnu packages golang-vcs)
143 #:use-module (gnu packages golang-web)
144 #:use-module (gnu packages golang-xyz)
145 #:use-module (gnu packages graphics)
146 #:use-module (gnu packages graphviz)
147 #:use-module (gnu packages groff)
148 #:use-module (gnu packages gtk)
149 #:use-module (gnu packages guile)
150 #:use-module (gnu packages image)
151 #:use-module (gnu packages image-processing)
152 #:use-module (gnu packages imagemagick)
153 #:use-module (gnu packages javascript)
154 #:use-module (gnu packages jupyter)
155 #:use-module (gnu packages icu4c)
156 #:use-module (gnu packages kde-frameworks)
157 #:use-module (gnu packages libcanberra)
158 #:use-module (gnu packages libevent)
159 #:use-module (gnu packages libusb)
160 #:use-module (gnu packages linux) ;FIXME: for pcb
161 #:use-module (gnu packages lisp)
162 #:use-module (gnu packages m4)
163 #:use-module (gnu packages man)
164 #:use-module (gnu packages maths)
165 #:use-module (gnu packages multiprecision)
166 #:use-module (gnu packages mpi)
167 #:use-module (gnu packages ncurses)
168 #:use-module (gnu packages nettle)
169 #:use-module (gnu packages networking)
170 #:use-module (gnu packages node)
171 #:use-module (gnu packages oneapi)
172 #:use-module (gnu packages openkinect)
173 #:use-module (gnu packages parallel)
174 #:use-module (gnu packages pcre)
175 #:use-module (gnu packages pdf)
176 #:use-module (gnu packages perl)
177 #:use-module (gnu packages pkg-config)
178 #:use-module (gnu packages pretty-print)
179 #:use-module (gnu packages protobuf)
180 #:use-module (gnu packages pulseaudio)
181 #:use-module (gnu packages python)
182 #:use-module (gnu packages python-build)
183 #:use-module (gnu packages python-check)
184 #:use-module (gnu packages python-compression)
185 #:use-module (gnu packages python-crypto)
186 #:use-module (gnu packages python-graphics)
187 #:use-module (gnu packages python-science)
188 #:use-module (gnu packages python-web)
189 #:use-module (gnu packages python-xyz)
190 #:use-module (gnu packages qt)
191 #:use-module (gnu packages readline)
192 #:use-module (gnu packages ruby-xyz)
193 #:use-module (gnu packages rust-apps)
194 #:use-module (gnu packages sagemath)
195 #:use-module (gnu packages serialization)
196 #:use-module (gnu packages sqlite)
197 #:use-module (gnu packages stb)
198 #:use-module (gnu packages swig)
199 #:use-module (gnu packages tcl)
200 #:use-module (gnu packages tex)
201 #:use-module (gnu packages texinfo)
202 #:use-module (gnu packages text-editors)
203 #:use-module (gnu packages time)
204 #:use-module (gnu packages tls)
205 #:use-module (gnu packages toolkits)
206 #:use-module (gnu packages tree-sitter)
207 #:use-module (gnu packages version-control)
208 #:use-module (gnu packages web)
209 #:use-module (gnu packages webkit)
210 #:use-module (gnu packages wxwidgets)
211 #:use-module (gnu packages xdisorg)
212 #:use-module (gnu packages xiph)
213 #:use-module (gnu packages xml)
214 #:use-module (gnu packages xorg)
215 #:use-module ((srfi srfi-1) #:hide (zip)))
216
217(define-public cutecom
218 (package
219 (name "cutecom")
220 (version "0.60.0-RC1")
221 (source (origin
222 (method git-fetch)
223 (uri (git-reference
224 (url "https://gitlab.com/cutecom/cutecom")
225 (commit (string-append "v" version))))
226 (file-name (git-file-name name version))
227 (sha256
228 (base32
229 "1k67x4l27ac6sb944b42zscm0ffq2fxbghapspgj75g4dr8ip38a"))))
230 (build-system qt-build-system)
231 (arguments
232 (list
233 #:qtbase qtbase
234 #:tests? #f)) ;no tests
235 (inputs
236 (list qtbase qttools qtserialport qtwayland))
237 (home-page "https://gitlab.com/cutecom/cutecom")
238 (synopsis "Graphical serial terminal")
239 (description
240 "@code{cutecom} is a graphical serial terminal, like @code{minicom}. It is
241aimed mainly at hardware developers or other people who need a terminal to talk to
242their devices.")
243 (license license:gpl3+)))
244
245(define-public librecad
246 (package
247 (name "librecad")
248 (version "2.2.1.5")
249 (source (origin
250 (method git-fetch)
251 (uri (git-reference
252 (url "https://github.com/LibreCAD/LibreCAD")
253 (commit (string-append "v" version))))
254 (file-name (git-file-name name version))
255 (sha256
256 (base32
257 "1d2cpb7zi2hfk6bgfks9dgi4z1n5xz3jmg7lbs6mbr9aak0fcvx7"))))
258 (build-system qt-build-system)
259 (arguments
260 (list
261 #:modules '((guix build qt-build-system)
262 ((guix build gnu-build-system) #:prefix gnu:)
263 (guix build utils))
264 #:phases
265 #~(modify-phases %standard-phases
266 (replace 'configure
267 (lambda _
268 (system* "qmake" (string-append "BOOST_DIR="
269 #$(this-package-input "boost")))))
270 (replace 'build (assoc-ref gnu:%standard-phases 'build))
271 (replace 'check (assoc-ref gnu:%standard-phases 'check))
272 (replace 'install
273 (lambda _
274 (let* ((bin (string-append #$output "/bin"))
275 (share (string-append #$output "/share"))
276 (apps (string-append share "/applications"))
277 (icons (string-append share "/icons/hicolor/128x128/apps")))
278 (mkdir-p bin)
279 (install-file "unix/librecad" bin)
280 (mkdir-p share)
281 (copy-recursively "unix/resources"
282 (string-append share "/librecad"))
283 (mkdir-p apps)
284 (install-file "desktop/librecad.desktop" apps)
285 (mkdir-p icons)
286 (copy-file "librecad/res/main/librecad.png"
287 (string-append icons "/librecad.png"))))))))
288 (inputs
289 (list bash-minimal boost muparser freetype qtbase-5 qtsvg-5))
290 (native-inputs
291 (list pkg-config which))
292 (home-page "https://librecad.org/")
293 (synopsis "Computer-aided design (CAD) application")
294 (description
295 "LibreCAD is a 2D Computer-aided design (CAD) application for creating
296plans and designs.")
297 (license license:gpl2)))
298
299(define-public mbpoll
300 (package
301 (name "mbpoll")
302 (version "1.5.4")
303 (source
304 (origin
305 (method git-fetch)
306 (uri (git-reference
307 (url "https://github.com/epsilonrt/mbpoll")
308 (commit (string-append "v" version))))
309 (file-name (git-file-name name version))
310 (sha256
311 (base32 "11vwmm2l96v8598z0q50rgp5z57lkd09ff9l8knpr4ghkjpssf0g"))))
312 (build-system cmake-build-system)
313 (arguments
314 (list
315 #:tests? #f)) ;no tests
316 (native-inputs (list pkg-config))
317 (inputs (list libmodbus))
318 (home-page "https://github.com/epsilonrt/mbpoll")
319 (synopsis
320 "Command line utility to communicate with ModBus slave (RTU or TCP)")
321 (description
322 "@code{mbpoll} is a command line utility to communicate with
323@url{https://en.wikipedia.org/wiki/Modbus, ModBus} slave (RTU or TCP).")
324 (license license:gpl3)))
325
326(define-public geda-gaf
327 (package
328 (name "geda-gaf")
329 (version "1.10.2")
330 (source (origin
331 (method url-fetch)
332 (uri (string-append
333 "http://ftp.geda-project.org/geda-gaf/stable/v"
334 (version-major+minor version) "/"
335 version "/geda-gaf-" version ".tar.gz"))
336 (sha256
337 (base32
338 "19688b0671imy2i3jphcnq1120b8ymhr4wz2psiqylr82ljanqp8"))))
339 (build-system gnu-build-system)
340 (arguments
341 (list
342 #:phases
343 '(modify-phases %standard-phases
344 ;; tests require a writable HOME
345 (add-before 'check 'set-home
346 (lambda _
347 (setenv "HOME" (getenv "TMPDIR"))))
348 (add-after 'unpack 'disable-failing-tests
349 (lambda _
350 (substitute* "xorn/tests/Makefile.in"
351 (("-Werror") ""))
352 ;; This test returns its correct result in an unexpected order.
353 (substitute* "libgeda/scheme/unit-tests/t0402-config.scm"
354 (("\\(begin-config-test 'config-keys" m)
355 (string-append "#;" m))))))
356 #:configure-flags
357 #~(let ((pcb #$(this-package-input "pcb")))
358 (list (string-append "--with-pcb-datadir=" pcb "/share")
359 (string-append "--with-pcb-lib-path="
360 pcb "/share/pcb/pcblib-newlib:"
361 pcb "/share/pcb/newlib")))))
362 (inputs
363 (list gamin
364 gdk-pixbuf
365 glib
366 gtk+-2
367 guile-2.0
368 libxcrypt
369 shared-mime-info
370 m4
371 pcb
372 python-2)) ; for xorn
373 (native-inputs
374 (list groff pkg-config desktop-file-utils perl)) ; for tests
375 (home-page "http://geda-project.org/")
376 (synopsis "Schematic capture, netlister, symbols, symbol checker, and utils")
377 (description
378 "Gaf stands for “gschem and friends”. It is a subset of the entire tool
379suite grouped together under the gEDA name. gEDA/gaf is a collection of tools
380which currently includes: gschem, a schematic capture program; gnetlist, a
381netlist generation program; gsymcheck, a syntax checker for schematic symbols;
382gattrib, a spreadsheet programme that manipulates the properties of symbols of
383a schematic; libgeda, libraries for gschem gnetlist and gsymcheck; gsch2pcb, a
384tool to forward annotation from your schematic to layout using PCB; some minor
385utilities.")
386 (license license:gpl2+)))
387
388(define-public pcb
389 (package
390 (name "pcb")
391 (version "4.3.0")
392 (source (origin
393 (method url-fetch)
394 (uri (string-append "mirror://sourceforge/pcb/pcb/pcb-" version
395 "/pcb-" version ".tar.gz"))
396 (sha256
397 (base32
398 "0ppv8cblw0h70laly4zp8gmbxkbzzhbbjgw13pssgaw4mx32z1df"))))
399 (build-system gnu-build-system)
400 (arguments
401 (list
402 #:phases
403 #~(modify-phases %standard-phases
404 (add-after 'unpack 'convert-encoding
405 (lambda _
406 (for-each
407 (lambda (name)
408 (invoke "iconv" "-f" "LATIN1" "-t" "UTF-8" name "-o" name))
409 '("src/pcb-menu.res.in"
410 "src/pcb-menu.res.h"))))
411 (add-before 'check 'pre-check
412 (lambda _
413 (system "Xvfb :1 &")
414 (setenv "DISPLAY" ":1"))))))
415 (inputs
416 (list dbus
417 mesa
418 glu
419 gd
420 gtk+-2
421 gtkglext
422 shared-mime-info
423 tk))
424 (native-inputs
425 (list bison
426 desktop-file-utils
427 flex
428 intltool
429 pkg-config
430 ;; For tests
431 imagemagick
432 gerbv
433 ghostscript
434 xorg-server-for-tests))
435 (home-page "http://pcb.geda-project.org/")
436 (synopsis "Design printed circuit board layouts")
437 (description
438 "GNU PCB is an interactive tool for editing printed circuit board
439layouts. It features a rats-nest implementation, schematic/netlist import,
440and design rule checking. It also includes an autorouter and a trace
441optimizer; and it can produce photorealistic and design review images.")
442 (license license:gpl2+)))
443
444(define-public fastcap
445 (package
446 (name "fastcap")
447 (version "2.0-18Sep92")
448 (source (origin
449 (method url-fetch/tarbomb)
450 (uri (string-append "http://www.rle.mit.edu/cpg/codes/"
451 name "-" version ".tgz"))
452 (sha256
453 (base32
454 "0x37vfp6k0d2z3gnig0hbicvi0jp8v267xjnn3z8jdllpiaa6p3k"))
455 (snippet
456 ;; Remove a non-free file.
457 #~(begin
458 (delete-file "doc/psfig.sty")))
459 (patches (search-patches "fastcap-mulSetup.patch"
460 "fastcap-mulGlobal.patch"))))
461 (build-system gnu-build-system)
462 (native-inputs
463 ;; FIXME: with (texlive-local-tree) citation references are rendered as
464 ;; question marks. During the build warnings like these are printed:
465 ;; LaTeX Warning: Citation `nabors91' on page 2 undefined on input line
466 ;; 3.
467 `(("texlive" ,(texlive-local-tree))
468 ("ghostscript" ,ghostscript)
469 ("libfaketime" ,libfaketime)))
470 (arguments
471 (list
472 #:make-flags #~(list "CC=gcc" "RM=rm" "SHELL=sh"
473 (string-append
474 "CFLAGS="
475 "-Wno-error=implicit-int"
476 " -Wno-error=return-mismatch"
477 " -Wno-error=implicit-function-declaration")
478 "all")
479 #:parallel-build? #f
480 #:tests? #f ;; no tests-suite
481 #:modules `((srfi srfi-1)
482 ,@%default-gnu-modules)
483 #:phases
484 #~(modify-phases %standard-phases
485 (add-after 'build 'make-doc
486 (lambda _
487 (invoke "faketime"
488 "1970-01-01 00:00:00"
489 "make" "CC=gcc" "RM=rm" "SHELL=sh" "manual")))
490 (add-before 'make-doc 'fix-doc
491 (lambda _
492 (substitute* "doc/Makefile" (("/bin/rm") (which "rm")))
493 (substitute* (find-files "doc" "\\.tex")
494 (("\\\\special\\{psfile=([^,]*),.*scale=([#0-9.]*).*\\}"
495 all file scale)
496 (string-append "\\includegraphics[scale=" scale "]{"
497 file "}"))
498 (("\\\\psfig\\{figure=([^,]*),.*width=([#0-9.]*in).*\\}"
499 all file width)
500 (string-append "\\includegraphics[width=" width "]{"
501 file "}"))
502 (("\\\\psfig\\{figure=([^,]*),.*height=([#0-9.]*in).*\\}"
503 all file height)
504 (string-append "\\includegraphics[height=" height "]{"
505 file "}"))
506 (("\\\\psfig\\{figure=([^,]*)\\}" all file)
507 (string-append "\\includegraphics{" file "}")))
508 (substitute* '("doc/mtt.tex" "doc/tcad.tex" "doc/ug.tex")
509 (("^\\\\documentstyle\\[(.*)\\]\\{(.*)\\}"
510 all options class)
511 (string-append "\\documentclass[" options "]{"
512 class "}\n"
513 "\\usepackage{graphicx}\n"
514 "\\usepackage{robinspace}"))
515 (("\\\\setlength\\{\\\\footheight\\}\\{.*\\}" all)
516 (string-append "%" all))
517 (("\\\\setstretch\\{.*\\}" all)
518 (string-append "%" all)))))
519 (delete 'configure)
520 (add-before 'install 'clean-bin
521 (lambda _
522 (delete-file (string-append (getcwd) "/bin/README"))))
523 (add-before 'install 'make-pdf
524 (lambda _
525 (setenv "TEXMFVAR" "/tmp") ;For texlive font cache
526 (with-directory-excursion "doc"
527 (for-each (lambda (file)
528 (invoke "faketime"
529 "-f"
530 "1970-01-01 00:00:00"
531 "dvips" file "-o"))
532 (find-files "." "\\.dvi"))
533 (for-each (lambda (file)
534 (invoke "faketime"
535 "-f"
536 "1970-01-01 00:00:00"
537 "ps2pdf" file))
538 '("mtt.ps" "ug.ps" "tcad.ps"))
539 (invoke "make" "clean"))))
540 (replace 'install
541 (lambda _
542 (let* ((data (string-append #$output "/share"))
543 (bin (string-append #$output "/bin"))
544 (doc (string-append data "/doc/" #$name "-" #$version))
545 (examples (string-append doc "/examples")))
546 (with-directory-excursion "bin"
547 (for-each (lambda (f)
548 (install-file f bin))
549 (find-files "." ".*")))
550 (with-directory-excursion "doc"
551 (for-each (lambda (f)
552 (install-file f doc))
553 (find-files "." ".pdf")))
554 (copy-recursively "examples" examples)))))))
555 (home-page "https://www.rle.mit.edu/cpg/research_codes.htm")
556 (synopsis "Multipole-accelerated capacitance extraction program")
557 (description
558 "Fastcap is a capacitance extraction program based on a
559multipole-accelerated algorithm.")
560 (license (license:non-copyleft #f "See fastcap.c."))))
561
562(define-public fasthenry
563 (package
564 (name "fasthenry")
565 (version "3.0-12Nov96")
566 (source (origin
567 (method url-fetch)
568 (file-name (string-append name "-" version ".tar.gz"))
569 (uri (string-append
570 "http://www.rle.mit.edu/cpg/codes/" name
571 "-" version ".tar.z"))
572 (sha256
573 (base32 "1a06xyyd40zhknrkz17xppl2zd5ig4w9g1grc8qrs0zqqcl5hpzi"))
574 (patches (search-patches "fasthenry-spAllocate.patch"
575 "fasthenry-spBuild.patch"
576 "fasthenry-spUtils.patch"
577 "fasthenry-spSolve.patch"
578 "fasthenry-spFactor.patch"))))
579 (native-inputs (list gcc-7))
580 (build-system gnu-build-system)
581 (arguments
582 (list #:make-flags #~(list "CC=gcc" "RM=rm" "SHELL=sh" "all")
583 #:parallel-build? #f
584 #:tests? #f ;; no tests-suite
585 #:modules `((srfi srfi-1)
586 ,@%default-gnu-modules)
587 #:phases
588 #~(modify-phases %standard-phases
589 (delete 'configure)
590 (replace 'install
591 (lambda _
592 (let* ((data (string-append #$output "/share"))
593 (bin (string-append #$output "/bin"))
594 (doc (string-append data "/doc/"
595 #$name "-" #$version))
596 (examples (string-append doc "/examples")))
597 (with-directory-excursion "bin"
598 (for-each (lambda (f)
599 (install-file f bin))
600 (find-files "." ".*")))
601 (copy-recursively "doc" doc)
602 (copy-recursively "examples" examples)))))))
603 (home-page "https://www.rle.mit.edu/cpg/research_codes.htm")
604 (synopsis "Multipole-accelerated inductance analysis program")
605 (description
606 "Fasthenry is an inductance extraction program based on a
607multipole-accelerated algorithm.")
608 (license (license:non-copyleft #f "See induct.c."))))
609
610(define-public csxcad
611 (package
612 (name "csxcad")
613 (version "0.6.3")
614 (source
615 (origin
616 (method git-fetch)
617 (uri (git-reference
618 (url "https://github.com/thliebig/CSXCAD")
619 (commit (string-append "v" version))))
620 (file-name (git-file-name name version))
621 (sha256
622 (base32 "1c383zsv4fp40kmpawamfi9zg3b8x3d4m091ldwk15mii3467hp3"))))
623 (build-system cmake-build-system)
624 (arguments
625 (list
626 #:tests? #f ; No tests.
627 #:configure-flags
628 #~(list
629 (string-append "-DFPARSER_ROOT_DIR=" #$(this-package-input "fparser")))
630 #:phases
631 #~(modify-phases %standard-phases
632 (add-after 'unpack 'fix-cmake-and-sources
633 (lambda _
634 (substitute* "CMakeLists.txt"
635 ((" system\n")
636 "")
637 (("find_package\\(HDF5 1.8 COMPONENTS C HL REQUIRED\\)")
638 "find_package(HDF5 REQUIRED COMPONENTS C HL)"))
639 ;; Fix missing `std::`.
640 ;; This is fixed in upstream already but not tagged.
641 (substitute* "src/CSPropDiscMaterial.cpp"
642 (("\tcout ")
643 "\tstd::cout ")))))))
644 (inputs (list boost
645 cgal
646 eigen
647 fparser
648 hdf5
649 gmp
650 libjpeg-turbo
651 libpng
652 libtiff
653 lz4
654 mpfr
655 openmpi
656 tinyxml
657 vtk
658 zlib))
659 (home-page "https://github.com/thliebig/CSXCAD")
660 (synopsis "3D geometry library for C++")
661 (description
662 "@code{csxcad} is a C++ library to describe geometrical objects
663and their physical or non-physical properties for electromagnetics simulations.")
664 (license license:lgpl3+)))
665
666(define-public python-csxcad
667 (package
668 (inherit csxcad)
669 (name "python-csxcad")
670 (build-system pyproject-build-system)
671 (arguments
672 (list
673 ;; Tests are broken in v0.6.3.
674 ;; Check on update.
675 #:tests? #f
676 #:phases
677 #~(modify-phases %standard-phases
678 (add-before 'build 'prepare-build
679 (lambda _
680 (chdir "./python")
681 (setenv "CSXCAD_INSTALL_PATH"
682 #$(this-package-input "csxcad")))))))
683 (native-inputs (list python-minimal python-cython python-numpy
684 python-setuptools))
685 (inputs (list csxcad fparser hdf5 python-numpy tinyxml))
686 (synopsis "Python bindings for @code{csxcad}")
687 (description "Library for describing geometrical objects and their
688physical and non-physical properties.")
689 (license license:lgpl3+)))
690
691(define-public qcsxcad
692 (package
693 (name "qcsxcad")
694 (version "0.6.3")
695 (source
696 (origin
697 (method git-fetch)
698 (uri (git-reference
699 (url "https://github.com/thliebig/QCSXCAD")
700 (commit (string-append "v" version))))
701 (file-name (git-file-name name version))
702 (sha256
703 (base32 "0ag1shyhsmfsvqm35fi2kfnbcngmln8rjsv88f97gyx9wiqc808y"))))
704 (build-system qt-build-system)
705 (arguments
706 (list
707 #:tests? #f ;No tests.
708 #:qtbase qtbase ;For Qt 6
709 #:phases
710 #~(modify-phases %standard-phases
711 (add-after 'unpack 'fix-sources
712 ;; Fix missing `std::`-prefix and missing include.
713 ;; This is fixed in upstream but not tagged with a version.
714 (lambda _
715 (substitute* "vtkInteractorStyleRubberBand2DPlane.cpp"
716 (("#include \"vtkCamera.h\"")
717 "#include <iostream>\n#include \"vtkCamera.h\"")
718 (("\tcerr ")
719 "\tstd::cerr "))
720 (substitute* "VTKPrimitives.cpp"
721 (("#include \"VTKPrimitives.h\"")
722 "#include <iostream>\n#include \"VTKPrimitives.h\"")
723 (("\tcerr ")
724 "\tstd::cerr ")
725 (("\tcout ")
726 "\tstd::cout "))
727 (substitute* "QVTKStructure.cpp"
728 (("#include \"QVTKStructure.h\"")
729 "#include <iostream>\n#include \"QVTKStructure.h\"")
730 (("\tcerr ")
731 "\tstd::cerr ")
732 (("\tcout ")
733 "\tstd::cout ")))))))
734 (inputs (list boost
735 cgal
736 csxcad
737 eigen
738 freetype
739 gmp
740 libjpeg-turbo
741 libpng
742 libtiff
743 lz4
744 openmpi
745 qt5compat
746 tinyxml
747 vtk))
748 (home-page "https://github.com/thliebig/QCSXCAD")
749 (synopsis "GUI library for @code{csxcad}")
750 (description
751 "GUI library for @code{csxcad} --- a library for describing geometrical
752 objects and their properties. This library is used in @code{appcsxcad}
753 which provides a standalone graphical frontend to @{csxcad}.")
754 (license license:lgpl3+)))
755
756(define-public appcsxcad
757 (package
758 (name "appcsxcad")
759 (version "0.2.3")
760 (source
761 (origin
762 (method git-fetch)
763 (uri (git-reference
764 (url "https://github.com/thliebig/AppCSXCAD")
765 (commit (string-append "v" version))))
766 (file-name (git-file-name name version))
767 (sha256
768 (base32 "145awcsg4vl2xmrh5yf9fcasmghrai3x6ivgdxmrm1w3v9gyaccf"))))
769 (build-system qt-build-system)
770 (arguments
771 (list
772 #:qtbase qtbase ;for Qt 6
773 #:tests? #f)) ;No tests.
774 (inputs (list boost
775 cgal
776 csxcad
777 eigen
778 expat
779 freetype
780 gmp
781 hdf5
782 libjpeg-turbo
783 libpng
784 libtiff
785 lz4
786 openmpi
787 qcsxcad
788 tinyxml
789 vtk))
790 (home-page "https://github.com/thliebig/AppCSXCAD")
791 (synopsis "Minimal GUI application for the @code{qcsxcad} library")
792 (description
793 "A minimal application for the @code{qcsxcad} library which is used to
794 describe geometrical objects and their physical and non-physical properties.")
795 (license license:gpl3)))
796
797(define-public openems
798 (package
799 (name "openems")
800 (version "0.0.36")
801 (source
802 (origin
803 (method git-fetch)
804 (uri (git-reference
805 (url "https://github.com/thliebig/openEMS")
806 (commit (string-append "v" version))))
807 (file-name (git-file-name name version))
808 (sha256
809 (base32 "1vxlknnji7kha0kabpjqh48i4r0rqlla9gcxhn69d0gcw76albmw"))))
810 (build-system cmake-build-system)
811 (arguments
812 (list
813 #:configure-flags
814 #~(list (string-append "-DCSXCAD_ROOT_DIR="
815 #$(this-package-input "csxcad"))
816 (string-append "-DFPARSER_ROOT_DIR="
817 #$(this-package-input "fparser")))
818 #:phases
819 #~(modify-phases %standard-phases
820 (add-after 'unpack 'fix-cmake
821 (lambda _
822 (substitute* "CMakeLists.txt"
823 ((" system\n") "")
824 (("find_package\\(HDF5 1.8 COMPONENTS C HL REQUIRED\\)")
825 "find_package(HDF5 1.8 REQUIRED)"))))
826 (delete 'check)
827 (add-after 'install 'check
828 (lambda* (#:key tests? source inputs #:allow-other-keys)
829 (when tests?
830 (let* ((testsuite (string-append source "/TESTSUITE"))
831 (testsuite-tmp "/tmp/openEMS-TESTSUITE"))
832 ;; Testsuite directory needs to be writable.
833 (copy-recursively testsuite testsuite-tmp)
834 (invoke "octave" "--no-gui" "--eval"
835 (string-append
836 "addpath('" #$output "/share/openEMS/matlab');"
837 "addpath('"
838 (search-input-directory inputs "share/CSXCAD/matlab")
839 "');"
840 ;; Work around bug in test script.
841 "addpath('" testsuite-tmp "/helperscripts');"
842 "run('" testsuite-tmp "/run_testsuite.m');")))))))))
843 (native-inputs (list cmake-minimal octave pkg-config))
844 (inputs (list boost
845 csxcad
846 fparser
847 hdf5
848 openmpi
849 tinyxml
850 vtk))
851 (home-page "https://www.openems.de")
852 (synopsis "Electromagnetic field solver")
853 (description "@code{OpenEMS} is an electromagnetic field solver using
854the @acronym{FDTD, Finite-Difference Time-Domain} method.")
855 (license license:gpl3+)))
856
857(define-public python-openems
858 (package
859 (inherit openems)
860 (name "python-openems")
861 (build-system pyproject-build-system)
862 (arguments
863 (list
864 #:tests? #f ; No tests. Check again on package upgrade.
865 #:phases
866 #~(modify-phases %standard-phases
867 (add-after 'unpack 'fix-sources
868 ;; Check if this is still needed on upgrade.
869 (lambda _
870 (substitute* "python/openEMS/_nf2ff.pxd"
871 (("cimport cython.numeric")
872 "import cython
873from cython cimport numeric"))))
874 (add-before 'build 'prepare-build
875 (lambda* _
876 (chdir "./python")
877 (setenv "CSXCAD_INSTALL_PATH"
878 #$(this-package-input "csxcad"))
879 (setenv "OPENEMS_INSTALL_PATH"
880 #$(this-package-input "openems")))))))
881 (native-inputs (list python-cython python-setuptools))
882 (inputs (list csxcad
883 fparser
884 openems
885 python-csxcad
886 python-hdf5storage
887 python-numpy
888 tinyxml))
889 (home-page "https://www.openems.de")
890 (synopsis "Python API for the electromagnetic field solver @code{OpenEMS}")
891 (description "@code{OpenEMS} is an electromagnetic field solver using
892the @acronym{FDTD, Finite-Difference Time-Domain} method.")
893 (license license:gpl3+)))
894
895(define-public fritzing
896 (package
897 (name "fritzing")
898 (version "0.9.6")
899 (source
900 (origin
901 (method git-fetch)
902 (uri (git-reference
903 (url "https://github.com/fritzing/fritzing-app")
904 (commit version)))
905 (file-name (git-file-name name version))
906 (sha256
907 (base32 "083nz7vj7a334575smjry6257535h68gglh8a381xxa36dw96aqs"))
908 (patches (search-patches "fritzing-0.9.6-fix-types.patch"))))
909 (build-system gnu-build-system)
910 (arguments
911 (list
912 #:phases
913 #~(modify-phases %standard-phases
914 (add-after 'unpack 'patch-files
915 (lambda _
916 ;; Trick the internal mechanism to load the parts
917 (substitute* "src/version/partschecker.cpp"
918 ((".*git_libgit2_init.*")
919 "return \"083nz7vj7a334575smjry6257535h68gglh8a381xxa36dw96aqs\";"))
920 (substitute* "src/utils/textutils.cpp"
921 (("QUuid::createUuid\\(\\)") "QUuid()"))))
922 (replace 'configure
923 (lambda _
924 ;; Integrate parts library
925 (copy-recursively
926 (string-append #$(this-package-native-input "fritzing-parts")
927 "/share/library")
928 "parts")
929 ;; Use system libgit2 and boost.
930 (substitute* "phoenix.pro"
931 (("^LIBGIT_STATIC.*")
932 (string-append
933 "LIBGIT2INCLUDE=" #$(this-package-input "libgit2") "/include\n"
934 "LIBGIT2LIB=" #$(this-package-input "libgit2") "/lib\n"
935 "INCLUDEPATH += $$LIBGIT2INCLUDE\n"
936 "LIBS += -L$$LIBGIT2LIB -lgit2\n"))
937 (("^.*pri/libgit2detect.pri.") ""))
938 (invoke "qmake"
939 (string-append "QMAKE_LFLAGS_RPATH=-Wl,-rpath," #$output "/lib")
940 (string-append "PREFIX=" #$output)
941 "phoenix.pro")))
942 (add-after 'install 'generate-parts-db
943 (lambda* (#:key outputs #:allow-other-keys)
944 (let ((out (assoc-ref outputs "out"))
945 (env-qt-qpa-platform (getenv "QT_QPA_PLATFORM"))
946 (env-qt-hash-seed (getenv "QT_HASH_SEED")))
947 (setenv "QT_QPA_PLATFORM" "offscreen")
948 (setenv "QT_HASH_SEED" "0")
949 (invoke (string-append out "/bin/Fritzing")
950 "-db" (string-append out "/share/fritzing/parts/parts.db")
951 "-folder" (string-append out "/share/fritzing"))
952 (setenv "QT_QPA_PLATFORM" env-qt-qpa-platform)
953 (setenv "QT_HASH_SEED" env-qt-hash-seed)))))))
954 (native-inputs
955 (list fritzing-parts))
956 (inputs
957 (list boost
958 libgit2
959 qtbase-5
960 qtserialport-5
961 qtsvg-5
962 zlib))
963 (home-page "https://fritzing.org")
964 (synopsis "Electronic circuit design")
965 (description
966 "The Fritzing application is @dfn{Electronic Design Automation} (EDA)
967software with a low entry barrier, suited for the needs of makers and
968hobbyists. It offers a unique real-life \"breadboard\" view, and a parts
969library with many commonly used high-level components. Fritzing makes it very
970easy to communicate about circuits, as well as to turn them into PCB layouts
971ready for production.")
972 ;; Documentation and parts are released under CC-BY-SA 3.0; source code is
973 ;; released under GPLv3+.
974 (license (list license:gpl3+ license:cc-by-sa3.0))))
975
976(define-public fritzing-parts
977 ;; XXX: Release of the parts stopped in 2016 and it looks like develop
978 ;; branch has latest changes comparing to other branches.
979 (let ((commit "d61d63de9294343b1b6e86f149e78e4b1d3a0009")
980 (revision "0"))
981 (package
982 (name "fritzing-parts")
983 (version (git-version "0.9.6" revision commit))
984 (source
985 (origin
986 (method git-fetch)
987 (uri (git-reference
988 (url "https://github.com/fritzing/fritzing-parts")
989 (commit commit)))
990 (file-name (git-file-name "fritzing-parts" version))
991 (sha256
992 (base32 "0g39ja1aqw5qx8alf61m6zcy6y78j9ky556x6x1cnd6g7kkzd861"))))
993 (build-system copy-build-system)
994 (arguments
995 (list
996 #:install-plan
997 #~'(("." "share/library/"
998 #:exclude-regexp (".github.*"
999 ".gitignore"
1000 "CONTRIBUTING.md"
1001 "LICENSE.txt"
1002 "README.md")))
1003 #:modules '(((guix build gnu-build-system) #:prefix gnu:)
1004 (guix build copy-build-system)
1005 (guix build utils)
1006 (ice-9 match))))
1007 (home-page "https://fritzing.org")
1008 (synopsis "Electronic components (parts library) for use in the Fritzing app")
1009 (description "This package contains all part definitions that are
1010required for Fritzing app.")
1011 (license license:cc-by-sa3.0))))
1012
1013(define-public qelectrotech
1014 (package
1015 (name "qelectrotech")
1016 (version "0.9.0")
1017 (source
1018 (origin
1019 (method git-fetch)
1020 (uri (git-reference
1021 (url "https://github.com/qelectrotech/qelectrotech-source-mirror")
1022 (commit version)))
1023 (file-name (git-file-name name version))
1024 (sha256
1025 (base32 "17rrr9l11wc2ni3pxybq595dc4l1lklaba7rd562r8qc00f5r7zl"))))
1026 (build-system qt-build-system)
1027 (arguments
1028 ;; XXX: tests are built for the CMake build option but it seems to be
1029 ;; broken in 0.8.0.
1030 (list #:tests? #f
1031 #:modules '((guix build qt-build-system)
1032 ((guix build gnu-build-system) #:prefix gnu:)
1033 (guix build utils))
1034 #:phases
1035 #~(modify-phases %standard-phases
1036 (replace 'configure
1037 (lambda _
1038 ;; Patch hardcoded path before running qmake.
1039 (substitute* "qelectrotech.pro"
1040 (("\\/usr\\/local") #$output))
1041 (invoke "qmake")))
1042 (replace 'build (assoc-ref gnu:%standard-phases 'build))
1043 (replace 'install (assoc-ref gnu:%standard-phases 'install)))))
1044 (native-inputs
1045 (list pkg-config qttools-5))
1046 (inputs
1047 (list kcoreaddons-5 kwidgetsaddons-5 qtbase-5 qtsvg-5 qtwayland-5 sqlite))
1048 (home-page "https://qelectrotech.org/")
1049 (synopsis "CAD/CAE editor focusing on schematics drawing features")
1050 (description "QElectroTech, or QET in short, is a desktop application to
1051create diagrams and schematics. The software is primarily intended to create
1052electrical documentation but it can also be used to draw any kinds of diagrams,
1053such as those made in pneumatics, hydraulics, process industries, electronics,
1054and others.")
1055 (license license:gpl2+)))
1056
1057(define-public translate2geda
1058 ;; There has been no formal release yet.
1059 (let ((commit "2ec576e608a6f6eead5f6bc1952234d9874703c7")
1060 (revision "2"))
1061 (package
1062 (name "translate2geda")
1063 (version (git-version "0" revision commit))
1064 (source (origin
1065 (method git-fetch)
1066 (uri (git-reference
1067 (url "https://github.com/erichVK5/translate2geda")
1068 (commit commit)))
1069 (file-name (git-file-name name version))
1070 (sha256
1071 (base32
1072 "0pcwbnp25fjzznzw97d233awa4j0sdfi06wza45rsp8nx1ri7a7k"))))
1073 (build-system ant-build-system)
1074 (arguments
1075 (list #:tests? #f ; there are no tests
1076 #:jar-name "translate2geda.jar"
1077 #:source-dir "."
1078 #:main-class "translate2geda"
1079 #:phases
1080 #~(modify-phases %standard-phases
1081 (add-after 'install 'install-bin
1082 (lambda _
1083 (let* ((bin (string-append #$output "/bin"))
1084 (wrapper (string-append bin "/translate2geda"))
1085 (jar "/share/java/translate2geda.jar"))
1086 (mkdir-p bin)
1087 (with-output-to-file wrapper
1088 (lambda _
1089 (format #t
1090 "#!/bin/sh~%exec ~a -jar ~a~a~%"
1091 (which "java")
1092 #$output
1093 jar)))
1094 (chmod wrapper #o555)))))))
1095 (home-page "https://github.com/erichVK5/translate2geda")
1096 (synopsis "Utility for converting symbol and footprint formats to gEDA")
1097 (description
1098 "This package provides a utility for converting Kicad (@file{.mod},
1099@file{.lib}), Eagle (@file{.lbr}), gerber (@file{.gbr}, etc..),
1100BXL (@file{.bxl}), IBIS (@file{.ibs}), symdef, LT-Spice (@file{.asc}),
1101QUCS (@file{.sch}), and BSDL (@file{.bsd}) symbols and footprints and EggBot
1102fonts to gEDA.")
1103 (license license:gpl2+))))
1104
1105(define-public libfive
1106 (let ((commit "b1ea998d8adb3884ab52798f7388f4354145f452")
1107 (revision "5"))
1108 (package
1109 (name "libfive")
1110 (version (git-version "0" revision commit))
1111 (source (origin
1112 (method git-fetch)
1113 (uri (git-reference
1114 (url "https://github.com/libfive/libfive")
1115 (commit commit)))
1116 (sha256
1117 (base32
1118 "0j91qq9d7949d2zs5wxyqd0ly644nb5690s8xnr6pchjl9z6pqxv"))
1119 (file-name (git-file-name name version))))
1120 (build-system cmake-build-system)
1121 (arguments
1122 (list
1123 #:tests? #f ; Several tests fail due to floating point error.
1124 #:imported-modules `((guix build guile-build-system)
1125 ,@%cmake-build-system-modules)
1126 #:modules '((guix build cmake-build-system)
1127 ((guix build guile-build-system) #:prefix guile:)
1128 (guix build utils))
1129 #:configure-flags #~(list
1130 (string-append
1131 "-DPYTHON_SITE_PACKAGES_DIR="
1132 #$output "/lib/python"
1133 #$(version-major+minor
1134 (package-version
1135 (this-package-input "python-wrapper")))
1136 "/site-packages"))
1137 #:phases
1138 #~(modify-phases %standard-phases
1139 (add-after 'unpack 'remove-native-compilation
1140 (lambda _
1141 (substitute* "CMakeLists.txt" (("-march=native") ""))))
1142 (add-after 'unpack 'remove-environment-variable-override
1143 (lambda _
1144 (substitute* "studio/src/guile/interpreter.cpp"
1145 (("qputenv\\(\"GUILE_LOAD_COMPILED_PATH\".*") ""))))
1146 (add-after 'unpack 'fix-library-location
1147 (lambda _
1148 (substitute* "libfive/bind/guile/libfive/lib.scm"
1149 (("\\(get-environment-variable \"LIBFIVE_FRAMEWORK_DIR\"\\)" m)
1150 (string-append m "\n\"" #$output "/lib/\""))
1151 (("\\(get-environment-variable \"LIBFIVE_STDLIB_DIR\"\\)" m)
1152 (string-append m "\n\"" #$output "/lib/\"")))
1153 (substitute* "libfive/bind/python/libfive/ffi.py"
1154 (("os.environ.get\\('LIBFIVE_FRAMEWORK_DIR'\\)" m)
1155 (string-append m " or \"" #$output "/lib/\"")))))
1156 (add-before 'build 'generate-bindings
1157 (lambda _
1158 ;; These files already exist but we regenerate them from source
1159 (with-directory-excursion "../source/libfive/stdlib"
1160 (substitute* '("gen_scm.py" "gen_c.py" "gen_py.py")
1161 (("datetime.now\\(\\)\\.strftime\\([^)]+)") "\"N/A\"")
1162 (("os\\.getlogin\\(\\)") "\"guix\""))
1163 (invoke "python" "gen_scm.py")
1164 (invoke "python" "gen_c.py")
1165 (invoke "python" "gen_py.py"))))
1166 (add-after 'unpack 'do-not-build-guile-bindings
1167 (lambda _
1168 (delete-file "libfive/bind/guile/CMakeLists.txt")
1169 (call-with-output-file
1170 "libfive/bind/guile/CMakeLists.txt"
1171 (lambda (port)
1172 (display "add_custom_target(libfive-guile)\n" port)))))
1173 (add-after 'build 'guile-build
1174 (lambda args
1175 (apply (assoc-ref guile:%standard-phases 'build)
1176 #:source-directory "../source/libfive/bind/guile"
1177 #:compile-flags '()
1178 #:parallel-build? #f
1179 #:scheme-file-regexp #$default-scheme-file-regexp
1180 #:not-compiled-file-regexp #f
1181 args)))
1182 (add-after 'install 'wrap-studio
1183 (lambda _
1184 (let* ((effective-version (guile:target-guile-effective-version))
1185 (scm (string-append #$output "/share/guile/site/"
1186 effective-version))
1187 (go (string-append #$output "/lib/guile/"
1188 effective-version "/site-ccache"))
1189 (py (string-append #$output "/lib/python"
1190 #$(version-major+minor
1191 (package-version
1192 (this-package-input "python-wrapper")))
1193 "/site-packages")))
1194 (wrap-program (string-append #$output "/bin/Studio")
1195 `("GUILE_LOAD_PATH" ":" prefix (,scm))
1196 `("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go))
1197 `("GUIX_PYTHONPATH" ":" prefix (,py)))))))))
1198 (native-inputs
1199 (list pkg-config))
1200 (inputs
1201 (list bash-minimal boost eigen guile-3.0 libpng python-wrapper qtbase))
1202 (home-page "https://libfive.com")
1203 (synopsis "Tool for programmatic computer-aided design")
1204 (description
1205 "Libfive is a tool for programmatic computer-aided design (CAD). In
1206libfive, solid models are defined as Scheme or Python scripts, and there are
1207no opaque function calls into the geometry kernel: everything is visible to
1208the user. Even fundamental, primitive shapes are represented as code in the
1209user-level language.")
1210 (license (list license:mpl2.0 ;library
1211 license:gpl2+)) ;Guile bindings and GUI
1212
1213 ;; Mark as tunable to take advantage of SIMD code in Eigen.
1214 (properties '((tunable? . #t))))))
1215
1216;; TODO: Keep in sync with radare2.
1217(define-public iaito
1218 (package
1219 (name "iaito")
1220 (version "6.2.0")
1221 (source (origin
1222 (method git-fetch)
1223 (uri (git-reference
1224 (url "https://github.com/radareorg/iaito")
1225 (commit version)))
1226 (sha256
1227 (base32
1228 "0x4jyzb5jn0hlylh2mayjymrsaj87x7rdbf85m7fhqd623001xjf"))
1229 (file-name (git-file-name name version))))
1230 (build-system gnu-build-system)
1231 (arguments
1232 (list
1233 #:tests? #f ;no tests
1234 #:modules '((guix build gnu-build-system) (guix build qt-utils)
1235 (guix build utils))
1236 #:imported-modules `((guix build qt-utils)
1237 ,@%default-gnu-imported-modules)
1238 #:phases
1239 #~(modify-phases %standard-phases
1240 ;; The build system assumes the sdb lib is installed alongside
1241 ;; radare2. We already patch the radare2 package to use a
1242 ;; system-installed sdb rather than install its own, so we must
1243 ;; propagate those changes here.
1244 (add-before 'configure 'add-sdb-libs
1245 (lambda _
1246 (substitute* '("./src/lib_radare2.pri")
1247 (("pkg-config --libs r_core" all)
1248 (string-append all " sdb")))))
1249 (add-after 'install 'wrap-qt
1250 (lambda* (#:key inputs outputs #:allow-other-keys)
1251 (wrap-all-qt-programs #:outputs outputs
1252 #:inputs inputs
1253 #:qtbase (assoc-ref inputs "qtbase")))))))
1254 (inputs
1255 (list qtbase
1256 qtsvg
1257 qtwayland
1258 radare2))
1259 (native-inputs
1260 (list pkg-config python-minimal-wrapper))
1261 (native-search-paths (list (search-path-specification
1262 (variable "R2_LIBR_PLUGINS")
1263 (files (list "lib/radare2"))
1264 (separator #f)))) ;single value
1265 (home-page "https://github.com/radareorg/iaito")
1266 (synopsis "Official radare2 GUI")
1267 (description "Iaito is the official graphical interface for radare2, a
1268libre reverse engineering framework. Iaito focuses on simplicity, parity with
1269commands, features, and keybindings.")
1270 (license license:gpl3+)))
1271
1272(define-public inspekt3d
1273 (let ((commit "703f52ccbfedad2bf5240bf8183d1b573c9d54ef")
1274 (revision "0"))
1275 (package
1276 (name "inspekt3d")
1277 (version (git-version "0" revision commit))
1278 (source (origin
1279 (method git-fetch)
1280 (uri (git-reference
1281 (url "https://gitlab.com/kavalogic-inc/inspekt3d.git")
1282 (commit commit)))
1283 (file-name (git-file-name name version))
1284 (sha256
1285 (base32
1286 "0lan6930g5a9z4ack9jj0zdd0mb2s6q2xzpiwcjdc3pvl9b1nbw4"))
1287 (modules '((guix build utils)))
1288 ;; Allow builds with Guile 3.0.
1289 (snippet
1290 '(substitute* "configure.ac"
1291 (("2\\.2") "3.0 2.2")))))
1292 (build-system gnu-build-system)
1293 (arguments
1294 (list
1295 #:phases
1296 #~(modify-phases %standard-phases
1297 (add-after 'unpack 'patch-libfive-guile-location
1298 (lambda _
1299 (substitute* "inspekt3d/library.scm"
1300 (("\\(load-extension \"libfive-guile\" \"scm_init_libfive_modules\"\\)") "#t")
1301 (("\"libfive-guile")
1302 (string-append "\""
1303 #$(this-package-input "libfive")
1304 "/lib/libfive-stdlib"))))))))
1305 (native-inputs
1306 (list autoconf automake pkg-config))
1307 (inputs
1308 (list mesa guile-3.0))
1309 (propagated-inputs
1310 `(("libfive" ,libfive)
1311 ("guile-opengl" ,guile3.0-opengl)))
1312 (home-page "https://gitlab.com/kavalogic-inc/inspekt3d/")
1313 (synopsis "Lightweight 3D viewer for Libfive written in Guile Scheme")
1314 (description
1315 "Inspekt3d is a lightweight 3D viewer for Libfive written in Guile Scheme.
1316The viewer can be used interactively with a REPL (for example Geiser in
1317Emacs).")
1318 (license license:gpl3+))))
1319
1320(define-public librseq
1321 ;; There's no release.
1322 (let ((commit "c3ed6b64bbe1944bd8de8b9fde14e7c290f02a90")
1323 (revision "2"))
1324 (package
1325 (name "librseq")
1326 (version (git-version "0.0.0" revision commit))
1327 (source (origin
1328 (method git-fetch)
1329 (uri (git-reference
1330 (url "https://github.com/compudj/librseq.git")
1331 (commit commit)))
1332 (file-name (git-file-name name version))
1333 (sha256
1334 (base32
1335 "046lrfw87gjbr4rvs054s6wk22c4xcmrcww04wkpnxmy5vp33mk3"))))
1336 (build-system gnu-build-system)
1337 (inputs
1338 (list numactl))
1339 (native-inputs
1340 (list autoconf
1341 automake
1342 libtool
1343 pkg-config))
1344 (home-page "https://github.com/compudj/librseq")
1345 (synopsis "Userspace library for restartable sequences")
1346 (description "A restartable sequence is a critical region delimited by a
1347program where if its execution is preempted or interrupted, the kernel will
1348divert the program control flow to a defined abort handler. They are a good
1349alternative to atomic operations for critical fast paths and are usually used
1350in the context of per-cpu data. The library offers ABI headers to interface
1351with the kernel and various utilities such as per-cpu counters.")
1352 (license (list license:lgpl2.1 license:expat)))))
1353
1354(define-public valeronoi
1355 (package
1356 (name "valeronoi")
1357 (version "0.3.1")
1358 (source
1359 (origin
1360 (method git-fetch)
1361 (uri (git-reference
1362 (url "https://github.com/ccoors/Valeronoi")
1363 (commit (string-append "v" version))))
1364 (file-name (git-file-name name version))
1365 (sha256
1366 (base32 "11avqrxrzbcrw1dz38hlifl5r7l4qfvlbyn4ln7b2jjmgwqcmh6y"))
1367 (snippet #~(begin
1368 (use-modules (guix build utils))
1369 (with-directory-excursion "3rdparty"
1370 (delete-file "catch.hpp")
1371 (delete-file "LICENSE_1_0.txt"))
1372 (with-directory-excursion "tests"
1373 (substitute* '("test_colormap.cpp"
1374 "test_main.cpp"
1375 "test_wifi_information.cpp"
1376 "test_robot_map.cpp"
1377 "test_measurements.cpp"
1378 "test_wifi_collection.cpp"
1379 "test_segment_generator.cpp")
1380 (("catch\\.hpp")
1381 "catch2/catch.hpp")))))))
1382 (build-system qt-build-system)
1383 (arguments
1384 (list #:qtbase qtbase
1385 #:phases
1386 #~(modify-phases %standard-phases
1387 (replace 'check
1388 (lambda* (#:key tests? #:allow-other-keys)
1389 (when tests?
1390 (invoke "./valeronoi-tests")))))))
1391 (inputs (list boost
1392 cgal
1393 gmp
1394 libxkbcommon
1395 mpfr
1396 openssl
1397 qtbase
1398 qtsvg
1399 qtwayland))
1400 (native-inputs (list catch2-2))
1401 (home-page "https://github.com/ccoors/Valeronoi")
1402 (synopsis "WiFi mapping companion application for Valetudo")
1403 (description
1404 "Valeronoi (Valetudo + Voronoi) is a companion for Valetudo for generating
1405WiFi signal strength maps. It visualizes them using a Voronoi diagram.")
1406 (license (list license:gpl3+
1407 ;; License for the included "3rdparty/mdns.h"
1408 license:public-domain))))
1409
1410(define-public volk
1411 (package
1412 (name "volk")
1413 (version "3.3.0")
1414 (source
1415 (origin
1416 (method git-fetch)
1417 (uri (git-reference
1418 (url "https://github.com/gnuradio/volk")
1419 (commit (string-append "v" version))
1420 (recursive? #t))) ; for cpu_features git submodule
1421 (file-name (git-file-name name version))
1422 (sha256
1423 (base32 "1b6q7z971myih3q88lv01iwmwsjln7wibav365j7phnclr9hg41i"))))
1424 (build-system cmake-build-system)
1425 (arguments
1426 (list
1427 #:phases
1428 #~(modify-phases %standard-phases
1429 (add-after 'unpack 'disable-check-lgpl-test
1430 ;; Disable the failing check-lgpl test that is supposed to be run
1431 ;; only by upstream developers to check the authors and licenses
1432 ;; of contributions in the git history.
1433 (lambda _
1434 (substitute* "scripts/licensing/count_contrib.sh"
1435 (("#!/bin/bash" all)
1436 (string-append all "\nexit 0")))))
1437 (add-after 'install 'remove-static-libraries
1438 ;; Remove libcpu_features.a (and any others that might appear).
1439 (lambda _
1440 (for-each delete-file
1441 (find-files (string-append #$output "/lib")
1442 "\\.a$"
1443 #:fail-on-error? #t))))
1444 (add-after 'install 'wrap-pythonpath
1445 (lambda* (#:key inputs outputs #:allow-other-keys)
1446 (let* ((python (assoc-ref inputs "python"))
1447 (file (string-append #$output "/bin/volk_modtool"))
1448 (path (string-append
1449 #$output
1450 "/lib/python"
1451 #$(version-major+minor (package-version python))
1452 "/site-packages:"
1453 (getenv "GUIX_PYTHONPATH"))))
1454 (wrap-program file
1455 `("GUIX_PYTHONPATH" ":" prefix (,path))
1456 `("PATH" ":" prefix
1457 (,(string-append python "/bin:"))))))))))
1458 (inputs
1459 (list bash-minimal ;for wrap-program
1460 boost
1461 fmt
1462 python-wrapper
1463 python-mako))
1464 (home-page "https://www.libvolk.org/")
1465 (synopsis "Vector-Optimized Library of Kernels")
1466 (description
1467 "@acronym{VOLK, Vector-Optimized Library of Kernels} contains procedures
1468with machine-specific optimizations for mathematical functions. It also
1469provides a machine-independent interface to select the best such procedures to
1470use on a given system.")
1471 (license (list license:asl2.0 ; cpu_features
1472 license:lgpl3+))))
1473
1474(define-public libredwg
1475 (package
1476 (name "libredwg")
1477 (version "0.13.3")
1478 (source
1479 (origin
1480 (method url-fetch)
1481 (uri (string-append "mirror://gnu/libredwg/libredwg-"
1482 version ".tar.xz"))
1483 (sha256
1484 (base32 "0vl1x20zw4nafw86f98w5i5sry7krvj20igzh6j7fivlibkzdwc3"))))
1485 (build-system gnu-build-system)
1486 (arguments
1487 (list
1488 #:configure-flags
1489 #~(list "--disable-bindings"
1490 "--disable-write" ;check fails, see README
1491 #$(string-append "CFLAGS="
1492 " -Wno-error=implicit-function-declaration"))))
1493 (native-inputs
1494 (list libxml2
1495 parallel
1496 perl
1497 pkg-config
1498 python-wrapper))
1499 (inputs
1500 (list pcre2))
1501 (home-page "https://www.gnu.org/software/libredwg/")
1502 (synopsis "C library to handle DWG (CAD-related) files")
1503 (description
1504 "GNU LibreDWG is a C library to handle DWG files. It aims to be a free
1505replacement for the OpenDWG libraries.")
1506 (license license:gpl3+)))
1507
1508(define-public microcom
1509 (package
1510 (name "microcom")
1511 (version "2025.11.0")
1512 (source
1513 (origin
1514 (method git-fetch)
1515 (uri (git-reference
1516 (url "https://git.pengutronix.de/git/tools/microcom.git")
1517 (commit (string-append "v" version))))
1518 (file-name (git-file-name name version))
1519 (sha256
1520 (base32 "082q2jynycdj8wrkpd8azdwdfh9vhj4mpzarg444mw5zx3x972fn"))))
1521 (build-system gnu-build-system)
1522 (inputs (list readline))
1523 (native-inputs (list automake autoconf))
1524 (home-page "https://git.pengutronix.de/cgit/tools/microcom")
1525 (synopsis "Minimalistic serial line terminal program")
1526 (description
1527 "Microcom is a minimalistic terminal program for accessing devices
1528via a serial connection. It features connection via RS232 serial interfaces
1529(including setting of transfer rates) as well as in @code{telnetmode} as
1530specified in rfc2217 and a (Linux specific) CAN mode.")
1531 (license license:gpl2+)))
1532
1533(define-public minicom
1534 (package
1535 (name "minicom")
1536 (version "2.11.1")
1537 (source
1538 (origin
1539 (method git-fetch)
1540 (uri (git-reference
1541 (url "https://salsa.debian.org/minicom-team/minicom.git")
1542 (commit version)))
1543 (sha256
1544 (base32 "15k20qbxrjdxadwzkp31hjy7apdasrsgs532kwmlkpzs92ff4ghs"))
1545 (file-name (git-file-name name version))))
1546 (build-system gnu-build-system)
1547 (arguments
1548 (list
1549 #:configure-flags
1550 #~(list "--enable-lock-dir=/var/lock")
1551 #:phases
1552 #~(modify-phases %standard-phases
1553 (add-after 'unpack 'make-git-checkout-writable
1554 (lambda _
1555 (for-each make-file-writable (find-files "."))))
1556 (replace 'bootstrap
1557 ;; autogen.sh needlessly hard-codes aclocal-1.14.
1558 (lambda _
1559 (invoke "autoreconf" "-vif")))
1560 (add-before 'configure 'patch-lock-check
1561 (lambda _
1562 (substitute* "configure"
1563 (("test -d [$]UUCPLOCK") "true")))))))
1564 (native-inputs
1565 (list autoconf-2.71 automake gettext-minimal pkg-config))
1566 (inputs
1567 (list ncurses/tinfo))
1568 (home-page "https://salsa.debian.org/minicom-team/minicom")
1569 (synopsis "Serial terminal emulator")
1570 (description "@code{minicom} is a serial terminal emulator.")
1571 (license license:gpl2+)))
1572
1573(define-public sterm
1574 (package
1575 (name "sterm")
1576 (version "20200306")
1577 (source (origin
1578 (method git-fetch)
1579 (uri (git-reference
1580 (url "https://github.com/wentasah/sterm")
1581 (commit version)))
1582 (file-name (git-file-name name version))
1583 (sha256
1584 (base32
1585 "031pd8yz2bfzqbari6za1c3xcqmw94ap4vbrjzb3v6izjcrca58c"))))
1586 (build-system gnu-build-system)
1587 (arguments
1588 `(#:tests? #f ; no tests
1589 #:make-flags
1590 (list (string-append "CC=" ,(cc-for-target))
1591 (string-append "PREFIX=" %output))
1592 #:phases
1593 (modify-phases %standard-phases (delete 'configure))))
1594 (synopsis "Simple serial terminal")
1595 (description "This is a minimalist terminal program like minicom or cu.
1596The only thing it does is creating a bidirectional connection between
1597stdin/stdout and a terminal device (e.g. serial line).
1598It can also set serial line baudrate, manipulate DTR/RTS modem lines,
1599send break and throttle transmission speed.")
1600 (home-page "https://github.com/wentasah/sterm")
1601 (license license:gpl3+)))
1602
1603(define-public libmodbus
1604 (package
1605 (name "libmodbus")
1606 (version "3.1.11")
1607 (source (origin
1608 (method git-fetch)
1609 (uri (git-reference
1610 (url "https://github.com/stephane/libmodbus")
1611 (commit (string-append "v" version))))
1612 (file-name (git-file-name name version))
1613 (sha256
1614 (base32
1615 "15rqrzamlp6cvixz6klnawlc9s3w34bapc1fs2c4amwyvi3n5xvp"))
1616 ;; The patch removes a test that requires networking.
1617 ;; See <https://github.com/stephane/libmodbus/issues/802>
1618 (patches
1619 (search-patches "libmodbus-disable-networking-test.patch"))))
1620 (build-system gnu-build-system)
1621 (native-inputs (list autoconf psmisc automake libtool))
1622 (synopsis "Library for the Modbus protocol")
1623 (description "@code{libmodbus} is a library to send/receive data with a
1624device which respects the Modbus protocol. This library can use a serial port
1625or an Ethernet connection.")
1626 (home-page "https://libmodbus.org/")
1627 (license license:lgpl2.1+)))
1628
1629(define-public harminv
1630 (package
1631 (name "harminv")
1632 (version "1.4.2")
1633 (source (origin
1634 (method url-fetch)
1635 (uri
1636 (string-append "https://github.com/stevengj/harminv/"
1637 "releases/download/v" version "/"
1638 name "-" version ".tar.gz"))
1639 (sha256
1640 (base32
1641 "18n71d3wj0jnldh72vb9lfj3vv64s1i2rmnhcpq4494p23vip6js"))))
1642 (build-system gnu-build-system)
1643 (arguments
1644 `(#:configure-flags '("--enable-shared")
1645 #:phases
1646 (modify-phases %standard-phases
1647 (add-before 'configure 'fix-tests
1648 (lambda _
1649 (substitute* "./sines-test.sh"
1650 ; change test frequency range - default fails
1651 (("0\\.15") "0.16"))
1652 #t)))))
1653 (native-inputs
1654 `(("fortran" ,gfortran)))
1655 (inputs
1656 (list openblas))
1657 (home-page "https://github.com/stevengj/harminv")
1658 (synopsis "Harmonic inversion solver")
1659 (description
1660 "Harminv is a free program (and accompanying library) to solve the problem of
1661harmonic inversion — given a discrete-time, finite-length signal that consists of a sum
1662of finitely-many sinusoids (possibly exponentially decaying) in a given bandwidth, it
1663determines the frequencies, decay constants, amplitudes, and phases of those sinusoids.")
1664 (license license:gpl2+)))
1665
1666(define-public guile-libctl
1667 (package
1668 (name "guile-libctl")
1669 (version "4.7.1")
1670 (source (origin
1671 (method git-fetch)
1672 (uri (git-reference
1673 (url "https://github.com/NanoComp/libctl")
1674 (commit (string-append "v" version))))
1675 (file-name (git-file-name name version))
1676 (sha256
1677 (base32
1678 "1h0kg8cx4x7gjzg0wzk5qd90f5mxwyihlh9q1j2mznj7b0ag77yr"))))
1679 (build-system gnu-build-system)
1680 (arguments
1681 (list #:configure-flags
1682 #~(list "--enable-shared")
1683 #:phases
1684 #~(modify-phases %standard-phases
1685 ;; Avoid bin/sh shebang in configure.
1686 (add-before 'bootstrap 'no-/bin/sh
1687 (lambda _ (delete-file "autogen.sh"))))))
1688 (native-inputs
1689 (list autoconf
1690 automake
1691 libtool
1692 gfortran))
1693 (inputs
1694 (list guile-3.0))
1695 (home-page "https://libctl.readthedocs.io/en/latest/")
1696 (synopsis "Flexible control files implementation for scientific simulations")
1697 (description
1698 "Libctl is a Guile-based library implementing flexible control files
1699for scientific simulations.")
1700 (license license:gpl2+)))
1701
1702(define-public mpb
1703 (package
1704 (name "mpb")
1705 (version "1.12.0")
1706 (source (origin
1707 (method url-fetch)
1708 (uri
1709 (string-append
1710 "https://github.com/NanoComp/mpb/releases/download/v"
1711 version "/mpb-" version ".tar.gz"))
1712 (sha256
1713 (base32
1714 "197dm8z5hfikivb73rhywyq976rn1k621bf1admgc5xjaii20awd"))))
1715 (build-system gnu-build-system)
1716 (arguments
1717 (list
1718 #:configure-flags
1719 #~(list
1720 (string-append "--with-libctl="
1721 #$(this-package-input "guile-libctl") "/share/libctl")
1722 "--enable-shared")))
1723 (native-inputs
1724 (list gfortran
1725 pkg-config
1726 swig-4.4))
1727 (inputs
1728 (list fftw
1729 gsl
1730 guile-3.0
1731 guile-libctl
1732 hdf5
1733 openblas
1734 readline
1735 zlib))
1736 (home-page "https://mpb.readthedocs.io/en/latest/")
1737 (synopsis "Computes band structures and electromagnetic modes of dielectric
1738structures")
1739 (description
1740 "MIT Photonic-Bands (MPB) computes definite-frequency eigenstates
1741(harmonic modes) of Maxwell's equations in periodic dielectric structures for
1742arbitrary wavevectors, using fully-vectorial and three-dimensional methods.")
1743 (license license:gpl2+)))
1744
1745(define-public meep
1746 (package
1747 (name "meep")
1748 (version "1.34.0")
1749 (source (origin
1750 (method url-fetch)
1751 (uri
1752 (string-append
1753 "https://github.com/NanoComp/meep/releases/download/v"
1754 version "/meep-" version ".tar.gz"))
1755 (sha256
1756 (base32
1757 "1ihblq35z28shbb3s7xzkxpaagn5bwjx3visyc7kpqmkcr3894iw"))))
1758 (build-system gnu-build-system)
1759 (arguments
1760 (list #:configure-flags
1761 #~(list (string-append "--with-libctl="
1762 #$(this-package-input "guile-libctl")
1763 "/share/libctl"))))
1764 (native-inputs
1765 (list gfortran
1766 pkg-config
1767 swig-4.4))
1768 (inputs
1769 (list fftw
1770 gsl
1771 guile-3.0
1772 guile-libctl
1773 harminv
1774 hdf5
1775 mpb
1776 openblas
1777 zlib))
1778 (home-page "https://meep.readthedocs.io/en/latest/")
1779 (synopsis "Finite-difference time-domain (FDTD) simulation software")
1780 (description
1781 "Meep is a finite-difference time-domain (FDTD) simulation software package
1782developed at MIT to model electromagnetic systems.")
1783 (license license:gpl2+)))
1784
1785;; XXX: Deprecated on <2026-08-10>.
1786(define-deprecated/public-alias adms
1787 (@ (gnu packages electronics) adms))
1788
1789(define-public arduino-cli
1790 (package
1791 (properties
1792 '((release-commit . "01f3d4f2ba7c2eaafb5dc710c8a1903af7762fea")
1793 (release-date . "2026-06-05T09:39:33Z")))
1794 (name "arduino-cli")
1795 (version "1.5.1")
1796 (source
1797 (origin
1798 (method git-fetch)
1799 (uri (git-reference
1800 (url "https://github.com/arduino/arduino-cli")
1801 (commit (string-append "v" version))))
1802 (file-name (git-file-name name version))
1803 (sha256
1804 (base32 "15iqly4clwxp8l3kd7gfnmszbyq1586rjymc6a4zi6bh2q8zm59i"))))
1805 (build-system go-build-system)
1806 (arguments
1807 (list
1808 #:go go-1.26
1809 #:install-source? #f
1810 #:modules
1811 '((guix build go-build-system)
1812 (guix build utils)
1813 (ice-9 match))
1814 #:import-path "github.com/arduino/arduino-cli"
1815 #:build-flags
1816 #~(let ((base "github.com/arduino/arduino-cli/internal/"))
1817 (list (format #f "-ldflags=-X ~s -X ~s -X ~s"
1818 (string-append base "version.versionString="
1819 "v" #$version)
1820 (string-append base "version.commit="
1821 (string-take
1822 #$(assoc-ref properties 'release-commit) 7))
1823 (string-append base "version.date="
1824 #$(assoc-ref properties 'release-date)))))
1825 ;; List tests which need no internet resource
1826 ;; Skiping
1827 ;; internal/arduino/monitor
1828 ;; internal/arduino/resources
1829 ;; internal/arduino/cores/packagemanager
1830 ;; internal/cli/arguments
1831 ;; internal/integrationtest
1832 #:test-subdirs
1833 #~(list "commands"
1834 "internal/go-configmap"
1835 "internal/i18n"
1836 "internal/buildcache"
1837 "internal/cli/feedback"
1838 "internal/cli/feedback/result"
1839 "internal/locales"
1840 "internal/locales/cmd/po"
1841 "internal/arduino/utils"
1842 "internal/arduino/security"
1843 "internal/arduino/builder"
1844 "internal/arduino/builder/cpp"
1845 "internal/arduino/builder/internal/compilation"
1846 "internal/arduino/builder/internal/detector"
1847 "internal/arduino/builder/internal/diagnostics"
1848 "internal/arduino/builder/internal/preprocessor"
1849 "internal/arduino/builder/internal/preprocessor/internal/ctags"
1850 "internal/arduino/builder/internal/progress"
1851 "internal/arduino/builder/internal/runner"
1852 "internal/arduino/builder/internal/utils"
1853 "internal/arduino/cores"
1854 "internal/arduino/cores/packageindex"
1855 "internal/arduino/libraries"
1856 "internal/arduino/libraries/librariesindex"
1857 "internal/arduino/libraries/librariesmanager"
1858 "internal/arduino/libraries/librariesresolver"
1859 "internal/arduino/sketch"
1860 "internal/cli/configuration"
1861 "internal/cli/lib"
1862 "internal/cli/monitor"
1863 "internal/orderedmap"
1864 "pkg/fqbn")
1865 #:phases
1866 #~(modify-phases %standard-phases
1867 ;; Disable network release check for 'arduino-cli version'
1868 ;; command, by removing the 'res'ponse variable and setting
1869 ;; 'latestVersion' to empty string to simulate a no check
1870 ;; behavior.
1871 (add-after 'unpack 'disable-new-release-check
1872 (lambda* (#:key import-path #:allow-other-keys)
1873 (substitute*
1874 (string-append
1875 "src/" import-path "/internal/cli/version/version.go")
1876 (("res, (err ):= .*$" all first)
1877 (string-append "var " first "error\n"))
1878 (("(latestVersion = )res\\.GetNewestVersion\\(\\)"
1879 all first)
1880 (string-append first "\"\"")))))
1881 (add-after 'install 'install-shell-completions
1882 (lambda* (#:key native-inputs #:allow-other-keys)
1883 (for-each
1884 (match-lambda
1885 ((shell . path)
1886 (mkdir-p (in-vicinity #$output (dirname path)))
1887 (let ((binary
1888 (if #$(%current-target-system)
1889 (search-input-file native-inputs "bin/arduino-cli")
1890 (in-vicinity #$output "bin/arduino-cli"))))
1891 (with-output-to-file (in-vicinity #$output path)
1892 (lambda _
1893 (setenv "HOME" (getcwd))
1894 (invoke binary "completion" shell))))))
1895 '(("bash" . "share/bash-completion/completions/arduino-cli")
1896 ("fish" . "share/fish/vendor_completions.d/arduino-cli.fish")
1897 ("zsh" . "share/zsh/site-functions/_arduino-cli"))))))))
1898 (native-inputs
1899 (append
1900 (if (%current-target-system)
1901 (list this-package)
1902 '())
1903 (list go-fortio-org-safecast
1904 go-github-com-arduino-go-paths-helper
1905 go-github-com-arduino-go-properties-orderedmap
1906 go-github-com-arduino-go-serial-utils
1907 go-github-com-arduino-go-timeutils
1908 go-github-com-arduino-go-win32-utils
1909 go-github-com-arduino-pluggable-discovery-protocol-handler
1910 go-github-com-arduino-pluggable-monitor-protocol-handler
1911 go-github-com-cmaglie-pb
1912 go-github-com-codeclysm-extract
1913 go-github-com-djherbis-buffer
1914 go-github-com-djherbis-nio-v3
1915 go-github-com-fatih-color
1916 go-github-com-go-git-go-git-v5
1917 go-github-com-gofrs-uuid-v5
1918 go-github-com-leonelquinteros-gotext
1919 go-github-com-marcinbor85-gohex
1920 go-github-com-mattn-go-colorable
1921 go-github-com-mattn-go-isatty
1922 go-github-com-protonmail-go-crypto
1923 go-github-com-rifflock-lfshook
1924 go-github-com-rogpeppe-go-internal
1925 go-github-com-schollz-closestmatch
1926 go-github-com-sirupsen-logrus
1927 go-github-com-spf13-cobra
1928 go-github-com-spf13-viper
1929 go-github-com-stretchr-testify
1930 go-github-com-xeipuuv-gojsonschema
1931 go-go-bug-st-cleanup
1932 go-go-bug-st-downloader
1933 go-go-bug-st-f
1934 go-go-bug-st-relaxed-semver
1935 go-go-bug-st-testifyjson
1936 go-golang-org-x-sys
1937 go-golang-org-x-term
1938 go-golang-org-x-text
1939 go-google-golang-org-genproto-googleapis-rpc
1940 go-google-golang-org-grpc
1941 go-google-golang-org-protobuf
1942 go-gopkg-in-yaml-v3
1943 go-github-com-mailru-easyjson)))
1944 (home-page "https://github.com/arduino/arduino-cli")
1945 (synopsis "Tools to manage Arduino compatible boards")
1946 (description
1947 "Arduino Command Line Interface is an all-in-one solution that provides
1948Boards/Library Managers, sketch builder, board detection, uploader, and many
1949other tools needed to use any Arduino compatible board and platform from
1950command line or machine interfaces.")
1951 (license license:gpl3)))
1952
1953(define-public audmes
1954 (package
1955 (name "audmes")
1956 (version "2025.04.05")
1957 (source
1958 (origin
1959 (method git-fetch)
1960 (uri (git-reference
1961 (url "https://git.code.sf.net/p/audmes/git")
1962 (commit version)))
1963 (file-name (git-file-name name version))
1964 (sha256
1965 (base32 "0jndc6bx94k229rc98jbqzgk42bxx0dxa7h80wxzbkrl507qnhc3"))))
1966 (build-system cmake-build-system)
1967 (arguments
1968 (list
1969 #:tests? #f)) ;there are none
1970 (inputs
1971 (list alsa-lib pulseaudio wxwidgets))
1972 (native-inputs
1973 (list unzip libfccp))
1974 (home-page "https://sourceforge.net/projects/audmes/")
1975 (synopsis "Oscilloscope and spectrum analyzer using sound card")
1976 (description
1977 "The audio measurement system is a system for audio measurement through
1978sound card. It contains: generator, oscilloscope, audio spectrum
1979analyzer (FFT) and frequency sweep plot.")
1980 (license license:gpl2+)))
1981
1982(define-public capstone
1983 (package
1984 (name "capstone")
1985 (version "5.0.3")
1986 (source (origin
1987 (method git-fetch)
1988 (uri (git-reference
1989 (url "https://github.com/capstone-engine/capstone")
1990 (commit version)))
1991 (file-name (git-file-name name version))
1992 (sha256
1993 (base32
1994 "0fv8j1nzzbc5x9pg90641gpmlmp9h85wcg3l6258drk761rp979d"))))
1995 (build-system gnu-build-system)
1996 (arguments
1997 `(#:tests? #f
1998 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1999 (string-append "CC=" ,(cc-for-target)))
2000 #:phases
2001 (modify-phases %standard-phases
2002 (delete 'configure) ; no configure script
2003 ;; cstool's Makefile ‘+=’s LDFLAGS, so we cannot pass it as a make flag.
2004 (add-before 'build 'fix-cstool-ldflags
2005 (lambda* (#:key outputs #:allow-other-keys)
2006 (setenv "LDFLAGS"
2007 (string-append "-Wl,-rpath="
2008 (assoc-ref outputs "out") "/lib")))))))
2009 (home-page "https://github.com/capstone-engine/capstone")
2010 (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
2011 (description
2012 "Capstone is a lightweight multi-platform, multi-architecture disassembly
2013framework. Capstone can disassemble machine code for many supported architectures
2014such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
2015bindings for Python, Java, OCaml and more.")
2016 (license license:bsd-3)))
2017
2018;; FIXME: This package has a timestamp embedded in
2019;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
2020(define-public python-capstone
2021 (package
2022 (inherit capstone)
2023 (name "python-capstone")
2024 (build-system pyproject-build-system)
2025 (arguments
2026 (list
2027 #:phases
2028 #~(modify-phases %standard-phases
2029 (add-after 'unpack 'chdir-and-fix-setup-py
2030 (lambda _
2031 (chdir "bindings/python")
2032 ;; Do not build the library again, because we already have it.
2033 (substitute* "setup.py" ((".* build_libraries.*") ""))
2034 ;; This substitution tells python-capstone where to find the
2035 ;; library.
2036 (substitute* "capstone/__init__.py"
2037 (("resources\\.files\\(__name__\\)")
2038 (string-append "PurePath(\"" #$(this-package-input "capstone") "\")")))
2039 ;; Fix the path to the tests scripts in the Makefile.
2040 (substitute* "Makefile"
2041 (("./\\$\\$t") "./tests/$$t"))))
2042 (replace 'check
2043 (lambda* (#:key tests? #:allow-other-keys)
2044 (when tests?
2045 (invoke "make" "check")))))))
2046 (native-inputs
2047 (list python-setuptools
2048 python-wheel))
2049 (propagated-inputs
2050 (list capstone))))
2051
2052(define-public python-platypush
2053 (package
2054 (name "python-platypush")
2055 (version "1.3.17")
2056 (source
2057 (origin
2058 (method git-fetch)
2059 (uri (git-reference
2060 (url "https://git.platypush.tech/platypush/platypush.git")
2061 (commit (string-append "v" version))))
2062 (file-name (git-file-name name version))
2063 (sha256
2064 (base32 "0b9374dcp6bqwq0mj273g0bjh5h9i8mzria3yby04d0i9zbf1wyl"))))
2065 (build-system pyproject-build-system)
2066 (arguments
2067 (list
2068 #:phases
2069 #~(modify-phases %standard-phases
2070 (add-before 'check 'pre-check
2071 (lambda _
2072 (setenv "HOME" "/tmp"))))))
2073 (native-inputs (list python-setuptools python-pytest redis))
2074 (propagated-inputs (list python-alembic
2075 python-croniter
2076 python-dateutil
2077 python-docutils
2078 python-flask
2079 python-magic
2080 ;; v4 is supported in upcomming release, see
2081 ;; <https://git.platypush.tech/platypush/platypush/issues/445>.
2082 python-marshmallow-3
2083 python-pillow
2084 python-psutil
2085 python-pygments
2086 python-pyotp
2087 python-pyyaml
2088 python-pyzbar
2089 python-qrcode
2090 python-redis
2091 python-requests
2092 python-rsa
2093 python-sqlalchemy-2
2094 python-tornado
2095 python-urllib3
2096 python-watchdog
2097 python-websocket-client
2098 python-websockets
2099 python-werkzeug
2100 python-zeroconf
2101 python-zipp))
2102 (home-page "https://platypush.tech/")
2103 (synopsis "General-purpose automation framework")
2104 (description
2105 "Platypush is a general-purpose and extensible platform for automation across
2106multiple services and devices with hundreds of supported integrations.")
2107 (license license:expat)))
2108
2109(define-public python-esptool
2110 (package
2111 (name "python-esptool")
2112 (version "5.3.0")
2113 (source
2114 (origin
2115 (method git-fetch)
2116 (uri (git-reference
2117 (url "https://github.com/espressif/esptool")
2118 (commit (string-append "v" version))))
2119 (file-name (git-file-name name version))
2120 (sha256
2121 (base32 "0lz8qbr8x46g33wpiagl9n3vg8nkjm5w8l1x8kyrzprfzwnxf5rm"))))
2122 (build-system pyproject-build-system)
2123 (arguments
2124 (list
2125 #:test-flags
2126 #~(list
2127 ;; XXX: Requires python2 package pkcs11.
2128 "--ignore=test/test_espsecure_hsm.py"
2129 ;; XXX: Requires python-requests, most likely to use network.
2130 "--ignore=test/test_uf2_ids.py"
2131 ;; XXX: Various errors (device access, server not started...)
2132 "--ignore=test/test_esptool.py"
2133 ;; XXX: "not supported by this version of OpenSSL"
2134 "-k" "not test_sign_v1_data and not test_sign_v1_data_pkcs8")))
2135 (propagated-inputs
2136 (list python-bitstring
2137 python-click
2138 python-cryptography
2139 python-intelhex
2140 python-pyserial
2141 python-pyyaml
2142 python-reedsolo
2143 python-rich-click))
2144 (native-inputs (list python-pyelftools
2145 python-pytest
2146 python-setuptools))
2147 (home-page "https://github.com/espressif/esptool")
2148 (synopsis "Bootloader utility for Espressif ESP8266 & ESP32 chips")
2149 (description
2150 "@code{esptool.py} is a Python-based utility to communicate with the ROM
2151bootloader in Espressif ESP8266 & ESP32 series chips.")
2152 (license license:gpl2+)))
2153
2154(define-public radare2
2155 (package
2156 (name "radare2")
2157 (version "6.2.0") ;keep in sync with iaito,r2ghidra
2158 (source (origin
2159 (method git-fetch)
2160 (uri (git-reference
2161 (url "https://github.com/radareorg/radare2")
2162 (commit version)))
2163 (sha256
2164 (base32
2165 "1vzlxn0xdgm8ijaj5nz9l3j52a48g93canzvalp3bcmkyms8s47c"))
2166 (file-name (git-file-name name version))
2167 (patches
2168 (search-patches "radare2-fix-meson-build-to-use-sys-sdb.patch"
2169 "radare2-fix-meson-build-to-use-sys-qjs.patch"))))
2170 (build-system meson-build-system)
2171 (arguments
2172 (list
2173 #:configure-flags
2174 #~(list "-Duse_libuv=true"
2175 "-Duse_ssl=true"
2176 "-Duse_sys_capstone=true"
2177 "-Duse_sys_lz4=true"
2178 "-Duse_sys_magic=true"
2179 "-Duse_sys_openssl=true"
2180 "-Duse_sys_xxhash=true"
2181 "-Duse_sys_zip=true"
2182 "-Duse_sys_zlib=true"
2183 "-Duse_sys_zydis=true")
2184 #:phases
2185 #~(modify-phases %standard-phases
2186 ;; CHECK LATER: This patches an incorrect relative include.
2187 (add-before 'build 'fix-relative-include
2188 (lambda _
2189 (substitute* "../source/libr/arch/p/java/plugin.c"
2190 (("include \".." all)
2191 (string-append all "/..")))))
2192 ;; These tests require sample binaries from an external repository.
2193 (add-before 'check 'skip-tests
2194 (lambda _
2195 (substitute* '("../source/test/unit/test_bin.c"
2196 "../source/test/unit/test_dwarf.c"
2197 "../source/test/unit/test_dwarf_info.c"
2198 "../source/test/unit/test_dwarf_integration.c"
2199 "../source/test/unit/test_pdb.c"
2200 ;; TODO: add r2pipe and enable this test.
2201 "../source/test/unit/test_r2pipe.c")
2202 (("(^| )main *\\(.*" all)
2203 (string-append all " exit (77);\n")))))
2204 (add-after 'install 'fixup-pc-files
2205 (lambda _
2206 (with-directory-excursion (in-vicinity #$output "lib/pkgconfig")
2207 ;; Avoids many unnecessary propagated inputs.
2208 (substitute* (find-files "." ".*\\.pc")
2209 (("^Requires.private:.*") ""))
2210 ;; XXX: Nonexistent after unbundling sdb, but still propagate.
2211 (substitute* "r_util.pc"
2212 (("-I\\$\\{includedir\\}/libr/sdb") ""))))))))
2213 (inputs
2214 (list capstone
2215 gmp
2216 libuv
2217 libzip
2218 lz4
2219 quickjs-ng
2220 xxhash
2221 zlib
2222 zycore
2223 zydis))
2224 (native-inputs
2225 (list node
2226 perl
2227 pkg-config
2228 python-minimal-wrapper))
2229 (propagated-inputs
2230 (list openssl ;needed by r_util's public headers
2231 sdb)) ;r_regex.h, r_util.h, r_getopt.h...
2232 (native-search-paths (list (search-path-specification
2233 (variable "R2_LIBR_PLUGINS")
2234 (files (list "lib/radare2"))
2235 (separator #f)))) ;single value
2236 (home-page "https://radare.org/")
2237 (synopsis "Reverse engineering framework")
2238 (description
2239 "Radare2 is a complete framework for reverse-engineering, debugging, and
2240analyzing binaries. It is composed of a set of small utilities that can be
2241used together or independently from the command line.
2242
2243Radare2 is built around a scriptable disassembler and hexadecimal editor that
2244support a variety of executable formats for different processors and operating
2245systems, through multiple back ends for local and remote files and disk
2246images.
2247
2248It can also compare (@dfn{diff}) binaries with graphs and extract information
2249like relocation symbols. It is able to deal with malformed binaries, making
2250it suitable for security research and analysis.")
2251 (license license:lgpl3)))
2252
2253;; TODO: Keep in sync with radare2.
2254(define-public r2ghidra
2255 (package
2256 (name "r2ghidra")
2257 (version "6.2.0")
2258 (source
2259 (origin
2260 (method git-fetch)
2261 (uri (git-reference
2262 (url "https://github.com/radareorg/r2ghidra")
2263 (commit version)))
2264 (file-name (git-file-name name version))
2265 (sha256
2266 (base32 "090alws82nx48r1gj003d865g87x7nc8cp0famqmpfy51ajcj8gs"))
2267 (modules '((guix build utils)))
2268 (snippet
2269 ;; Delete bundled libs and remove their references.
2270 #~(begin (delete-file-recursively "subprojects")
2271 (substitute* "ghidra/deps.mk"
2272 (("ZLIB_LDFLAGS=.*") "")
2273 (("ZLIB_CFLAGS=.*") ""))
2274 ;; Don't try to make the directory we snipped.
2275 (substitute* "src/Makefile"
2276 (("(all:) subprojects-zlib" _ f) f)
2277 (("\\| \\.\\./subprojects/zlib/libz\\.a") ""))))))
2278 (build-system gnu-build-system)
2279 (arguments
2280 (list
2281 #:make-flags
2282 #~(let* ((zlib #$(this-package-input "zlib")))
2283 (list (string-append "CC=" #$(cc-for-target))
2284 (format #f "ZLIB_LDFLAGS=-L~a/lib/ -lz" zlib)
2285 (format #f "ZLIB_CFLAGS=-I~a/include/" zlib)
2286 ;; Ensure this matches R2_LIBR_PLUGINS as exported
2287 ;; by radare2 & iaito.
2288 (format #f "PLUGDIR=~a/lib/radare2" #$output)
2289 "R2GHIDRA_USE_RXML=1")) ;use r2 xml parser instead of pugixml
2290 #:tests? #f ;no 'check' rule, test dir may require 3rd-party binaries
2291 #:phases
2292 #~(modify-phases %standard-phases
2293 (add-after 'unpack 'skip-git-and-copy-ghidra
2294 (lambda _
2295 ;; GIT is assumed to point to the git binary, but it is
2296 ;; only checked to be a file; this short-circuits the check.
2297 (setenv "GIT" "configure")
2298 (copy-recursively
2299 (search-input-directory %build-inputs "share/ghidra-native")
2300 "subprojects/ghidra-native")))
2301 (add-before 'build 'set-system-sleighhome
2302 ;; Helper files which try to install in radare2's path
2303 ;; in the store, irrespective of PLUGDIR. As long as
2304 ;; r2ghidra knows where to find them, we can place them
2305 ;; anywhere.
2306 (lambda _
2307 (let ((sleighhome
2308 (in-vicinity #$output "lib/radare2/sleighhome")))
2309 ;; Hardcoded path to check.
2310 (substitute* "src/SleighAsm.cpp"
2311 (("(path = strdup \\()[^\\)]*" _ f)
2312 (string-append f "\"" sleighhome "\"")))
2313 ;; Install location.
2314 (substitute* "ghidra/Makefile"
2315 (("(sleigh-install D=\")\\$\\(DD\\)" _ f)
2316 (string-append f sleighhome)))))))))
2317 (inputs (list radare2 zlib))
2318 (native-inputs
2319 (list ghidra-native
2320 pkg-config
2321 python-minimal))
2322 (home-page "https://www.radare.org/")
2323 (synopsis "Native Ghidra Decompiler for radare2")
2324 (description
2325 "r2ghidra is a radare2 plugin which integrates the
2326 @url{https://www.nsa.gov/ghidra,Ghidra} decompiler.")
2327 ;; Specified lgpl3 'only' in README.
2328 (license license:lgpl3)))
2329
2330(define-public ghidra-native
2331 ;; Latest commit; last release (8/2025) incompatible with current r2ghidra.
2332 (let ((commit "df065bad0f9e7cea233479048681f811c4f640a2")
2333 (revision "1"))
2334 (package
2335 (name "ghidra-native")
2336 (version (git-version "0.6.2" revision commit))
2337 (source
2338 (origin
2339 (method git-fetch)
2340 (uri (git-reference
2341 (url "https://github.com/radareorg/ghidra-native")
2342 (commit commit)))
2343 (file-name (git-file-name name version))
2344 (sha256
2345 (base32 "14bzrl856x3bsqjpks85rzxcxncfmnjwc5knv2h4lybfz4bxcn39"))))
2346 (build-system gnu-build-system)
2347 (arguments
2348 (list
2349 #:tests? #f ;no tests
2350 #:make-flags #~(list "patch")
2351 #:phases
2352 #~(modify-phases %standard-phases
2353 (delete 'configure)
2354 (replace 'install ;no install target
2355 (lambda _
2356 (let ((ghidra-native-patched
2357 (in-vicinity #$output "/share/ghidra-native/src")))
2358 (copy-recursively "src" ghidra-native-patched)))))))
2359 (home-page "https://www.radare.org/")
2360 (synopsis "Native parts of ghidra")
2361 (description
2362 "This package contains the native parts of ghidra, to be used from
2363r2ghidra.")
2364 (properties '((hidden? . #t))) ;only provides source files
2365 (license license:asl2.0))))
2366
2367(define-public rayforge
2368 (package
2369 (name "rayforge")
2370 (version "1.7.7") ;newer version requires python-raygeo (Rust)
2371 (source
2372 (origin
2373 (method git-fetch)
2374 (uri (git-reference
2375 (url "https://github.com/barebaric/rayforge")
2376 (commit version)))
2377 (file-name (git-file-name name version))
2378 (sha256
2379 (base32 "1w44qw51nynf1rk61y0d0wj6xl66ciswpcsp38dnwrpfwsqgafxw"))))
2380 (build-system pyproject-build-system)
2381 (arguments
2382 (list
2383 ;; tests: 1626 passed
2384 #:test-flags
2385 ;; XXX: Tests fail to pick exact version of cairo: E gi.RepositoryError:
2386 ;; Typelib file for namespace 'cairo', version '1.0' not found
2387 #~(list "--ignore=tests/core/geo/test_font_config.py"
2388 "--ignore=tests/core/geo/test_geo_text.py"
2389 "--ignore=tests/core/geo/test_geometry.py"
2390 "--ignore=tests/core/geo/test_text.py"
2391 "--ignore=tests/core/geo/test_transform.py"
2392 ;; XXX: Projects ships a huge test suite which the majority
2393 ;; fail, run bare minimal core tests.
2394 "tests/core")
2395 #:phases
2396 #~(modify-phases %standard-phases
2397 (add-after 'unpack 'relax-requirements
2398 (lambda _
2399 ;; All of the dependencies are pined to exact version.
2400 (substitute* "requirements.txt"
2401 (("[=~]=.*") "\n")
2402 ;; XXX: Guix's opencv package does not provide Python's
2403 ;; version metadata.
2404 (("opencv_python") ""))))
2405 (add-before 'sanity-check 'set-home
2406 (lambda _
2407 (setenv "HOME" "/tmp")))
2408 (add-before 'check 'remove-local-source
2409 (lambda _
2410 (delete-file-recursively "rayforge")))
2411 (add-after 'wrap 'wrap-rayforge
2412 (lambda _
2413 (wrap-program (string-append #$output "/bin/rayforge")
2414 `("GI_TYPELIB_PATH" ":" prefix
2415 (,(getenv "GI_TYPELIB_PATH")))))))))
2416 (native-inputs (list python-gitpython
2417 python-pytest
2418 python-pytest-asyncio
2419 python-pytest-mock
2420 python-setuptools))
2421 (inputs (list bash-minimal
2422 libadwaita
2423 opencv
2424 python-aiohttp
2425 python-asyncudp
2426 python-blinker
2427 python-ezdxf
2428 python-gitpython
2429 python-numpy
2430 python-platformdirs
2431 python-pluggy
2432 python-pycairo
2433 python-pyclipper
2434 python-pygobject
2435 python-pymupdf
2436 python-pyopengl
2437 python-pyopengl-accelerate
2438 python-pypdf
2439 python-pyserial
2440 python-pyvips
2441 python-pyyaml
2442 python-scipy
2443 python-semver
2444 python-svgelements
2445 python-trimesh
2446 python-websockets
2447 vtracer))
2448 (home-page "https://rayforge.org/")
2449 (synopsis "Desktop application for laser cutting and engraving")
2450 (description
2451 "Rayforge is a cross-platform 2D CAD and G-code control software designed
2452for GRBL-based laser cutters and engravers. It features an interface built
2453using GTK4 and Libadwaita, with support for SVG, DXF, PDF, and various image
2454formats.")
2455 (license license:expat)))
2456
2457(define-public zycore
2458 (package
2459 (name "zycore")
2460 (version "1.5.1")
2461 (source (origin
2462 (method git-fetch)
2463 (uri (git-reference
2464 (url "https://github.com/zyantific/zycore-c")
2465 (commit (string-append "v" version))))
2466 (file-name (git-file-name name version))
2467 (sha256
2468 (base32 "1szpwqqw12frdchmq2qkcqrmb88afq56fsn2nbd96vmsdzmnhwnq"))))
2469 (build-system cmake-build-system)
2470 (native-inputs (list googletest))
2471 (arguments (list #:configure-flags
2472 #~(list "-DZYCORE_BUILD_SHARED_LIB=ON"
2473 #$(if (%current-target-system)
2474 "-DZYCORE_BUILD_TESTS=OFF"
2475 "-DZYCORE_BUILD_TESTS=ON"))))
2476 (home-page "https://github.com/zyantific/zycore-c")
2477 (synopsis "Internal library for Zydis")
2478 (description
2479 "This package provides platfrom-independent types, macros
2480and a fallback for environments without libc for Zydis.")
2481 (license license:expat)))
2482
2483(define-public zydis
2484 (package
2485 (name "zydis")
2486 (version "4.1.1")
2487 (source (origin
2488 (method git-fetch)
2489 (uri (git-reference
2490 (url "https://github.com/zyantific/zydis")
2491 (commit (string-append "v" version))))
2492 (file-name (git-file-name name version))
2493 (sha256
2494 (base32 "1f6caps6i5hinx4j3fcsxyqmqr2mszc9ah83jpq0bidp956jk7p8"))))
2495 (build-system cmake-build-system)
2496 (arguments (list #:configure-flags
2497 #~(list "-DZYAN_SYSTEM_ZYCORE=ON"
2498 "-DZYDIS_BUILD_SHARED_LIB=ON"
2499 "-DZYDIS_BUILD_MAN=ON")))
2500 (native-inputs (list python-minimal ronn-ng))
2501 (inputs (list zycore))
2502 (home-page "https://zydis.re")
2503 (synopsis "Disassembler and code generation library for x86 and AMD64")
2504 (description
2505 "Zydis is a decoder and disassembler library with the following features:
2506@itemize
2507@item Support for all x86 and AMD64 instructions and extensions
2508@item Optimization for high performance
2509@item No dynamic memory allocation
2510@item Thread-safe by design
2511@item Smaller file-size overhead compared to other common disassembler libraries
2512@end itemize")
2513 (license license:expat)))
2514
2515(define-public asco
2516 (package
2517 (name "asco")
2518 (version "0.4.11")
2519 (source
2520 (origin
2521 (method url-fetch)
2522 (uri (string-append "mirror://sourceforge/asco/asco/" version "/ASCO-"
2523 version ".tar.gz"))
2524 (sha256
2525 (base32 "0ggxv0p1zmfbvd1k17p2j1cskbjsa83fansz8ihxn7ax9qdicljv"))))
2526 (build-system gnu-build-system)
2527 (arguments
2528 `(#:tests? #f ; no tests
2529 #:make-flags '("all" "asco-mpi")
2530 #:phases
2531 (modify-phases %standard-phases
2532 (delete 'configure)
2533 (add-before 'build 'relax-gcc-14-strictness
2534 (lambda _
2535 (substitute* (find-files "." "Makefile")
2536 (("CFLAGS = (.*)$" all options)
2537 (string-append "CFLAGS = "
2538 " -Wno-error=incompatible-pointer-types"
2539 " -Wno-error=implicit-function-declaration"
2540 " "
2541 options)))))
2542 (add-before 'build 'fix-paths
2543 (lambda* (#:key inputs #:allow-other-keys)
2544 (let ((coreutils (assoc-ref inputs "coreutils-minimal")))
2545 (substitute* '("errfunc.c" "asco.c")
2546 (("(cp|nice) " _ command)
2547 (string-append
2548 (search-input-file inputs (string-append "bin/" command))
2549 " ")))
2550 (substitute* "Makefile"
2551 (("<FULL_PATH_TO_MPICH>/bin/mpicc") (which "mpicc"))))))
2552 (replace 'install ; no install target
2553 (lambda* (#:key outputs #:allow-other-keys)
2554 (for-each (lambda (file)
2555 (install-file file (string-append
2556 (assoc-ref outputs "out")
2557 "/bin")))
2558 '("asco" "asco-mpi" "asco-test"
2559 "tools/alter/alter" "tools/log/log")))))))
2560 (native-inputs
2561 `(("mpi" ,openmpi)))
2562 (inputs
2563 (list coreutils-minimal))
2564 (home-page "https://asco.sourceforge.net/")
2565 (synopsis "SPICE circuit optimizer")
2566 (description
2567 "ASCO brings circuit optimization capabilities to existing SPICE simulators using a
2568high-performance parallel differential evolution (DE) optimization algorithm.")
2569 (license license:gpl2+)))
2570
2571(define-public gpx
2572 (package
2573 (name "gpx")
2574 (version "2.6.8")
2575 (source (origin
2576 (method git-fetch)
2577 (uri (git-reference
2578 (url "https://github.com/markwal/GPX")
2579 (commit version)))
2580 (file-name (git-file-name name version))
2581 (sha256
2582 (base32
2583 "1izs8s5npkbfrsyk17429hyl1vyrbj9dp6vmdlbb2vh6mfgl54h8"))))
2584 (build-system gnu-build-system)
2585 (home-page "https://github.com/markwal/GPX")
2586 (synopsis "Converting gcode to x3g files for 3D printing")
2587 (description
2588 "GPX is a post processing utility for converting gcode output from 3D
2589slicing software to x3g files for standalone 3D printing on common 3D
2590printers.")
2591 (license license:gpl2+)))
2592
2593(define-public cutter
2594 (package
2595 (name "cutter")
2596 (version "2.4.1") ;keep in sync with rizin
2597 (source
2598 (origin
2599 (method git-fetch)
2600 (uri (git-reference
2601 (url "https://github.com/rizinorg/cutter")
2602 (commit (string-append "v" version))
2603 ;; Needed for src/translations.
2604 (recursive? #t)))
2605 (modules '((guix build utils)))
2606 (snippet #~(delete-file-recursively "rizin"))
2607 (file-name (git-file-name name version))
2608 (sha256
2609 (base32 "090gfg90k0fn3jiyssdigjgb7xn473hxfm7gpl1rwn3kl6fv7lvw"))))
2610 (build-system qt-build-system)
2611 (arguments
2612 (list
2613 #:qtbase qtbase
2614 #:configure-flags
2615 #~(list "-DCUTTER_USE_BUNDLED_RIZIN=OFF"
2616 "-DCUTTER_ENABLE_PYTHON=ON"
2617 "-DCUTTER_ENABLE_PYTHON_BINDINGS=ON")
2618 #:tests? #f)) ;no tests
2619 (native-inputs
2620 (list pkgconf))
2621 (inputs
2622 (list graphviz
2623 ksyntaxhighlighting
2624 libzip
2625 openssl
2626 python
2627 python-pyside-6
2628 python-shiboken-6
2629 qt5compat
2630 qtsvg
2631 qttools
2632 qtwayland
2633 rizin
2634 zlib))
2635 (home-page "https://cutter.re")
2636 (synopsis "Software reverse engineering platform")
2637 (description
2638 "Cutter is a reverse engineering platform powered by @code{rizin}. It
2639aims to be an advanced and customizable reverse engineering platform while
2640keeping the user experience in mind. Cutter is created by reverse engineers
2641for reverse engineers.")
2642 (license (list license:cc-by-sa3.0 ;the "Iconic" icon set
2643 license:gpl3+)))) ;everything else
2644
2645(define-public lib3mf
2646 (package
2647 (name "lib3mf")
2648 (version "2.2.0")
2649 (source
2650 (origin
2651 (method git-fetch)
2652 (uri (git-reference (url "https://github.com/3MFConsortium/lib3mf")
2653 (commit (string-append "v" version))))
2654 (file-name (git-file-name name version))
2655 (sha256
2656 (base32
2657 "05zqvnzmi7j8rhp2mrskvxf1bxl7kb4c72dfx4y86219i1hx7i2q"))
2658 (modules '((guix build utils)))
2659 (snippet
2660 '(begin
2661 ;; Delete pre-compiled ACT.
2662 (delete-file-recursively "AutomaticComponentToolkit/bin")
2663
2664 ;; Remove bundled software. Preserve cpp-base64 as it has been
2665 ;; modified and cannot easily be unbundled.
2666 (for-each delete-file-recursively
2667 '("Include/Libraries/libzip"
2668 "Include/Libraries/zlib"
2669 "Source/Libraries/libzip"
2670 "Source/Libraries/zlib"))
2671
2672 ;; Adjust header includes such that system headers are found.
2673 (substitute* '("Include/Common/OPC/NMR_OpcPackageReader.h"
2674 "Include/Common/Platform/NMR_ImportStream_ZIP.h"
2675 "Include/Common/Platform/NMR_ExportStream_ZIP.h"
2676 "Include/Common/Platform/NMR_ImportStream_Compressed.h"
2677 "Include/Common/Platform/NMR_ExportStream_Compressed.h"
2678 "Source/Common/Platform/NMR_PortableZIPWriterEntry.cpp")
2679 (("Libraries/libzip/") "")
2680 (("Libraries/zlib/") ""))))))
2681 (build-system cmake-build-system)
2682 (arguments
2683 `(#:configure-flags (list "-DUSE_INCLUDED_ZLIB=0"
2684 "-DUSE_INCLUDED_LIBZIP=0"
2685 "-DUSE_INCLUDED_GTEST=0"
2686 "-DUSE_INCLUDED_SSL=0")
2687 #:phases (modify-phases %standard-phases
2688 (add-after 'unpack 'provide-act
2689 (lambda* (#:key native-inputs inputs #:allow-other-keys)
2690 (let ((act (search-input-file (or native-inputs inputs)
2691 "bin/act"))
2692 (dir "AutomaticComponentToolkit/bin"))
2693 (mkdir-p dir)
2694 (symlink act (string-append dir "/act.linux"))))))))
2695 (native-inputs
2696 (list automatic-component-toolkit googletest-1.12 pkg-config))
2697 (inputs
2698 (list `(,util-linux "lib") libzip libressl zlib))
2699 (synopsis "Implementation of the 3D Manufacturing Format (3MF) file standard")
2700 (description
2701 "Lib3MF is a C++ implementation of the 3D Manufacturing Format (3MF) file
2702standard. It offers a way to integrate 3MF reading and writing capabilities, as
2703well as conversion and validation tools for input and output data. The
2704specification can be downloaded at @url{http://3mf.io/specification/}.")
2705 (home-page "https://3mf.io/")
2706 (license license:bsd-2)))
2707
2708(define-public manifold
2709 (package
2710 (name "manifold")
2711 (version "3.4.1")
2712 (source
2713 (origin
2714 (method git-fetch)
2715 (uri (git-reference
2716 (url "https://github.com/elalish/manifold")
2717 (commit (string-append "v" version))))
2718 (file-name (git-file-name name version))
2719 (sha256
2720 (base32 "0x65708r6xln8sd53abbn1qnhz3wxnicn2837ida73ihargk5js1"))))
2721 (build-system cmake-build-system)
2722 (inputs (list onetbb clipper2 assimp python-nanobind googletest))
2723 (arguments
2724 (list #:tests? #f
2725 ;; can be removed once emscripten is packaged
2726 #:configure-flags #~(list "-DMANIFOLD_JSBIND=OFF")))
2727 (synopsis "Geometry library for topological robustness")
2728 (description
2729 "Manifold is a geometry library dedicated to creating and operating on
2730manifold triangle meshes. A manifold mesh is a mesh that represents a solid
2731object, and so is very important in manufacturing, CAD, structural analysis,
2732etc.. Manifold also supports arbitrary vertex properties and enables mapping
2733of materials for rendering use-cases.")
2734 (home-page "https://github.com/elalish/manifold")
2735 (license license:asl2.0)))
2736
2737(define-public python-keithley2600
2738 (package
2739 (name "python-keithley2600")
2740 (version "2.1.0")
2741 (source
2742 (origin
2743 (method git-fetch)
2744 (uri (git-reference
2745 (url "https://github.com/OE-FET/keithley2600")
2746 (commit (string-append "v" version))))
2747 (file-name (git-file-name name version))
2748 (sha256
2749 (base32 "19bs7lswb04a5xr4zdsknynmpllpj18nb19jcbjnzf1fs1dqg0hw"))))
2750 (build-system pyproject-build-system)
2751 (arguments
2752 (list #:tests? #f)) ; no tests provided
2753 (native-inputs
2754 (list python-setuptools
2755 python-wheel))
2756 (propagated-inputs
2757 (list python-numpy
2758 python-pyvisa
2759 python-pyvisa-py))
2760 (home-page "https://keithley2600.readthedocs.io/en/stable/")
2761 (synopsis "Full Python driver for Keithley 2600 series of SMU")
2762 (description
2763 "This package provides a full Python driver for the Keithley 2600B series
2764of source measurement units. This driver provides access to base commands and
2765higher level functions such as IV measurements, transfer and output curves,
2766etc. Base commands replicate the functionality and syntax from the Keithley's
2767internal TSP Lua functions.")
2768 (license license:expat)))
2769
2770(define-public python-pyvisa
2771 (package
2772 (name "python-pyvisa")
2773 (version "1.16.2")
2774 (source (origin
2775 (method git-fetch)
2776 (uri (git-reference
2777 (url "https://github.com/pyvisa/pyvisa")
2778 (commit version)))
2779 (file-name (git-file-name name version))
2780 (sha256
2781 (base32 "1yg3g358y725fahqh18yf46dydam5d9cv9dnis2lnam79mmsy5f3"))
2782 (modules '((guix build utils)))
2783 ;; Delete bundled python-prettytable.
2784 (snippet '(delete-file-recursively "pyvisa/thirdparty"))))
2785 (build-system pyproject-build-system)
2786 (arguments
2787 (list
2788 #:test-flags
2789 #~(list "--pyargs" "pyvisa")
2790 #:phases
2791 #~(modify-phases %standard-phases
2792 (add-after 'unpack 'use-system-prettytable
2793 (lambda _
2794 (substitute* "pyvisa/shell.py"
2795 (("from .thirdparty import prettytable")
2796 "import prettytable")))))))
2797 (native-inputs
2798 (list python-pytest
2799 python-setuptools
2800 python-setuptools-scm))
2801 (propagated-inputs
2802 (list python-prettytable
2803 python-typing-extensions))
2804 (home-page "https://pyvisa.readthedocs.io/en/latest/")
2805 (synopsis "Python binding for the VISA library")
2806 (description "PyVISA is a Python package for support of the
2807@acronym{VISA, Virtual Instrument Software Architecture}, in order to control
2808measurement devices and test equipment via GPIB, RS232, Ethernet or USB.")
2809 (license license:expat)))
2810
2811(define-public python-pyvisa-py
2812 (package
2813 (name "python-pyvisa-py")
2814 (version "0.8.1")
2815 (source
2816 (origin
2817 (method git-fetch)
2818 (uri (git-reference
2819 (url "https://github.com/pyvisa/pyvisa-py")
2820 (commit version)))
2821 (file-name (git-file-name name version))
2822 (sha256
2823 (base32 "1673azf2y72rza8k1i109x8ad8p0ziz6cc5rw3w0w79wdvfx6wkx"))))
2824 (build-system pyproject-build-system)
2825 (native-inputs
2826 (list python-pytest
2827 python-setuptools))
2828 (propagated-inputs
2829 (list python-pyvisa
2830 python-typing-extensions))
2831 (home-page "https://pyvisa-py.readthedocs.io/")
2832 (synopsis "Backend for PyVISA")
2833 (description
2834 "PyVISA-py is a backend for PyVISA that implements most of the methods
2835for Message Based communication (Serial/USB/GPIB/Ethernet) using Python and
2836some well developed, easy to deploy and cross platform libraries.")
2837 (license license:expat)))
2838
2839(define-public python-pandapower
2840 (package
2841 (name "python-pandapower")
2842 (version "3.3.3")
2843 (source
2844 (origin
2845 (method git-fetch)
2846 (uri (git-reference
2847 (url "https://github.com/e2nIEE/pandapower")
2848 (commit (string-append "v" version))))
2849 (file-name (git-file-name name version))
2850 (sha256
2851 (base32 "1rryjz5qf33vsa0dvpvpbvc65kv5kj9qwzrs4ql7gz6mamwpkj5k"))))
2852 (build-system pyproject-build-system)
2853 (arguments
2854 (list
2855 ;; tests: 1161 passed, 140 skipped, 23 xfailed, 11 xpassed, 4529 warnings
2856 #:test-flags
2857 #~(list "--numprocesses" (number->string (min 8 (parallel-job-count))))
2858 #:phases
2859 #~(modify-phases %standard-phases
2860 (add-after 'unpack 'relax-requirements
2861 (lambda _
2862 (substitute* "pyproject.toml"
2863 (("pandera~=0.26.1") "pandera~=0.27.1")))))))
2864 (native-inputs
2865 (list python-nbmake
2866 python-pytest
2867 python-pytest-xdist
2868 python-setuptools))
2869 (propagated-inputs
2870 (list python-deepdiff
2871 python-geojson
2872 python-networkx
2873 python-numpy
2874 python-packaging
2875 python-pandas
2876 python-pandera
2877 python-scipy
2878 python-tqdm
2879 python-typing-extensions
2880 ;; [optional]
2881 python-geopandas
2882 python-lxml
2883 python-matplotlib
2884 python-openpyxl
2885 python-pyproj
2886 python-shapely))
2887 (home-page "https://www.pandapower.org/")
2888 (synopsis "Power system modelling and analysis")
2889 (description "@code{pandapower} is an easy to use network calculation
2890program aimed to automate the analysis and optimization of power systems.
2891It uses the data analysis library @code{pandas} and is compatible with the
2892commonly used @code{MATPOWER} / @code{PYPOWER} case format. @code{pandapower}
2893allows using different solvers including an improved Newton-Raphson power flow
2894implementation, all @code{PYPOWER} solvers, the C++ library solvers for fast
2895steady-state distribution power system analysis of @code{PowerGridModel}, the
2896Newton-Raphson power flow solvers in the C++ library lightsim2grid, and the
2897@code{PowerModels.jl} library.")
2898 (license license:bsd-3)))
2899
2900(define-public python-pandapipes
2901 (package
2902 (name "python-pandapipes")
2903 (version "0.14.0")
2904 (source
2905 (origin
2906 (method git-fetch)
2907 (uri (git-reference
2908 (url "https://github.com/e2nIEE/pandapipes")
2909 (commit (string-append "v" version))))
2910 (file-name (git-file-name name version))
2911 (sha256
2912 (base32 "09cq1dsixsjlc4fkp1b1bsa1ibc20sz350cx4bsq8nkjc02pr05b"))))
2913 (build-system pyproject-build-system)
2914 (native-inputs (list python-nbmake
2915 python-pytest
2916 python-setuptools))
2917 (propagated-inputs (list python-matplotlib
2918 python-pandapower
2919 python-shapely))
2920 (home-page "http://www.pandapipes.org")
2921 (synopsis "Simulation of multi energy grids")
2922 (description
2923 "This package provides a pipeflow calculation tool that complements
2924@code{pandapower} in the simulation of multi energy grids.")
2925 (license license:bsd-3)))
2926
2927(define-public python-scikit-rf
2928 (package
2929 (name "python-scikit-rf")
2930 (version "1.11.0")
2931 (source (origin
2932 (method git-fetch) ;PyPI misses some files required for tests
2933 (uri (git-reference
2934 (url "https://github.com/scikit-rf/scikit-rf")
2935 (commit (string-append "v" version))))
2936 (sha256
2937 (base32
2938 "1zcrm41jinirc54s3g9h8d7lxxcmz536662ips12rmn0qgyxh6bp"))
2939 (file-name (git-file-name name version))))
2940 (build-system pyproject-build-system)
2941 (propagated-inputs (list python-numpy
2942 python-pandas
2943 python-scipy
2944 python-typing-extensions))
2945 (native-inputs (list python-matplotlib
2946 python-networkx
2947 python-openpyxl
2948 python-pytest
2949 python-pytest-mock
2950 python-pyvisa
2951 python-setuptools
2952 python-wheel))
2953 (home-page "https://scikit-rf.org/")
2954 (synopsis "Radio frequency and Microwave Engineering Scikit")
2955 (description "Scikit-rf, or @code{skrf}, is a Python package for RF and
2956Microwave engineering.")
2957 (license license:bsd-3)))
2958
2959(define-public python-lcapy
2960 (package
2961 (name "python-lcapy")
2962 (version "1.26")
2963 (source
2964 (origin
2965 (method git-fetch)
2966 (uri (git-reference
2967 (url "https://github.com/mph-/lcapy")
2968 (commit (string-append "V" version))))
2969 (file-name (git-file-name name version))
2970 (sha256
2971 (base32 "1lv67sb0qfadj9ppdi7vvgngi19nq0ywyrlpind5s9ncjzpikhlf"))))
2972 (build-system pyproject-build-system)
2973 (arguments
2974 (list
2975 ;; This test fails by FileNotFoundError (a schematic file), possibly
2976 ;; because it's not included in PyPI.
2977 #:test-flags #~(list "-k" "not test_circuitgraph")
2978 #:phases #~(modify-phases %standard-phases
2979 (add-after 'unpack 'remove-importlib
2980 (lambda _
2981 (substitute* "setup.py"
2982 ;; Archived project that exists to maintain Python2
2983 ;; compatibility.
2984 (("'importlib',") "")))))))
2985 (propagated-inputs (list python-ipython
2986 python-matplotlib
2987 python-networkx
2988 python-numpy
2989 python-property-cached
2990 python-scipy
2991 python-sympy))
2992 (native-inputs (list python-pytest
2993 python-setuptools))
2994 (home-page "https://github.com/mph-/lcapy")
2995 (synopsis "Symbolic linear circuit analysis")
2996 (description "Lcapy is a Python package for linear circuit analysis. It
2997uses SymPy for symbolic mathematics.
2998
2999Lcapy can symbolically analyse circuits described with netlists or by
3000series/parallel combinations of components. It can also manipulate
3001ontinuous-time and discret-time expressions.")
3002 (license license:lgpl2.1+)))
3003
3004(define-public openscad
3005 (let ((commit "04834adb1ba3c9a6e4160747c91cbadbce9c37b3")
3006 (version "2026.07.26")
3007 (revision "0"))
3008 (package
3009 (name "openscad")
3010 (version (git-version version revision commit))
3011 (source
3012 (origin
3013 (method git-fetch)
3014 (uri (git-reference
3015 (url "https://github.com/openscad/openscad")
3016 (commit commit)
3017 ;; Needed for libraries/MCAD, a library specific to OpenSCAD
3018 ;; which is included as a submodule. All other libraries are
3019 ;; deleted in the patch-source build phase.
3020 (recursive? #t)))
3021 (sha256
3022 (base32 "05dym56zd2r5wrwq58lblhwa3b0xzh443pgsyambpjf9p534zi1k"))
3023 (file-name (git-file-name name version))))
3024 (build-system qt-build-system)
3025 (arguments
3026 (list
3027 #:qtbase qtbase ;for qt-6
3028 ;; OpenSCAD doesn't cope well with out-of-source builds.
3029 #:out-of-source? #f
3030 #:build-type "Release"
3031 #:configure-flags
3032 #~(list "-DUSE_BUILTIN_CLIPPER2=OFF"
3033 "-DUSE_BUILTIN_MANIFOLD=OFF"
3034 "-DUSE_BUILTIN_OPENCSG=OFF"
3035 "-DMANIFOLD_PYBIND=OFF"
3036 "-DMANIFOLD_TEST=OFF"
3037 "-DEXPERIMENTAL=ON"
3038 "-DENABLE_PYTHON=ON"
3039 (string-append "-DOPENSCAD_VERSION="
3040 #$version)
3041 (string-append "-DOPENSCAD_COMMIT="
3042 #$commit)
3043 "-DENABLE_EGL=ON"
3044 "-DENABLE_GLX=ON"
3045 "-B./build")
3046 #:phases
3047 #~(modify-phases %standard-phases
3048 (add-after 'unpack 'patch-source
3049 (lambda* (#:key inputs #:allow-other-keys)
3050 ;; Delete all unbundled libraries to replace them with guix
3051 ;; packages.
3052 (delete-file-recursively "submodules")
3053 ;; Fix: Dependency lib3mf is not found due to using a wrong
3054 ;; variable name in the CMake config (see
3055 ;; https://github.com/openscad/openscad/issues/5877).
3056 (substitute* "cmake/Modules/FindLib3MF.cmake"
3057 (("PC_LIB3MF_INCLUDE_DIRS")
3058 "PC_LIB3MF_INCLUDEDIR"))
3059 (substitute* "CMakeLists.txt"
3060 ;; Remove bundled libraries from cmake.
3061 (("add_subdirectory\\(submodules\\)")
3062 "")
3063 ;; Fix detection of EGL (see
3064 ;; https://github.com/openscad/openscad/issues/5880).
3065 (("target_link_libraries\\(OpenSCADLibInternal PUBLIC OpenGL::EGL\\)")
3066 "find_package(ECM REQUIRED NO_MODULE)
3067 list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
3068 find_package(EGL REQUIRED)
3069 target_link_libraries(OpenSCADLibInternal PRIVATE EGL::EGL)")
3070 ;; Use the system sanitizers-cmake module.
3071 (("\\$\\{CMAKE_SOURCE_DIR\\}/submodules/sanitizers-cmake/cmake")
3072 (string-append (assoc-ref inputs "sanitizers-cmake")
3073 "/share/sanitizers-cmake/cmake")))))
3074 ;; Tests will fail if the build doesn't happen in a
3075 ;; subdirectory of the source directory.
3076 (add-before 'build 'create-build-dir
3077 (lambda _
3078 (mkdir-p "./build")
3079 (chdir "./build")))
3080 (add-before 'check 'patch-tests
3081 (lambda _
3082 ;; Required for fontconfig
3083 (setenv "HOME" "/tmp"))))))
3084 (inputs (list boost
3085 cairomm
3086 cgal
3087 clipper2
3088 double-conversion
3089 eigen
3090 egl-wayland
3091 fontconfig
3092 freetype
3093 glew
3094 glib
3095 gmp
3096 harfbuzz
3097 hidapi
3098 lib3mf
3099 libcanberra
3100 libspnav
3101 libxml2
3102 libzip
3103 manifold
3104 mesa
3105 mimalloc
3106 mpfr
3107 nettle
3108 opencsg
3109 openssl
3110 python
3111 python-numpy
3112 python-pillow
3113 qscintilla-qt6
3114 qt5compat
3115 qtmultimedia
3116 qtsvg
3117 qtwayland
3118 sanitizers-cmake
3119 onetbb))
3120 (native-inputs (list bison
3121 extra-cmake-modules
3122 flex
3123 gettext-minimal
3124 pkg-config
3125 xvfb-run
3126 ;; the following are only needed for tests
3127 imagemagick
3128 ghostscript
3129 procps
3130 xorg-server-for-tests))
3131 (synopsis "Script-based 3D modeling application")
3132 (description
3133 "OpenSCAD is a software for creating solid 3D CAD objects. It is free
3134software and available for Linux/UNIX, MS Windows and macOS.
3135Unlike most free software for creating 3D models (such as the famous
3136application Blender), OpenSCAD focuses on the CAD aspects rather than the
3137artistic aspects of 3D modeling. Thus this might be the application you are
3138looking for when you are planning to create 3D models of machine parts but
3139probably not the tool for creating computer-animated movies.
3140OpenSCAD is not an interactive modeler. Instead it is more like a 3D-compiler
3141that reads a script file that describes the object and renders the 3D model
3142from this script file. This gives you, the designer, complete control over the
3143modeling process and enables you to easily change any step in the modeling
3144process or make designs that are defined by configurable parameters.
3145OpenSCAD provides two main modeling techniques: First there is constructive
3146solid geometry (aka CSG) and second there is extrusion of 2D outlines. As the
3147data exchange format for these 2D outlines Autocad DXF files are used. In
3148addition to 2D paths for extrusion it is also possible to read design
3149parameters from DXF files. Besides DXF files OpenSCAD can read and create 3D
3150models in the STL and OFF file formats.")
3151 (home-page "https://openscad.org/")
3152 (license license:gpl2+))))
3153
3154(define-public pythonscad
3155 (package
3156 (inherit openscad)
3157 (name "pythonscad")
3158 (version "0.8.4")
3159 (source
3160 (origin
3161 (method git-fetch)
3162 (uri (git-reference
3163 (url "https://github.com/pythonscad/pythonscad")
3164 (commit (string-append "v" version))
3165 ;; Needed for libraries/MCAD, a library specific to OpenSCAD
3166 ;; which is included as a submodule. All other libraries are
3167 ;; deleted in the patch-source build phase.
3168 (recursive? #t)))
3169 (sha256
3170 (base32 "0gnifi8is0dl00vir5nd1k76kkcavb62v115g34198lzqnwiy0fc"))
3171 (modules '((guix build utils)))
3172 (snippet #~(begin
3173 ;; Delete all unbundled libraries to replace them with
3174 ;; guix packages.
3175 (delete-file-recursively "submodules")
3176 (substitute* "CMakeLists.txt"
3177 ;; Remove bundled libraries from cmake.
3178 (("add_subdirectory\\(submodules\\)")
3179 ""))))
3180 (file-name (git-file-name name version))))
3181 (arguments
3182 (substitute-keyword-arguments arguments
3183 ((#:configure-flags flags)
3184 #~(begin
3185 (use-modules (srfi srfi-1))
3186 (append (remove (lambda (flag)
3187 (or (string-prefix? "-DOPENSCAD_VERSION=" flag)
3188 (string-prefix? "-DOPENSCAD_COMMIT=" flag)))
3189 #$flags)
3190 (list "-DENABLE_LIBFIVE=ON" "-DUSE_BUILTIN_LIBFIVE=OFF"
3191 "-DUSE_QT6=ON"
3192 (string-append "-DOPENSCAD_VERSION="
3193 #$version)
3194 (string-append "-DPYTHON_VERSION="
3195 #$(version-major+minor (package-version
3196 python)))))))
3197 ((#:phases phases)
3198 #~(modify-phases #$phases
3199 (replace 'patch-source
3200 (lambda* (#:key inputs #:allow-other-keys)
3201 (substitute* "CMakeLists.txt"
3202 ;; Fix detection of EGL (see
3203 ;; https://github.com/openscad/openscad/issues/5880).
3204 (("target_link_libraries\\(OpenSCADLibInternal PUBLIC OpenGL::EGL\\)")
3205 "find_package(ECM REQUIRED NO_MODULE)
3206 list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
3207 find_package(EGL REQUIRED)
3208 target_link_libraries(OpenSCADLibInternal PUBLIC EGL::EGL)")
3209 ;; Use the system sanitizers-cmake module.
3210 (("\\$\\{CMAKE_SOURCE_DIR\\}/submodules/sanitizers-cmake/cmake")
3211 (string-append (assoc-ref inputs "sanitizers-cmake")
3212 "/share/sanitizers-cmake/cmake")))))))))
3213 (inputs (modify-inputs inputs
3214 (append curl libfive)))
3215 (synopsis "Script-based 3D modeling app with Python support")
3216 (description
3217 "PythonSCAD is a programmatic 3D modeling application. It allows you
3218to turn simple code into 3D models suitable for 3D printing. It is a fork of
3219OpenSCAD which not only adds support for using Python as a native language,
3220but also adds new features and improves existing ones.")
3221 (home-page "https://pythonscad.org/")
3222 (license license:gpl2+)))
3223
3224(define-public emacs-scad-mode
3225 (package
3226 (name "emacs-scad-mode")
3227 (version "99.0")
3228 (source
3229 (origin
3230 (method git-fetch)
3231 (uri (git-reference
3232 (url "https://github.com/openscad/emacs-scad-mode")
3233 (commit version)))
3234 (sha256
3235 (base32 "0mqfvff8f7lqjviwz30j7vkb098xd0k8bdzznb77aw4q7gdsf8nm"))
3236 (file-name (git-file-name name version))))
3237 (build-system emacs-build-system)
3238 (arguments (list #:tests? #f)) ; no tests
3239 (propagated-inputs (list emacs-compat))
3240 (synopsis "Emacs mode to edit OpenSCAD files")
3241 (description
3242 "@code{scad-mode} provides an Emacs major mode for editing
3243OpenSCAD code. Features:
3244@itemize
3245@item Syntax highlighting
3246@item
3247Basic completion function (press @kbd{M-TAB})
3248@item
3249Preview rendered model in separate window (press @kbd{C-c C-c})
3250@item
3251Open buffer in OpenSCAD (press @kbd{C-c C-o})
3252@item
3253Export buffer with OpenSCAD (press @kbd{C-c C-e})
3254@item
3255Flymake support (enable flymake-mode in scad-mode buffers)
3256@item
3257Org Babel support (@code{scad} source blocks)
3258@end itemize")
3259 (home-page "https://openscad.org/")
3260 (license license:gpl3+)))
3261
3262(define-public emacs-scad-dbus
3263 (package
3264 (name "emacs-scad-dbus")
3265 (version "0.1")
3266 (properties '((release-tag-prefix . "^v")
3267 (release-tag-version-delimiter . ".")))
3268 (source
3269 (origin
3270 (method git-fetch)
3271 (uri (git-reference
3272 (url "https://github.com/lenbok/scad-dbus")
3273 (commit (string-append "v" version))))
3274 (file-name (git-file-name name version))
3275 (sha256
3276 (base32 "09p1icdiwq6r5clnqljg058vn84acyf33jwqpfjkkm0l5pbvcgn0"))))
3277 (build-system emacs-build-system)
3278 (propagated-inputs (list emacs-scad-mode emacs-hydra emacs-compat))
3279 (synopsis "Control OpenSCAD from Emacs using D-Bus")
3280 (description
3281 "scad-dbus allows controlling @code{OpenSCAD} from within @code{Emacs} via
3282D-Bus without having to switch programs or reach for the mouse.")
3283 (home-page "https://github.com/lenbok/scad-dbus")
3284 (license license:gpl3+)))
3285
3286(define-public ondsel-solver
3287 (let ((commit "2e3659c4bce3e6885269e0cb3d640261b2a91108")
3288 (revision "1"))
3289 (package
3290 (name "ondsel-solver")
3291 ;; There's no tagged release
3292 (version (git-version "0.0.0" revision commit))
3293 (source
3294 (origin
3295 (method git-fetch)
3296 (uri (git-reference
3297 (url "https://github.com/Ondsel-Development/OndselSolver")
3298 (commit commit)))
3299 (file-name (git-file-name name version))
3300 (sha256
3301 (base32 "1bgk3asyz47r1kvdgcz8q7sh1g29przdsx9ib1jqqbc0nv8ww68v"))))
3302 (build-system cmake-build-system)
3303 (arguments
3304 `(#:tests? #f)) ;; Tests require Google's gtest and gmock
3305 ;; The company is shutting down, so https://ondsel.com may not exist for long
3306 (home-page "https://github.com/Ondsel-Development/OndselSolver")
3307 (synopsis "Assembly Constraints and Multibody Dynamics code")
3308 (description
3309 "The OndselSolver library for assembly constraints and multibody
3310dynamics is used by FreeCAD 1.0.0 for its new Assembly workbench.")
3311 (license license:lgpl2.1+))))
3312
3313(define-public freecad
3314 (package
3315 (name "freecad")
3316 (version "1.1.3")
3317 (source
3318 (origin
3319 (method git-fetch)
3320 (uri (git-reference
3321 (url "https://github.com/FreeCAD/FreeCAD")
3322 (commit version)
3323 (recursive? #t))) ;needed for the AddonManager
3324 (file-name (git-file-name name version))
3325 (sha256
3326 (base32 "1lhi9haf3gf0x8h927krd917v1i76labjkry1hh7xhbxvnnvrzj4"))
3327 (snippet
3328 #~(begin
3329 (use-modules (guix build utils))
3330 ;; not required, because 3D mouse support is OFF
3331 (delete-file-recursively "src/3rdParty/3Dconnexion")
3332 (delete-file-recursively "src/3rdParty/GSL") ;; c++-gsl
3333 (delete-file-recursively "src/3rdParty/OndselSolver") ;; ondsel-solver
3334 (delete-file-recursively "src/3rdParty/OpenGL") ;; glext.h from mesa
3335 (delete-file-recursively "src/3rdParty/json"))))) ;; nlohmann-json
3336 (build-system qt-build-system)
3337 (arguments
3338 (list
3339 #:qtbase qtbase ;for Qt 6
3340 #:tests? #f ;; Project has tests, but they are a pain to build
3341 #:configure-flags
3342 #~(list
3343 "-DBUILD_DRAWING:BOOL=ON"
3344 "-DBUILD_FLAT_MESH:BOOL=ON"
3345 "-DENABLE_DEVELOPER_TESTS=OFF" ;; see the above: #:tests? comment
3346 "-DFREECAD_USE_EXTERNAL_ONDSELSOLVER=ON" ;; unbundle ondsel-solver
3347 ;; Do not try to install modules into system python
3348 "-DINSTALL_TO_SITEPACKAGES=OFF"
3349 (string-append "-DCMAKE_INSTALL_LIBDIR=" #$output "/lib"))
3350 #:phases
3351 #~(modify-phases %standard-phases
3352 (add-after 'unpack 'fix-json-include
3353 (lambda _
3354 (substitute* "src/Mod/PartDesign/App/FeatureHole.h"
3355 (("\"json_fwd\\.hpp\"")
3356 "<nlohmann/json_fwd.hpp>"))
3357 (substitute* "src/Mod/PartDesign/App/FeatureHole.cpp"
3358 (("\"json\\.hpp\"")
3359 "<nlohmann/json.hpp>"))))
3360 (add-before 'configure 'restore-pythonpath
3361 (lambda _
3362 (substitute* "src/Main/MainGui.cpp"
3363 (("_?putenv\\(\"PYTHONPATH=\"\\);") ""))))
3364 (add-after 'install 'wrap-pythonpath
3365 (lambda _
3366 (wrap-program (string-append #$output "/bin/FreeCAD")
3367 (list "GUIX_PYTHONPATH"
3368 'prefix (list (getenv "GUIX_PYTHONPATH")))))))))
3369 (native-inputs
3370 (list c++-gsl
3371 doxygen
3372 graphviz
3373 pybind11
3374 qttools
3375 pkg-config
3376 swig-4.4))
3377 (inputs
3378 (list bash-minimal
3379 boost
3380 coin3d
3381 double-conversion
3382 eigen
3383 fmt
3384 fontconfig
3385 freetype
3386 gl2ps
3387 glew
3388 hdf5-1.10
3389 icu4c
3390 jsoncpp
3391 libarea
3392 libjpeg-turbo
3393 libmedfile
3394 libspnav
3395 libtheora
3396 libtiff
3397 libxi
3398 libxml++
3399 libxmu
3400 lz4
3401 netcdf
3402 nlohmann-json
3403 ondsel-solver
3404 opencascade-occt
3405 openmpi
3406 proj
3407 python-gitpython
3408 python-matplotlib
3409 python-networkx ; For the SheetMetal Addon
3410 python-pivy
3411 python-ply
3412 python-pyside-6
3413 python-pyyaml
3414 python-wrapper
3415 qtsvg
3416 qtwebchannel
3417 qtwebengine
3418 qtwayland
3419 sqlite
3420 onetbb ;same version as opencascade-occt
3421 vtk
3422 xerces-c
3423 yaml-cpp
3424 zlib))
3425 (home-page "https://www.freecad.org/")
3426 (synopsis "Your Own 3D Parametric Modeler")
3427 (description
3428 "FreeCAD is a general-purpose, feature-based, parametric 3D modeler for
3429CAD, MCAD, CAx, CAE, and PLM. It is aimed directly at mechanical engineering
3430and product design but also fits a wider range of uses in engineering, such as
3431architecture or other engineering specialties. It is modular, allowing for
3432extension and customization.")
3433 (license
3434 (list
3435 license:lgpl2.1+
3436 license:lgpl2.0+
3437 license:gpl3+
3438 license:bsd-3))))
3439
3440(define-public libmedfile
3441 (package
3442 (name "libmedfile")
3443 (version "6.0.1")
3444 (outputs '("out" "doc"))
3445 (source
3446 (origin
3447 (method url-fetch)
3448 (uri (string-append
3449 "https://files.salome-platform.org/Salome/medfile/med-"
3450 version ".tar.gz"))
3451 (sha256
3452 (base32
3453 "1a0zbdaj3s459s0cdayq4s3k3vbrfg7y32sf7s7qvi2bhz3fvwgq"))))
3454 (build-system cmake-build-system)
3455 (arguments
3456 (list
3457 #:parallel-tests? #f
3458 #:configure-flags
3459 #~(list "-DMEDFILE_BUILD_DOC=ON")
3460 #:phases
3461 #~(modify-phases %standard-phases
3462 (add-after 'install 'remove-test-output
3463 (lambda _
3464 (delete-file-recursively
3465 (string-append #$output "/bin/testc"))))
3466 (add-after 'install 'move-html-documentation
3467 (lambda _
3468 (mkdir-p (string-append #$output:doc "/share"))
3469 (rename-file (string-append #$output "/share/doc")
3470 (string-append #$output:doc "/share/doc")))))))
3471 (inputs (list hdf5 zlib))
3472 (native-inputs (list doxygen graphviz-minimal))
3473 (home-page "https://www.salome-platform.org")
3474 (synopsis "Library to read and write MED files")
3475 (description
3476 "The purpose of the MED module is to provide a standard for storing and
3477recovering computer data associated to numerical meshes and fields, and to
3478facilitate the exchange between codes and solvers.
3479
3480The persistent data storage is based upon HDF format (like CGNS, a standard
3481developed by Boeing and NASA in the area of Computational Fluid Dynamic).
3482
3483MED also provides structures to hold data on meshes and fields. These
3484structures are exchanged between solvers, hide the communication level (CORBA
3485or MPI), and offer persistence (read/write in .med files).
3486
3487The main benefit of a common exchange format is reduced complexity of code
3488coupling. It also allows sharing such high level functionalities as
3489computation of nodal connectivity of sub-elements (faces and edges),
3490arithmetic operations on fields, entity location functionalities, and
3491interpolation toolkit.")
3492 (license license:gpl3+)))
3493
3494(define-public python-motulator
3495 (package
3496 (name "python-motulator")
3497 (version "0.7.5")
3498 (source
3499 (origin
3500 (method git-fetch)
3501 (uri (git-reference
3502 (url "https://github.com/Aalto-Electric-Drives/motulator/")
3503 (commit (string-append "v" version))))
3504 (file-name (git-file-name name version))
3505 (sha256
3506 (base32 "1zwhypvnhy3jhkiflsd51yq9vfkyrqn66a3xkrkir21xfk0igpr7"))))
3507 (build-system pyproject-build-system)
3508 (arguments
3509 (list #:tests? #f)) ; there are no tests
3510 (propagated-inputs
3511 (list python-numpy python-matplotlib python-scipy python-tqdm))
3512 (native-inputs (list python-hatchling))
3513 (home-page "https://aalto-electric-drives.github.io/motulator/")
3514 (synopsis "Motor Drive Simulator in Python")
3515 (description "This package includes simulation models for an induction
3516motor, a synchronous reluctance motor, and a permanent-magnet synchronous
3517motor. The motor models are simulated in the continuous-time domain while the
3518control algorithms run in discrete time. The default solver is the explicit
3519Runge-Kutta method of order 5(4) from @code{scipy.integrate.solve_ivp.}")
3520 (license license:expat)))
3521
3522(define-public cgns
3523 (package
3524 (name "cgns")
3525 (version "4.5.2")
3526 (source
3527 (origin
3528 (method git-fetch)
3529 (uri (git-reference
3530 (url "https://github.com/CGNS/CGNS")
3531 (commit (string-append "v" version))))
3532 (file-name (git-file-name name version))
3533 (sha256
3534 (base32 "0r8y6lddp7q9nb6804c6bbr4y0pv7ssdzi9m5ddx50ksvfv382fw"))))
3535 (build-system cmake-build-system)
3536 (arguments
3537 (list #:configure-flags
3538 '(list "-DCGNS_ENABLE_TESTS=ON"
3539 "-DCGNS_ENABLE_FORTRAN=ON")))
3540 (inputs (list hdf5 gfortran))
3541 (home-page "https://cgns.org/")
3542 (synopsis "Read and write computational fluid dynamics analysis data")
3543 (description "This package provides software that reads, writes, and
3544modifies data in the @dfn{CFD General Notation System} (CGNS) format. The
3545format is meant for recording and recovering computer data associated with the
3546numerical solution of fluid dynamics equations. The format is a conceptual
3547entity established by the documentation; the software is a physical product
3548supplied to enable developers to access and produce data recorded in that
3549format.")
3550 (license license:zlib)))
3551
3552(define-public libarea
3553 (let ((revision "1")
3554 (commit "8f8bac811c10f1f01fda0d742a18591f61dd76ee"))
3555 (package
3556 (name "libarea")
3557 (version (git-version "0" revision commit))
3558 (source
3559 (origin
3560 (method git-fetch)
3561 (uri (git-reference (url "https://github.com/Heeks/libarea")
3562 (commit commit)))
3563 (file-name (git-file-name name version))
3564 (sha256
3565 (base32 "0pvqz6cabxqdz5y26wnj6alkn8v5d7gkx0d3h8xmg4lvy9r3kh3g"))))
3566 (build-system gnu-build-system)
3567 (inputs (list boost python-wrapper))
3568 (native-inputs
3569 `(("cmake" ,cmake-minimal)))
3570 (arguments
3571 `(#:tests? #f
3572 #:phases
3573 (modify-phases %standard-phases
3574 (add-after 'configure 'cmake-configure
3575 (lambda* (#:key inputs outputs #:allow-other-keys)
3576 (let ((out (assoc-ref outputs "out"))
3577 (cmake (assoc-ref inputs "cmake")))
3578 (mkdir-p "build")
3579 (invoke "cmake"
3580 "-DCMAKE_CXX_FLAGS=-DBOOST_TIMER_ENABLE_DEPRECATED"
3581 (string-append "-DCMAKE_INSTALL_PREFIX=" out)))))
3582 (delete 'configure))))
3583 (home-page "https://github.com/Heeks/libarea")
3584 (synopsis
3585 "Library and python module for pocketing and profiling operations")
3586 (description
3587 "Area is a CAM-related software for pocketing operation.
3588
3589This project provides library and associated python-module to compute pocket
3590operations.")
3591 (license (list
3592 license:bsd-3
3593 license:gpl3+)))))
3594
3595(define-public libspnav
3596 (package
3597 (name "libspnav")
3598 (version "1.2")
3599 (source (origin
3600 (method git-fetch)
3601 (uri (git-reference
3602 (url "https://github.com/FreeSpacenav/libspnav")
3603 (commit (string-append "v" version))))
3604 (sha256
3605 (base32
3606 "12z548jsyxcgyhh9gazw032n3igw6g15y07h4c1nlk2cd8gv6i70"))
3607 (file-name (git-file-name name version))))
3608 (build-system gnu-build-system)
3609 (inputs
3610 (list libx11))
3611 (arguments
3612 (list
3613 #:tests? #f ; there are no tests
3614 #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))))
3615 (home-page "https://spacenav.sourceforge.net/")
3616 (synopsis
3617 "Library for communicating with spacenavd or 3dxsrv")
3618 (description
3619 "The libspnav library is provided as a replacement of the magellan
3620library. It provides a cleaner, and more orthogonal interface. libspnav
3621supports both the original X11 protocol for communicating with the driver, and
3622the new alternative non-X protocol. Programs that choose to use the X11
3623protocol, are automatically compatible with either the free spacenavd driver
3624or the official 3dxserv, as if they were using the magellan SDK.
3625
3626Also, libspnav provides a magellan API wrapper on top of the new API. So, any
3627applications that were using the magellan library, can switch to libspnav
3628without any changes. And programmers that are familiar with the magellan API
3629can continue using it with a free library without the restrictions of the
3630official SDK.")
3631 (license license:bsd-3)))
3632
3633(define-public openctm
3634 (let ((revision 603))
3635 ;; Previous versions don't compile, they need to link libGL and libGLU.
3636 ;; Fixed in this revision.
3637 (package
3638 (name "openctm")
3639 (version (string-append "1.0.3." (number->string revision)))
3640 (source
3641 (origin
3642 (method svn-fetch)
3643 (uri (svn-reference
3644 (url "https://svn.code.sf.net/p/openctm/code/trunk")
3645 (revision revision)))
3646 (file-name (string-append name "-" version "-checkout"))
3647 (sha256
3648 (base32 "01wb70m48xh5gwhv60a5brv4sxl0i0rh038w32cgnlxn5x86s9f1"))))
3649 (build-system gnu-build-system)
3650 (native-inputs
3651 (list pkg-config))
3652 (inputs
3653 `(("mesa" ,mesa)
3654 ("glu" ,glu)
3655 ("glut" ,freeglut)
3656 ("gtk" ,gtk+-2)))
3657 (arguments
3658 `(#:tests? #f ;no tests
3659 #:phases
3660 (modify-phases %standard-phases
3661 (replace 'configure
3662 (lambda* (#:key outputs #:allow-other-keys)
3663 (rename-file "Makefile.linux" "Makefile")
3664 (let ((out (assoc-ref outputs "out")))
3665 ;; Create output directories.
3666 (mkdir-p (string-append out "/lib"))
3667 (mkdir-p (string-append out "/include"))
3668 (mkdir-p (string-append out "/bin"))
3669 ;; Fix rpath.
3670 (substitute* "tools/Makefile.linux"
3671 (("-rpath,\\.")
3672 (string-append "-rpath," out "/lib/"))
3673 (("/usr/local")
3674 out))
3675 ;; Set right output.
3676 (substitute* "Makefile"
3677 (("/usr/lib")
3678 (string-append out "/lib"))
3679 (("\\/usr\\/local")
3680 out))
3681 #t))))))
3682 (synopsis "3D triangle mesh format and related tools and libraries")
3683 (description "OpenCTM is a file format, a software library and a tool set
3684for compression of 3D triangle meshes. The geometry is compressed to a
3685fraction of comparable file formats (3DS, STL, COLLADA...), and the format is
3686accessible through a simple API")
3687 (license license:zlib)
3688 (home-page "https://openctm.sourceforge.net/"))))
3689
3690(define-public lib3ds
3691 (package
3692 (name "lib3ds")
3693 (version "1.3.0")
3694 (source
3695 (origin
3696 (method url-fetch)
3697 (uri (string-append
3698 "https://storage.googleapis.com/google-code-archive-downloads"
3699 "/v2/code.google.com/lib3ds/lib3ds-" version ".zip"))
3700 (sha256
3701 (base32 "1qr9arfdkjf7q11xhvxwzmhxqz3nhcjkyb8zzfjpz9jm54q0rc7m"))))
3702 (build-system gnu-build-system)
3703 (native-inputs
3704 (list unzip))
3705 (home-page "https://code.google.com/archive/p/lib3ds")
3706 (synopsis "3DS format file toolkit")
3707 (description "Lib3ds is a toolkit for handling the 3DS format for 3D
3708model files. Its main goal is to simplify the creation of 3DS import and
3709export filters.")
3710 (license license:lgpl2.1+)))
3711
3712(define-public meshlab
3713 (package
3714 (name "meshlab")
3715 (version "2025.07")
3716 (source (origin
3717 (method git-fetch)
3718 (uri (git-reference
3719 (url "https://github.com/cnr-isti-vclab/meshlab")
3720 (commit (string-append "MeshLab-" version))
3721 (recursive? #t))) ;for vcglib
3722 (file-name (git-file-name name version))
3723 (sha256
3724 (base32 "2n1l1rd2qbdsy9vw4pdlz19hsg7x8zkd6vfvdqh54gzhkn4f2k08"))))
3725 (build-system qt-build-system)
3726 (inputs
3727 (list boost
3728 cgal
3729 embree
3730 glew
3731 lib3ds
3732 lib3mf
3733 libe57format
3734 libigl
3735 mpfr
3736 muparser
3737 onetbb
3738 openctm
3739 qhull
3740 tinygltf
3741 xerces-c))
3742 (arguments
3743 (list #:tests? #f ; Has no tests
3744 #:configure-flags
3745 #~(list
3746 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_BOOST=OFF"
3747 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_CGAL=OFF"
3748 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_EMBREE=OFF"
3749 "-DMESHLAB_ALLOW_BUNDLED_SOURCE_GLEW=OFF"
3750 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_LEVMAR=OFF"
3751 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_LIB3DS=OFF"
3752 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_LIB3MF=OFF"
3753 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBE57=OFF"
3754 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBIGL=OFF"
3755 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_MUPARSER=OFF"
3756 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_NEXUS=OFF"
3757 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_OPENCTM=OFF"
3758 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_QHULL=OFF"
3759 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_STRUCTURE_SYNTH=OFF"
3760 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_TINYGLTF=OFF"
3761 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_U3D=OFF"
3762 "-DMESHLAB_ALLOW_DOWNLOAD_SOURCE_XERCES=OFF"
3763 (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath="
3764 #$output "/lib/meshlab")
3765 (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath="
3766 #$output "/lib/meshlab")
3767 (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
3768 #$output "/lib/meshlab"))))
3769 (synopsis "3D triangular mesh processing and editing software")
3770 (home-page "https://www.meshlab.net/")
3771 (description "MeshLab is a system for the processing and editing of large,
3772unstructured, 3D triangular meshes. It is aimed to help the processing of the
3773typical, not-so-small unstructured models arising in 3D scanning, providing a
3774set of tools for editing, cleaning, healing, inspecting, rendering and
3775converting this kind of meshes. These tools include MeshLab proper, a
3776versatile program with a graphical user interface, and @samp{meshlabserver}, a
3777program that can perform mesh processing tasks in batch mode, without a GUI.")
3778 (license license:gpl3+)))
3779
3780(define-public poke
3781 (package
3782 (name "poke")
3783 (version "5.0")
3784 (source (origin
3785 (method url-fetch)
3786 (uri (string-append "mirror://gnu/poke/poke-" version
3787 ".tar.gz"))
3788 (sha256
3789 (base32 "13sv5x73g26x0qk5cxawm4pqk470v5xfl8w6p08q2742psddawv8"))
3790 (modules '((guix build utils)))
3791 (snippet
3792 '(begin
3793 ;; Delete files generated by Bison.
3794 (delete-file "gl/parse-datetime.c")
3795 (delete-file "jitter/example-vms/structured/structured-parser.c")
3796 (delete-file "jitter/example-vms/structured/structured-parser.h")
3797 (delete-file "jitter/jitterc/jitterc-parser.c")
3798 (delete-file "jitter/jitterc/jitterc-parser.h")
3799 (delete-file "jitter/jitter/jitter-routine-parser.c")
3800 (delete-file "jitter/jitter/jitter-routine-parser.h")
3801 (delete-file "libpoke/pkl-tab.c")
3802 (delete-file "libpoke/pkl-tab.h")
3803 ;; Delete files generated by flex.
3804 (delete-file "jitter/example-vms/structured/structured-scanner.c")
3805 (delete-file "jitter/example-vms/structured/structured-scanner.h")
3806 (delete-file "jitter/jitterc/jitterc-scanner.c")
3807 (delete-file "jitter/jitterc/jitterc-scanner.h")
3808 (delete-file "jitter/jitter/jitter-routine-scanner.c")
3809 (delete-file "jitter/jitter/jitter-routine-scanner.h")
3810 (delete-file "libpoke/pkl-lex.c")
3811 (delete-file "libpoke/pkl-lex.h")
3812 (delete-file "pokefmt/pokefmt.c")
3813 (delete-file "pokefmt/pokefmt.h")
3814 ;; Other generated files:
3815 (delete-file "jitter/example-vms/jitterlisp/jitterlispvm-vm1.c")
3816 (delete-file "jitter/example-vms/jitterlisp/jitterlispvm-vm2.c")
3817 (delete-file "jitter/example-vms/jitterlisp/jitterlispvm-vm.h")
3818 (delete-file "jitter/example-vms/structured/structuredvm-vm1.c")
3819 (delete-file "jitter/example-vms/structured/structuredvm-vm2.c")
3820 (delete-file "jitter/example-vms/structured/structuredvm-vm.h")
3821 (delete-file "jitter/example-vms/structured/structuredvm-vm-main.c")
3822 (delete-file "jitter/example-vms/uninspired/uninspired-vm1.c")
3823 (delete-file "jitter/example-vms/uninspired/uninspired-vm2.c")
3824 (delete-file "jitter/example-vms/uninspired/uninspired-vm.h")
3825 (delete-file "jitter/example-vms/uninspired/uninspired-vm-main.c")
3826 (delete-file "libpoke/pvm-vm.h")
3827 (delete-file "libpoke/pvm-vm1.c")
3828 (delete-file "libpoke/pvm-vm2.c")))))
3829 (build-system gnu-build-system)
3830 (native-inputs (list bison dejagnu flex libtool pkg-config))
3831 ;; FIXME: Enable NBD support by adding `libnbd' (currently unpackaged).
3832 (inputs (list libgc readline libtextstyle))
3833 (arguments
3834 (list
3835 #:imported-modules `((guix build emacs-build-system)
3836 (guix build emacs-utils)
3837 ,@%default-gnu-imported-modules)
3838 #:modules '((guix build gnu-build-system)
3839 ((guix build emacs-build-system) #:prefix emacs:)
3840 (guix build utils))
3841 #:configure-flags
3842 #~(list "--disable-static"
3843 (string-append "--with-vimdir=" #$output
3844 "/share/vim/vimfiles/pack/guix/start/poke")
3845 (string-append "--with-lispdir="
3846 (emacs:elpa-directory #$output)))))
3847 (native-search-paths
3848 (list (search-path-specification
3849 (variable "POKE_LOAD_PATH")
3850 (files '("share/poke/pickles")))))
3851 (home-page "https://www.gnu.org/software/poke/#documentation")
3852 (synopsis "Editing of arbitrary binary data")
3853 (description "GNU poke is an interactive, extensible editor for binary data.
3854Not limited to editing basic entities such as bits and bytes, it provides a
3855full-fledged procedural, interactive programming language designed to describe
3856data structures and to operate on them.")
3857 (license license:gpl3+)))
3858
3859(define-public poke-elf
3860 (package
3861 (name "poke-elf")
3862 (version "1.0")
3863 (source (origin
3864 (method url-fetch)
3865 (uri (string-append "mirror://gnu/poke/poke-elf-" version
3866 ".tar.gz"))
3867 (sha256
3868 (base32
3869 "0x3shih7sjj34f5305kvbp4cfy11m92zwidjk3658m23zkd6gdqa"))))
3870 (build-system gnu-build-system)
3871 (native-inputs (list poke)) ;for the test suite
3872 (home-page "https://jemarch.net/poke-elf")
3873 (synopsis "GNU poke pickle for ELF object files")
3874 (description "@code{poke-elf} is a GNU poke pickle for editing ELF object files,
3875executables, shared libraries and core dumps. It supports many architectures
3876and extensions.")
3877 (license license:gpl3+)))
3878
3879(define-public pcb2gcode
3880 ;; XXX: The latest release was on <2022-09-12>, but master branch contains a
3881 ;; lot of changes and fixes from that time, use the latest commit
3882 ;; instead. Revert to version tag when it's available.
3883 (let ((commit "8c084afd00c6653dfa9cbf24a1dbeeb24f592aa9")
3884 (revision "0"))
3885 (package
3886 (name "pcb2gcode")
3887 (version (git-version "2.5.0" revision commit))
3888 (source
3889 (origin
3890 (method git-fetch)
3891 (uri (git-reference
3892 (url "https://github.com/pcb2gcode/pcb2gcode")
3893 (commit commit)))
3894 (file-name (git-file-name name version))
3895 (sha256
3896 (base32 "19hyzd1601l51bwlv43j8l602nfacbjwqf54m5xsmj50718bcks2"))))
3897 (build-system gnu-build-system)
3898 (native-inputs
3899 (list autoconf
3900 automake
3901 libtool
3902 pkg-config))
3903 (inputs
3904 (list boost
3905 geos
3906 gerbv
3907 glibmm
3908 gtkmm-2
3909 (librsvg-for-system)))
3910 (home-page "https://github.com/pcb2gcode/pcb2gcode")
3911 (synopsis "Generate G-code for milling PCBs")
3912 (description
3913 "pcb2gcode is a command-line program for isolation routing and drilling
3914of PCBs. It takes Gerber files as input and outputs G-code files for the
3915milling of PCBs. It also includes an autoleveller for the automatic dynamic
3916calibration of the milling depth.")
3917 (license license:gpl3+))))
3918
3919;; libdxfrw has no readme, no version release, no tags. Initial commit says
3920;; "libdxfrw-0.6.3 import", but it shares no git history with "upstream"
3921;; https://github.com/codelibs/libdxfrw. Both are difficult to package
3922;; separately as they don't install properly. Copying in-tree instead of
3923;; #:recursive #t to avoid downloading the other bigger dependencies which
3924;; aren't needed.
3925(define libdxfrw-sources
3926 (origin
3927 (method git-fetch)
3928 (uri (git-reference (url
3929 "https://github.com/solvespace/libdxfrw")
3930 (commit
3931 "0b7b7b709d9299565db603f878214656ef5e9ddf")))
3932 (sha256 (base32
3933 "0d2wjq81466m3hb5cffiy99vhx0irwwy47yfxp318k2q4cvd5z2a"))))
3934
3935(define-public solvespace
3936 (let ((commit "70bde63cb32a7f049fa56cbdf924e2695fcb2916")
3937 (version "3.1"))
3938 (package
3939 (name "solvespace")
3940 (version version)
3941 (source (origin
3942 (method git-fetch)
3943 (uri (git-reference
3944 (url "https://github.com/solvespace/solvespace")
3945 (commit commit)))
3946 (file-name (git-file-name name version))
3947 (sha256
3948 (base32
3949 "1hbdln44k00a6vlklv2mq2c9zda3i9d5x0f7ks85w4v6zskhqnra"))))
3950 (build-system cmake-build-system)
3951 (native-inputs (list pkg-config gettext-minimal))
3952 (arguments
3953 (list
3954 #:build-type "Release"
3955 #:tests? #f
3956 #:phases #~(modify-phases %standard-phases
3957 (add-after 'unpack 'unpack-libdxfrw
3958 (lambda _
3959 (copy-recursively #$libdxfrw-sources
3960 "extlib/libdxfrw")))
3961 (add-before 'configure 'embed-git-commit-hash
3962 (lambda _
3963 ;; `git describe` doesn't work here, so embed
3964 ;; the commit hash directly in CMakeLists.txt as
3965 ;; described instead.
3966 (substitute* "CMakeLists.txt"
3967 (("include\\(GetGitCommitHash\\)")
3968 (string-append "set(GIT_COMMIT_HASH "
3969 #$commit ")")))))
3970 (add-before 'configure 'use-packaged-mimalloc
3971 (lambda _
3972 (substitute* "CMakeLists.txt"
3973 (("message\\(STATUS \"Using in-tree mimalloc\"\\)")
3974 "message(STATUS \"Using guix packaged mimalloc\")")
3975 (("add_subdirectory\\(extlib/mimalloc EXCLUDE_FROM_ALL\\)")
3976 "find_package(mimalloc REQUIRED)"))))
3977 (add-after 'install 'wrap-program
3978 (lambda* (#:key inputs outputs #:allow-other-keys)
3979 (wrap-program (string-append (assoc-ref outputs "out")
3980 "/bin/solvespace")
3981 ;; For GtkFileChooserDialog.
3982 `("GSETTINGS_SCHEMA_DIR" =
3983 (,(string-append (assoc-ref inputs "gtk+")
3984 "/share/glib-2.0/schemas")))))))))
3985 (inputs
3986 (list bash-minimal
3987 cairo
3988 eigen
3989 freetype
3990 gtkmm-3
3991 json-c
3992 libpng
3993 libspnav ;spaceware
3994 mimalloc
3995 mesa
3996 zlib))
3997 (synopsis
3998 "Parametric 2D/3D @acronym{CAD, computer-aided design} software")
3999 (description
4000 "SOLVESPACE is a parametric 3D @acronym{CAD,
4001computer-aided design} tool. Applications include:
4002
4003@itemize
4004@item modeling 3D parts — draw with extrudes, revolves, helixes and
4005 Boolean (union / difference / intersection) operations
4006@item modeling 2D parts — draw the part as a single section,
4007 and export DXF, PDF, SVG; use 3D assembly to verify fit
4008@item 3D-printed parts — export the STL or other triangle mesh
4009 expected by most 3D printers
4010@item preparing CAM data — export 2D vector art for a waterjet
4011 machine or laser cutter; or generate STEP or STL, for import into
4012 third-party CAM software for machining
4013@item mechanism design — use the constraint solver to simulate planar
4014 or spatial linkages, with pin, ball, or slide joints
4015@item plane and solid geometry — replace hand-solved trigonometry and spreadsheets
4016 with a live dimensioned drawing
4017@end itemize")
4018 (home-page "https://solvespace.com/")
4019 (license license:gpl3+))))
4020
4021(define-public syscall-intercept
4022 ;; Upstream provides no tag. Also, last version update is 4 years old.
4023 (let ((commit "304404581c57d43478438d175099d20260bae74e")
4024 (revision "0"))
4025 (package
4026 (name "syscall-intercept")
4027 (version (git-version "0.1.0" revision commit))
4028 (source
4029 (origin
4030 (method git-fetch)
4031 (uri
4032 (git-reference
4033 (url "https://github.com/pmem/syscall_intercept/")
4034 (commit commit)))
4035 (file-name (git-file-name name version))
4036 (sha256
4037 (base32 "17sw78xp5wjzv25adpbq3khl8fi0avj7bgpi57q3jnvl3c68xy5z"))))
4038 (native-inputs
4039 (list perl pkg-config))
4040 (inputs
4041 (list capstone))
4042 (build-system cmake-build-system)
4043 (arguments
4044 `(#:build-type "Release"
4045 ;; FIXME: "syscall_format_logging" test fails.
4046 #:tests? #f))
4047 (home-page "https://github.com/pmem/syscall_intercept")
4048 (synopsis "System call intercepting library")
4049 (description
4050 "The system call intercepting library provides a low-level interface
4051for hooking Linux system calls in user space. This is achieved by
4052hot-patching the machine code of the standard C library in the memory of
4053a process.")
4054 (license license:bsd-2))))
4055
4056(define-public xfoil
4057 (package
4058 (name "xfoil")
4059 (version "6.99")
4060 (source
4061 (origin
4062 (method url-fetch)
4063 (uri (string-append "https://web.mit.edu/drela/Public/web/xfoil/xfoil"
4064 version ".tgz"))
4065 (sha256
4066 (base32
4067 "0h5y5v0qlyvi4qc943x394npz4779i8f52iksxshxkjj7xj500jw"))))
4068 (build-system gnu-build-system)
4069 (arguments
4070 `(#:phases
4071 (modify-phases %standard-phases
4072 (delete 'configure)
4073 (add-after 'unpack 'edit-files
4074 (lambda* (#:key outputs #:allow-other-keys)
4075 ;; The instructions in orrs/README say that orrs/bin/osmap.f
4076 ;; should be edited, but that file is never used by XFOIL.
4077 ;; Instead, it is osrc/osmap.f that is used.
4078 (substitute* "osrc/osmap.f"
4079 (("^[ ]{6}DATA OSFILE / '/var/local/codes/orrs/osmap.dat' /")
4080 (let ((replacement (string-append (make-string 6 #\space)
4081 "DATA OSFILE / '"
4082 (assoc-ref outputs "out")
4083 "/share/xfoil/osmap.dat' /")))
4084 ;; In fixed form Fortran, lines cannot exceed 72 columns.
4085 ;; The Guix store path exceeds this limit.
4086 (string-append
4087 (substring replacement 0 72) "\n"
4088 (make-string 5 #\space) "&" (substring replacement 72)))))
4089 (substitute* "orrs/bin/Makefile_DP"
4090 (("^FC = ifort")
4091 "FC = gfortran")
4092 (("^FLG = -O -r8")
4093 "FLG = -O2 -fdefault-real-8"))
4094 (substitute* "plotlib/Makefile"
4095 (("^include ./config.make")
4096 "include ./config.make.gfortranDP"))
4097 (substitute* "bin/Makefile_gfortran"
4098 (("^BINDIR = /home/codes/bin/")
4099 (string-append "BINDIR = " (assoc-ref outputs "out") "/bin"))
4100 (("^CC = cc")
4101 "CC = gcc")
4102 (("^CFLAGS = -O -DUNDERSCORE")
4103 "CFLAGS = -O2 -DUNDERSCORE")
4104 (("^FFLAGS = -O \\$\\(CHK\\) \\$\\(DBL\\)")
4105 "FFLAGS = -O2 $(CHK) $(DBL)")
4106 (("^FFLOPT = -O \\$\\(CHK\\) \\$\\(DBL\\)")
4107 "FFLOPT = -O2 $(CHK) $(DBL)")
4108 ;; Separate the build stage from the install stage.
4109 (("\\$\\(INSTALLCMD\\) xfoil \\$\\(BINDIR\\)") "")
4110 (("\\$\\(INSTALLCMD\\) pxplot \\$\\(BINDIR\\)") "")
4111 (("\\$\\(INSTALLCMD\\) pplot \\$\\(BINDIR\\)") ""))))
4112 (replace 'build
4113 (lambda _
4114 (invoke "make" "-C" "orrs/bin" "-f" "Makefile_DP" "osgen")
4115 (with-directory-excursion "orrs"
4116 (invoke "bin/osgen" "osmaps_ns.lst"))
4117 (invoke "make" "-C" "plotlib")
4118 (substitute* "bin/Makefile_gfortran"
4119 (("^FFLAGS =(.*)$" _ suffix)
4120 (string-append "FFLAGS = -fallow-argument-mismatch "
4121 suffix "\n")))
4122 (invoke "make" "-C" "bin" "-f" "Makefile_gfortran")))
4123 (replace 'install
4124 (lambda* (#:key outputs #:allow-other-keys)
4125 (let* ((out (assoc-ref outputs "out"))
4126 (bin-dir (string-append out "/bin"))
4127 (data-dir (string-append out "/share/xfoil"))
4128 (doc-dir (string-append out "/share/doc/xfoil")))
4129 (mkdir-p bin-dir)
4130 (invoke "make" "-C" "bin" "-f" "Makefile_gfortran" "install")
4131 (mkdir-p data-dir)
4132 (install-file "orrs/osmap.dat" data-dir)
4133 (mkdir-p doc-dir)
4134 (install-file "xfoil_doc.txt" doc-dir)))))
4135 #:tests? #f))
4136 (inputs
4137 (list libx11))
4138 (native-inputs
4139 (list gfortran))
4140 (home-page "https://web.mit.edu/drela/Public/web/xfoil/")
4141 (synopsis "Program for the design and analysis of subsonic airfoils")
4142 (description
4143 "XFOIL is an interactive program for the design and analysis of subsonic
4144isolated airfoils. It consists of a collection of menu-driven routines which
4145perform various useful functions such as:
4146@itemize
4147@item Viscous (or inviscid) analysis of an existing airfoil
4148@item Airfoil design and redesign by interactive modification of surface speed
4149 distributions
4150@item Airfoil redesign by interactive modification of geometric parameters
4151@item Blending of airfoils
4152@item Writing and reading of airfoil coordinates and polar save files
4153@item Plotting of geometry, pressure distributions, and multiple polars
4154@end itemize")
4155 (license license:gpl2+)))
4156
4157(define-public libigl
4158 (package
4159 (name "libigl")
4160 (version "2.4.0")
4161 (source
4162 (origin
4163 (method git-fetch)
4164 (uri (git-reference
4165 (url "https://github.com/libigl/libigl")
4166 (commit (string-append "v" version))))
4167 (file-name (git-file-name name version))
4168 (sha256
4169 (base32
4170 "0qlnpp8nxbahcky4d67dzn0ynbv3v037nbx1akq6h5rzhvkzq40x"))))
4171 (build-system cmake-build-system)
4172 (arguments
4173 (list #:configure-flags
4174 #~(list "-DLIBIGL_USE_STATIC_LIBRARY=OFF"
4175 "-DLIBIGL_BUILD_TESTS=ON"
4176 "-DLIBIGL_BUILD_TUTORIALS=OFF"
4177 "-DLIBIGL_INSTALL=ON"
4178 "-DFETCHCONTENT_FULLY_DISCONNECTED=ON"
4179 (format #f "-DCatch2_DIR=~a/lib/cmake/catch2/"
4180 #$(this-package-input "catch2"))
4181 (format #f "-DSpectra_DIR=~a/share/pectra/cmake/"
4182 #$(this-package-input "spectra"))
4183 ;; The following options disable tests for the corresponding
4184 ;; libraries. The options do not affect whether the libraries are
4185 ;; linked to libigl or not, they are used for tests.
4186 "-DLIBIGL_WITH_COMISO=OFF"
4187 "-DLIBIGL_WITH_CORK=OFF"
4188 "-DLIBIGL_MATLAB=OFF"
4189 "-DLIBIGL_MOSEK=OFF"
4190 ;; XXX: GLFW tests are failing with SEGFAULT. See
4191 ;; <https://github.com/libigl/libigl/issues/2313>
4192 "-DLIBIGL_GLFW_TESTS=OFF")
4193 #:build-type "Release"
4194 #:phases
4195 #~(modify-phases %standard-phases
4196 (add-after 'unpack 'unpack-external
4197 (lambda _
4198 (setenv "HOME" (getcwd)) ;; cmake needs this to export modules
4199 (mkdir "external")
4200 (copy-recursively (assoc-ref %build-inputs "libigl-glad")
4201 "external/glad")
4202 (copy-recursively (assoc-ref %build-inputs "libigl-test-data")
4203 "external/test-data")
4204 (copy-recursively (assoc-ref %build-inputs "libigl-comiso")
4205 "external/comiso")
4206 (copy-recursively (assoc-ref %build-inputs "libigl-tetgen")
4207 "external/tetgen")
4208 (copy-recursively (assoc-ref %build-inputs "libigl-predicates")
4209 "external/predicates")
4210 (copy-recursively (assoc-ref %build-inputs "imguizmo")
4211 "external/imguizmo")
4212 (copy-recursively (assoc-ref %build-inputs "eigen")
4213 "external/eigen")))
4214 (add-after 'unpack-external 'patch-cmake
4215 (lambda* (#:key inputs #:allow-other-keys)
4216 (define (source-dir library-name)
4217 (format #f "SOURCE_DIR \"~a\""
4218 (assoc-ref %build-inputs library-name)))
4219 (define (fix-external-library cmake source)
4220 (substitute* (format #f "cmake/recipes/external/~a.cmake"
4221 cmake)
4222 (("GIT_REPOSITORY.*") (source-dir source))
4223 (("GIT_TAG.*") "")))
4224 ;; Fix references to external libraries
4225 (fix-external-library "comiso" "libigl-comiso")
4226 (fix-external-library "tetgen" "libigl-tetgen")
4227 (fix-external-library "triangle" "libigl-triangle")
4228 (fix-external-library "predicates" "libigl-predicates")
4229 (fix-external-library "glad" "libigl-glad")
4230 (fix-external-library "libigl_tests_data" "libigl-test-data")
4231 (fix-external-library "stb" "libigl-stb")
4232 (substitute* "cmake/recipes/external/imguizmo.cmake"
4233 (("if\\(TARGET imguizmo::imguizmo\\)")
4234 "if(true)")
4235 (("target_link_libraries.*")
4236 (format #f "include_directories(~a/include/imgui/)"
4237 (assoc-ref inputs "imgui"))))
4238
4239 (substitute* "cmake/igl/igl_add_test.cmake"
4240 (("include\\(\".*/contrib/Catch.cmake\"\\)")
4241 (format #f
4242 "include(\"~a/lib/cmake/Catch2/Catch.cmake\")"
4243 (assoc-ref inputs "catch2"))))
4244 (substitute* "cmake/recipes/external/cgal.cmake"
4245 (("FetchContent_Populate\\(cgal\\)")
4246 "find_package(CGAL CONFIG COMPONENTS Core)\nreturn()"))
4247 (substitute* "cmake/recipes/external/eigen.cmake"
4248 (("FetchContent_Populate\\(eigen\\)")
4249 "find_package(Eigen3 CONFIG REQUIRED)\nreturn()"))
4250 (substitute* "cmake/recipes/external/catch2.cmake"
4251 (("message.*")
4252 "find_package(Catch2 CONFIG)\nreturn()"))
4253 (substitute* "cmake/recipes/external/libigl_imgui_fonts.cmake"
4254 (("if\\(TARGET igl::imgui_fonts\\)")
4255 "if(true)"))
4256 (substitute* "cmake/recipes/external/tinyxml2.cmake"
4257 (("FetchContent_Populate\\(tinyxml2\\)")
4258 "find_package(tinyxml2 CONFIG REQUIRED)\nreturn()"))
4259 (substitute* "cmake/recipes/external/embree.cmake"
4260 (("FetchContent_MakeAvailable\\(embree\\)")
4261 (string-join (list "find_package(Embree 3 CONFIG)"
4262 "add_library(embree::embree ALIAS embree)"
4263 "return()")
4264 "\n")))
4265 (substitute* "cmake/recipes/external/glfw.cmake"
4266 (("FetchContent_MakeAvailable\\(glfw\\)")
4267 (string-join
4268 (list "find_package(glfw3 CONFIG REQUIRED)"
4269 "add_library(glfw::glfw ALIAS glfw)"
4270 "return()")
4271 "\n")))
4272 (substitute* "cmake/recipes/external/imgui.cmake"
4273 (("FetchContent_MakeAvailable\\(imgui\\)")
4274 "return()"))))
4275
4276 (add-after 'unpack-external 'fix-assertions
4277 (lambda _
4278 ;; Current Tetgen version has a bug.
4279 (substitute* "include/igl/copyleft/tetgen/tetgenio_to_tetmesh.cpp"
4280 (("assert\\(out.numberofpoints == out.numberofpointmarkers\\);")
4281 ";"))
4282 ;; CGAL has a bug in assertion as well.
4283 (substitute* "include/igl/copyleft/cgal/trim_with_solid.cpp"
4284 (("assert\\(I.size\\(\\) == Vr.rows\\(\\)\\);")
4285 ";"))))
4286
4287 ;; XXX: Install modules as CMake fails to install them.
4288 (add-after 'install 'install-includes
4289 (lambda* (#:key inputs outputs #:allow-other-keys)
4290 (let* ((out (assoc-ref outputs "out"))
4291 (include-dir (string-append out "/include/igl/")))
4292 (for-each (lambda (module)
4293 (copy-recursively (format #f
4294 "../source/include/igl/~a"
4295 module)
4296 (format #f
4297 "~a/~a"
4298 include-dir
4299 module)))
4300 (list "copyleft/cgal"
4301 "copyleft/opengl2"
4302 "copyleft/tetgen"
4303 "embree"
4304 "opengl"
4305 "predicates"
4306 "xml"))))))))
4307
4308 (native-inputs (list catch2-2))
4309 ;; XXX: Inputs are currently only used to build tests.
4310 ;; We would need to patch the CMake recipe to build a shared library
4311 ;; with all of these.
4312 (inputs
4313 `(("boost" ,boost-1.83)
4314 ("cgal" ,cgal)
4315 ("eigen" ,eigen)
4316 ("embree" ,embree-3)
4317 ("glfw" ,glfw-3.4)
4318 ("gmp" ,gmp)
4319 ("mesa" ,mesa)
4320 ("mpfr" ,mpfr)
4321 ("onetbb" ,onetbb)
4322 ("tinyxml2" ,tinyxml2)
4323 ("openblas" ,openblas)
4324 ("imgui" ,imgui)
4325 ("spectra" ,spectra)
4326 ;; When updating this package, update commit fields below according to
4327 ;; the hashes listed in "cmake/LibiglDownloadExternal.cmake".
4328 ("libigl-test-data"
4329 ,(origin
4330 (method git-fetch)
4331 (uri (git-reference
4332 (url "https://github.com/libigl/libigl-tests-data")
4333 (commit "19cedf96d70702d8b3a83eb27934780c542356fe")))
4334 (file-name (git-file-name "libigl-test-data" version))
4335 (sha256
4336 (base32 "1wxglrxw74xw4a4jmmjpm8719f3mnlbxbwygjb4ddfixxxyya4i2"))))
4337 ("libigl-glad"
4338 ,(let* ((commit "ead2d21fd1d9f566d8f9a9ce99ddf85829258c7a")
4339 (revision "0")
4340 (version (git-version "0.0.0" revision commit)))
4341 (origin
4342 (method git-fetch)
4343 (uri (git-reference
4344 (url "https://github.com/libigl/libigl-glad")
4345 (commit commit)))
4346 (file-name (git-file-name "libigl-glad" version))
4347 (sha256
4348 (base32 "079fd5yrbd713nq7slhhgq79wns85pc564ydlkjl9gf43d3220ay")))))
4349 ("libigl-stb"
4350 ,(origin
4351 (method git-fetch)
4352 (uri (git-reference
4353 (url "https://github.com/libigl/libigl-stb.git")
4354 (commit "cd0fa3fcd90325c83be4d697b00214e029f94ca3")))
4355 (file-name (git-file-name "libigl-stb" version))
4356 (sha256
4357 (base32 "0wwlb370z40y63ic3ny6q7lxibhixg2k1pjdkl4ymzv79zld28kj"))))
4358 ("libigl-predicates"
4359 ,(let* ((commit "50c2149e7a520d13cd10e9aeff698bd68edd5a4f")
4360 (revision "0")
4361 (version (git-version "0.0.0" revision commit)))
4362 (origin
4363 (method git-fetch)
4364 (uri (git-reference
4365 (url "https://github.com/libigl/libigl-predicates.git")
4366 (commit commit)))
4367 (file-name (git-file-name "libigl-predicates" version))
4368 (sha256
4369 (base32 "0yiqhzry2qhb1p0v9sldlnpqsn4y8cln8r6y08lafkc9kc4qy8jz")))))
4370 ;; TODO: Package tetgen separately from <http://www.tetgen.org>
4371 ("libigl-tetgen"
4372 ,(let* ((commit "4f3bfba3997f20aa1f96cfaff604313a8c2c85b6")
4373 (revision "0")
4374 (version (git-version "0.0.0" revision commit)))
4375 (origin
4376 (method git-fetch)
4377 (uri (git-reference
4378 (url "https://github.com/libigl/tetgen.git")
4379 (commit commit)))
4380 (file-name (git-file-name "libigl-tetgen" version))
4381 (sha256
4382 (base32 "1k724syssw37py7kwmibk3sfwkkgyjyy7qkijnhn6rjm91g8qxsg")))))
4383 ("libigl-comiso"
4384 ,(let* ((commit "562efe333edc8e649dc101469614f43378b1eb55")
4385 (revision "0")
4386 (version (git-version "0.0.0" revision commit)))
4387 (origin
4388 (method git-fetch)
4389 (uri (git-reference
4390 (url "https://github.com/libigl/comiso.git")
4391 (commit commit)))
4392 (file-name (git-file-name "libigl-comiso" version))
4393 (sha256
4394 (base32 "048zryh9ydd1dqwzs14vj7r3fd6yyq6n4zl6d1b0yb1iwrqfy6ba")))))
4395 ("libigl-triangle"
4396 ,(origin
4397 (method git-fetch)
4398 (uri (git-reference
4399 (url "https://github.com/libigl/triangle.git")
4400 (commit "6bbd92c7ddd6c803c403e005e1132eadb38fbe68")))
4401 (file-name (git-file-name "libigl-triangle" version))
4402 (sha256
4403 (base32 "0d35mfqwdk99xn1lpjzz9w5axq016r6xy5vr00lb4mvb05limxl3"))))
4404
4405 ;; XXX: This is a source-only library which is currently required only
4406 ;; for libigl.
4407
4408 ("imguizmo"
4409 ,(origin
4410 (method git-fetch)
4411 (uri (git-reference
4412 (url "https://github.com/CedricGuillemet/ImGuizmo")
4413 (commit "1.83")))
4414 (file-name (git-file-name "imguizmo" version))
4415 (sha256
4416 (base32 "14ywf96nvxf5c081pwypyzjwx9vyq78glbzinc81558v1sxiy2v0"))))))
4417 (home-page "https://libigl.github.io/")
4418 (synopsis "Simple C++ geometry processing library")
4419 (description "This library provides functionality for shape modelling,
4420visualization, matrix manipulation.")
4421 (license (list license:gpl3 license:mpl2.0))))
4422
4423(define-public prusa-libbgcode
4424 ;; Use the same commit as in the PrusaSlicer repository.
4425 ;; <https://github.com/prusa3d/libbgcode/issues/31>.
4426 (let ((commit "5041c093b33e2748e76d6b326f2251310823f3df")
4427 (revision "1"))
4428 (package
4429 (name "prusa-libbgcode")
4430 (version (git-version "0.0.0" revision commit))
4431 (source
4432 (origin
4433 (method git-fetch)
4434 (uri (git-reference
4435 (url "https://github.com/prusa3d/libbgcode")
4436 (commit commit)))
4437 (file-name (git-file-name name version))
4438 (sha256
4439 (base32 "0ivc0zhpf0gz55jfj0gbkff6yw5gpwazk94asldzznn7x9jmbb0i"))))
4440 (native-inputs (list catch2))
4441 (propagated-inputs (list zlib boost heatshrink))
4442 (build-system cmake-build-system)
4443 (home-page "https://github.com/prusa3d/libbgcode")
4444 (synopsis "Prusa Block and Binary G-code reader/writer/converter")
4445 (description
4446 "Binary G-code is a new standard for encoding and compressing ASCII G-code
4447files. G-code files are easy to read and interpret, but their downside is that the
4448data is not saved efficiently, and the file size is often very large. Compression of
4449the file is problematic because the printers usually run on limited hardware and they
4450may not have enough memory and/or CPU power to decompress it.
4451
4452Block and Binary G-Code is a new G-code file format featuring the following
4453improvements over the legacy G-code:
4454@itemize
4455@item Block structure with distinct blocks for metadata vs. G-code.
4456@item Faster navigation.
4457@item Coding and compression for smaller file size.
4458@item Checksum for data validity.
4459@item Extensibility through new (custom) blocks. For example, a file signature block
4460may be welcome by corporate customers.
4461@end itemize
4462
4463The binary G-code format is flexible and the encoding and compression of individual
4464blocks is variable. @code{libbgcode} library contains the routines to convert ASCII
4465G-codes to binary and vice versa.")
4466 ;; See
4467 ;; <https://github.com/prusa3d/libbgcode/blob/main/pyproject.toml>
4468 (license license:agpl3+))))
4469
4470(define-public prusa-slicer
4471 (package
4472 (name "prusa-slicer")
4473 (version "2.9.5")
4474 (source
4475 (origin
4476 (method git-fetch)
4477 (uri
4478 (git-reference
4479 (url "https://github.com/prusa3d/PrusaSlicer")
4480 (commit (string-append "version_" version))))
4481 (file-name (git-file-name name version))
4482 (sha256 (base32 "08kqfr3dfj0y1fzvpq2ri5b09996bn3hgq6ifgjlg0x4ij2byl5m"))
4483 (patches (search-patches "prusa-slicer-add-cmake-module.patch"
4484 "prusa-slicer-boost-1.87.patch"
4485 "prusa-slicer-boost-1.88.patch"
4486 "prusa-slicer-boost-1.89.patch"
4487 "prusa-slicer-cgal-6.patch"
4488 "prusa-slicer-opencascade-7.8.patch"))
4489 (modules '((guix build utils)))
4490 (snippet
4491 `(begin
4492 ;; Prusa slicer bundles a lot of dependencies in src/ directory.
4493 ;; Most of them contain prusa-specific modifications (e.g. avrdude),
4494 ;; but others do not. Here we replace the latter with Guix packages.
4495 ;; Remove bundled libraries that were not modified by Prusa Slicer developers.
4496 (delete-file-recursively "bundled_deps/hidapi")
4497 (delete-file-recursively "bundled_deps/libigl/igl")
4498 (substitute* "CMakeLists.txt"
4499 (("target_link_libraries\\(libexpat INTERFACE EXPAT::EXPAT\\)")
4500 "")
4501 (("add_library\\(libexpat INTERFACE\\)")
4502 ""))
4503 (substitute* "bundled_deps/CMakeLists.txt"
4504 (("add_subdirectory\\(hidapi\\)")
4505 ""))
4506 (substitute* "bundled_deps/libigl/CMakeLists.txt"
4507 (("target_link_libraries\\(libigl INTERFACE igl::core\\)") ""))
4508 (substitute* "src/CMakeLists.txt"
4509 (("add_subdirectory\\(hidapi\\)")
4510 "pkg_check_modules(HIDAPI REQUIRED hidapi-hidraw)")
4511 (("include_directories\\(hidapi/include\\)")
4512 "include_directories()")
4513 (("add_library\\(libexpat INTERFACE\\)")
4514 "")
4515 (("target_link_libraries\\(libexpat INTERFACE EXPAT::EXPAT\\)")
4516 "")
4517 (("list\\(APPEND wxWidgets_LIBRARIES libexpat\\)")
4518 "list(APPEND wxWidgets_LIBRARIES expat)"))
4519 (substitute* "src/libslic3r/CMakeLists.txt"
4520 (("libexpat")
4521 "expat"))
4522 (substitute* "src/slic3r/CMakeLists.txt"
4523 (("add_library\\(libslic3r_gui.*" all)
4524 (string-append
4525 "find_package(HidAPI REQUIRED)\n"
4526 all
4527 "\ntarget_include_directories(libslic3r_gui PUBLIC ${HIDAPI_INCLUDE_DIR})\n"))
4528 ((" hidapi")
4529 " ${HIDAPI_LIBRARY}"))))))
4530 (build-system cmake-build-system)
4531 (arguments
4532 (list #:configure-flags
4533 #~(list "-DSLIC3R_FHS=1" ;; Use The Filesystem Hierarchy Standard.
4534 "-DSLIC3R_GTK=3" ;; Use GTK+
4535 ;; Use wxWidgets 3.0.x.x to prevent GUI crashes when adding support enforcers.
4536 "-DSLIC3R_WX_STABLE=1"
4537 ;; FIXME: tests fail to build with cgal-6.
4538 ;; prusa-slicer-cgal-6.patch needs updating.
4539 "-DSLIC3R_BUILD_TESTS=0"
4540 (format #f "-Dlibigl_DIR=~a"
4541 (search-input-directory %build-inputs
4542 "lib/cmake/igl/"))
4543 (format #f "-DCatch2_DIR=~a"
4544 (search-input-directory %build-inputs
4545 "lib/cmake/Catch2/")))
4546 #:tests? #f
4547 #:phases
4548 #~(modify-phases %standard-phases
4549 (add-after 'unpack 'fix-include-paths
4550 (lambda _
4551 (substitute* "tests/libslic3r/test_quadric_edge_collapse.cpp"
4552 (("#include <libigl/igl/qslim.h>")
4553 "#include <igl/qslim.h>"))))
4554 (add-after 'unpack 'fix-for-glew-on-wayland
4555 (lambda _
4556 ;; GLEW's glewInit() function attempts to use GLX,
4557 ;; which fails on Wayland.
4558 ;; Ignoring the error code GLEW_ERROR_NO_GLX_DISPLAY
4559 ;; solves the issue.
4560 (substitute* "src/slic3r/GUI/OpenGLManager.cpp"
4561 (("err != GLEW_OK")
4562 "err != GLEW_OK && err != GLEW_ERROR_NO_GLX_DISPLAY"))))
4563 (add-after 'install 'wrap-program
4564 (lambda _
4565 (wrap-program (string-append #$output "/bin/prusa-slicer")
4566 ;; For GtkFileChooserDialog.
4567 `("GSETTINGS_SCHEMA_DIR" =
4568 (,(string-append #$(this-package-input "gtk+")
4569 "/share/glib-2.0/schemas")))))))))
4570 (native-inputs
4571 (list pkg-config catch2))
4572 (inputs
4573 (list bash-minimal
4574 boost
4575 cereal
4576 cgal
4577 curl
4578 dbus
4579 eigen
4580 eudev
4581 expat
4582 glew
4583 glib
4584 gmp
4585 gtk+
4586 heatshrink
4587 hidapi
4588 ilmbase
4589 libigl
4590 libjpeg-turbo
4591 libpng
4592 mesa
4593 mpfr
4594 nanosvg
4595 nlohmann-json
4596 nlopt
4597 opencascade-occt
4598 openssl
4599 openvdb
4600 pango
4601 prusa-libbgcode
4602 wxwidgets
4603 qhull
4604 onetbb
4605 webkitgtk-for-gtk3
4606 z3
4607 zlib))
4608 (home-page "https://www.prusa3d.com/prusaslicer/")
4609 (synopsis "G-code generator for 3D printers (RepRap, Makerbot, Ultimaker etc.)")
4610 (description "PrusaSlicer takes 3D models (STL, OBJ, AMF) and converts
4611them into G-code instructions for FFF printers or PNG layers for mSLA 3D
4612printers. It is compatible with any modern printer based on the RepRap
4613toolchain, including all those based on the Marlin, Prusa, Sprinter and
4614Repetier firmware. It also works with Mach3, LinuxCNC and Machinekit
4615controllers.")
4616 (license license:agpl3)
4617
4618 ;; Mark as tunable to take advantage of SIMD code in Eigen and in libigl.
4619 (properties '((tunable? . #t)))))
4620
4621(define-public wireviz
4622 (package
4623 (name "wireviz")
4624 (version "0.4.1")
4625 (source
4626 (origin
4627 (method git-fetch)
4628 (uri (git-reference
4629 (url "https://github.com/wireviz/WireViz")
4630 (commit (string-append "v" version))))
4631 (file-name (git-file-name name version))
4632 (sha256
4633 (base32 "0ggh2xmf60b84pi0q2bxjpq1ivgrm0wklgjdyqh1h7i51avhxcf1"))))
4634 (build-system pyproject-build-system)
4635 (arguments
4636 (list #:tests? #f)) ; no tests in git checkout
4637 (native-inputs
4638 (list python-setuptools))
4639 (inputs
4640 (list python-click
4641 python-graphviz
4642 python-pillow
4643 python-pyyaml))
4644 (home-page "https://github.com/wireviz/WireViz")
4645 (synopsis "Easily document cables and wiring harnesses")
4646 (description
4647 "WireViz is a tool for easily documenting cables, wiring harnesses and
4648connector pinouts. It takes plain text, YAML-formatted files as input and
4649produces beautiful graphical output thanks to GraphViz. It handles automatic
4650BOM creation and has a lot of extra features.")
4651 (license license:gpl3)))
4652
4653(define-public libarcus
4654 (package
4655 (name "libarcus")
4656 (version "4.13.0") ; Should same version as Cura package.
4657 (source
4658 (origin
4659 (method git-fetch)
4660 (uri (git-reference
4661 (url "https://github.com/Ultimaker/libArcus")
4662 (commit version)))
4663 (file-name (git-file-name name version))
4664 (sha256
4665 (base32 "19fi0y0lk45cyampczgh3kz2swai4zcgzkffp0xf5h55rxxrdpvk"))))
4666 (build-system cmake-build-system)
4667 (arguments
4668 `(#:tests? #f
4669 #:configure-flags '("-DBUILD_EXAMPLES=OFF")
4670 #:phases
4671 (modify-phases %standard-phases
4672 (add-after 'unpack 'fix-protobuf-compatibility
4673 (lambda _
4674 (substitute* "src/Socket_p.h"
4675 (("stream\\.SetTotalBytesLimit\\(message_size_maximum,.*\\);")
4676 "stream.SetTotalBytesLimit(message_size_maximum);"))))
4677 (add-before 'configure 'fix-python-sitearch
4678 (lambda* (#:key outputs #:allow-other-keys)
4679 (substitute* "cmake/FindSIP.cmake"
4680 (("\\$\\{_process_output\\} Python3_SITEARCH")
4681 (string-append (assoc-ref outputs "out")
4682 "/lib/python"
4683 ,(version-major+minor
4684 (package-version python))
4685 "/site-packages"
4686 " Python3_SITEARCH"))))))))
4687 (inputs
4688 (list protobuf
4689 python
4690 python-sip-4))
4691 (native-inputs (list python-setuptools))
4692 (home-page "https://github.com/Ultimaker/libArcus")
4693 (synopsis "Communication library for Ultimaker software components")
4694 (description "This library contains C++ code and Python3 bindings for
4695creating a socket in a thread and using this socket to send and receive
4696messages based on the Protocol Buffers library. It is designed to
4697facilitate the communication between Cura and its backend and similar code.")
4698 (license license:lgpl3+)))
4699
4700(define-public cura-engine
4701 (package
4702 (name "cura-engine")
4703 (version "4.13.2")
4704 (source
4705 (origin
4706 (method git-fetch)
4707 (uri (git-reference
4708 (url "https://github.com/Ultimaker/CuraEngine")
4709 (commit version)))
4710 (patches (search-patches "cura-engine-gcc-14.patch"))
4711 (file-name (git-file-name name version))
4712 (sha256
4713 (base32 "0xp2r0m5wwfsh9wdb3biqzvfqfz5jsmyw4bww93aksw0rgli07bp"))))
4714 (build-system cmake-build-system)
4715 (native-inputs
4716 (list googletest-1.13 pkg-config))
4717 (inputs
4718 (list libarcus protobuf stb-image))
4719 (arguments
4720 `(#:configure-flags '("-DBUILD_TESTS=ON")
4721 #:phases
4722 (modify-phases %standard-phases
4723 (add-after 'unpack 'fix-paths
4724 (lambda* (#:key inputs #:allow-other-keys)
4725 (substitute* "../source/cmake/FindStb.cmake"
4726 (("/usr/include")
4727 (string-append (assoc-ref inputs "stb-image")
4728 "/include"))
4729 (("stb/stb_image_resize.h")
4730 "stb_image.h"))
4731 (substitute*
4732 "../source/src/infill/ImageBasedDensityProvider.cpp"
4733 (("stb/stb_image.h")
4734 "stb_image.h")))))))
4735 (home-page "https://github.com/Ultimaker/CuraEngine")
4736 (synopsis "Cura slicing engine")
4737 (description
4738 "CuraEngine is an engine for processing 3D models into 3D printing
4739instructions for Ultimaker and other GCode-based 3D printers. It is part of a
4740larger project called Cura.")
4741 (license license:agpl3+)))
4742
4743(define-public cura-binary-data
4744 (package
4745 (name "cura-binary-data")
4746 (version "4.13.1")
4747 (source
4748 (origin
4749 (method git-fetch)
4750 (uri (git-reference
4751 (url "https://github.com/Ultimaker/cura-binary-data")
4752 (commit version)))
4753 (file-name (git-file-name name version))
4754 (sha256
4755 (base32 "11dra399adky7jxpaqqk1swrg5y3cc1086l54c3injg3ccgrvwik"))
4756 (modules '((guix build utils)))
4757 (snippet
4758 '(begin
4759 ;; Remove Windows executables and prebuilt firmware files.
4760 (delete-file-recursively "cura/resources/firmware")
4761 (delete-file-recursively "windows")))))
4762 (build-system cmake-build-system)
4763 (arguments
4764 `(#:tests? #f ; No test suite.
4765 #:configure-flags '("-DENABLE_FIRMWARE_INSTALL=OFF")))
4766 (home-page "https://github.com/Ultimaker/cura-binary-data")
4767 (synopsis "Binary data for Cura, like compiled translations")
4768 (description "This package contains binary data for Cura releases, like
4769compiled translations. Prebuilt Firmware files are removed.")
4770 (license license:agpl3)))
4771
4772(define-public udis86
4773 (let ((commit "5336633af70f3917760a6d441ff02d93477b0c86")
4774 (revision "0"))
4775 (package
4776 (name "udis86")
4777 (version (git-version "1.7.2" revision commit))
4778 (source (origin
4779 (method git-fetch)
4780 (uri (git-reference
4781 (url "https://github.com/canihavesomecoffee/udis86")
4782 (commit commit)))
4783 (file-name (git-file-name name version))
4784 (sha256
4785 (base32
4786 "0y5z1169wff578jylpafsww4px4y6gickhcs885a9c660d8xs9qy"))))
4787 (build-system gnu-build-system)
4788 (native-inputs (list autoconf automake libtool python-minimal-wrapper))
4789 ;; Fork of <https://github.com/vmt/udis86>.
4790 (home-page "https://github.com/canihavesomecoffee/udis86")
4791 (synopsis "Disassembler library for x86 and x86-64")
4792 (description
4793 "Udis86 is a disassembler for the x86 and x86-64 class of instruction
4794set architectures. It consists of a C library called @code{libudis86} which
4795provides a clean and simple interface to decode and inspect a stream of raw
4796binary data as disassembled instructions in a structured manner, and a command
4797line tool called @command{udcli} that incorporates the library.")
4798 (license license:bsd-2))))
4799
4800(define-public uranium
4801 (package
4802 (name "uranium")
4803 (version "4.13.1")
4804 (source
4805 (origin
4806 (method git-fetch)
4807 (uri (git-reference
4808 (url "https://github.com/Ultimaker/Uranium")
4809 (commit version)))
4810 (file-name (git-file-name name version))
4811 (sha256
4812 (base32 "1nyxm3fdyrsisqkxbqld66bljd852wnc1yc6i1lyvncwvzn8ai32"))))
4813 (build-system cmake-build-system)
4814 (native-inputs
4815 (list doxygen
4816 gettext-minimal
4817 graphviz
4818 pkg-config
4819 python-pytest
4820 python-certifi
4821 python-twisted))
4822 (propagated-inputs
4823 (list cura-binary-data
4824 libarcus
4825 python
4826 python-cryptography
4827 python-numpy
4828 python-pyqt
4829 python-scipy
4830 python-shapely
4831 python-trimesh
4832 python-zeroconf
4833 qtbase
4834 qtdeclarative-5
4835 qtgraphicaleffects
4836 qtquickcontrols-5
4837 qtquickcontrols2-5
4838 qtsvg-5))
4839 (arguments
4840 `(;; FIXME: tests are disabled, because they cause an infinite loop.
4841 #:tests? #f
4842 #:configure-flags
4843 ,#~(list (string-append "-DGETTEXT_MSGINIT_EXECUTABLE="
4844 #$(this-package-native-input "gettext-minimal")
4845 "/bin/msginit")
4846 (string-append "-DCURA_BINARY_DATA_DIRECTORY="
4847 #$(this-package-input "cura-binary-data")))
4848 #:phases
4849 (modify-phases %standard-phases
4850 (add-after 'unpack 'fix-uranium-plugin-path
4851 (lambda* (#:key outputs #:allow-other-keys)
4852 (substitute* "UM/Application.py"
4853 (("app_root =.*$")
4854 (string-append "app_root = \""
4855 (assoc-ref outputs "out") "\"\n"))
4856 (("app_root, \"share\", \"uranium\", \"plugins\"")
4857 "app_root, \"lib\", \"uranium\", \"plugins\"")))))))
4858 (home-page "https://github.com/Ultimaker/Uranium")
4859 (synopsis "Python framework for building desktop applications")
4860 (description "Uranium is a Python Framework for building 3D printing
4861related desktop applications using PyQt5. It belongs to the Cura project
4862from Ultimaker.")
4863 (license license:lgpl3+)))
4864
4865(define-public libnest2d-for-cura
4866 ;; Cura uses a custom fork of the libnest2d library.
4867 (package
4868 (name "libnest2d-for-cura")
4869 (version "4.12.0")
4870 (source
4871 (origin
4872 (method git-fetch)
4873 (uri (git-reference
4874 (url "https://github.com/Ultimaker/libnest2d")
4875 (commit version)))
4876 (file-name (git-file-name name version))
4877 (sha256
4878 (base32 "1wk7cv8sqnxy7srq61scrr18dz2i0l4s4slmjfh4890iy0wf9i7n"))))
4879 (build-system cmake-build-system)
4880 (inputs
4881 (list boost clipper nlopt))
4882 (arguments
4883 `(#:tests? #f
4884 #:phases
4885 (modify-phases %standard-phases
4886 (add-before 'configure 'fix-clipper-detection
4887 (lambda* (#:key inputs #:allow-other-keys)
4888 (setenv "CLIPPER_PATH" (assoc-ref inputs "clipper")))))))
4889 (home-page "https://github.com/Ultimaker/libnest2d")
4890 (synopsis "2D irregular bin packaging and nesting library")
4891 (description
4892 "Libnest2D is a library and framework for the 2D bin packaging
4893problem. It was inspired from the SVGNest Javascript library.")
4894 (license license:lgpl3)))
4895
4896(define-public python-pynest2d
4897 (package
4898 (name "python-pynest2d")
4899 (version "4.12.0")
4900 (source
4901 (origin
4902 (method git-fetch)
4903 (uri (git-reference
4904 (url "https://github.com/Ultimaker/pynest2d")
4905 (commit version)))
4906 (file-name (git-file-name name version))
4907 (sha256
4908 (base32 "0jhqfylg6vzlbz9rqs981bg6y8s18iklw1p8hmax72xq2c7561s1"))))
4909 (build-system cmake-build-system)
4910 (arguments
4911 `(#:tests? #f
4912 #:phases
4913 (modify-phases %standard-phases
4914 (add-before 'configure 'fix-clipper-detection
4915 (lambda* (#:key inputs #:allow-other-keys)
4916 (setenv "CLIPPER_PATH" (assoc-ref inputs "clipper"))))
4917 (add-before 'configure 'fix-python-sitearch
4918 (lambda* (#:key outputs #:allow-other-keys)
4919 (let ((path (string-append (assoc-ref outputs "out")
4920 "/lib/python"
4921 ,(version-major+minor
4922 (package-version python))
4923 "/site-packages")))
4924 (substitute* "cmake/FindSIP.cmake"
4925 (("\\$\\{_process_output\\} Python3_SITEARCH")
4926 (string-append path " Python3_SITEARCH"))
4927 (("\\$\\{_process_output\\} Python3_SITELIB")
4928 (string-append path " Python3_SITELIB")))))))))
4929 (native-inputs
4930 (list pkg-config
4931 python-setuptools))
4932 (inputs
4933 (list boost
4934 clipper
4935 libnest2d-for-cura
4936 nlopt
4937 python
4938 python-sip-4))
4939 (home-page "https://github.com/Ultimaker/pynest2d")
4940 (synopsis "Python bindings for libnest2d")
4941 (description
4942 "This package contains CPython bindings for libnest2d-for-cura.")
4943 (license license:lgpl3+)))
4944
4945(define-public libcharon
4946 (package
4947 (name "libcharon")
4948 (version "4.13.0")
4949 (source
4950 (origin
4951 (method git-fetch)
4952 (uri (git-reference
4953 (url "https://github.com/Ultimaker/libCharon")
4954 (commit version)))
4955 (file-name (git-file-name name version))
4956 (sha256
4957 (base32 "0ibv15y7lfxs09k6rbc3kiaz13gq3v9vqxrk20rqp6bdclk3izff"))))
4958 (build-system cmake-build-system)
4959 (native-inputs
4960 (list python-pytest))
4961 (inputs
4962 (list python))
4963 (home-page "https://github.com/Ultimaker/libCharon")
4964 (synopsis "File metadata and streaming library")
4965 (description "LibCharon is a Python file metadata and streaming library. It
4966belongs to the Cura project from Ultimaker.")
4967 (license license:lgpl3+)))
4968
4969(define-public libsavitar
4970 (package
4971 (name "libsavitar")
4972 (version "4.13.0")
4973 (source
4974 (origin
4975 (method git-fetch)
4976 (uri (git-reference
4977 (url "https://github.com/Ultimaker/libSavitar")
4978 (commit version)))
4979 (file-name (git-file-name name version))
4980 (sha256
4981 (base32 "1cq85x0xizsjwf9nl7v7x4i9vl335mgv2lda3q2c9fcwrndsc3wk"))))
4982 (build-system cmake-build-system)
4983 (arguments
4984 `(#:tests? #f ; No test suite.
4985 #:phases
4986 (modify-phases %standard-phases
4987 (add-before 'configure 'fix-python-sitearch
4988 (lambda* (#:key outputs #:allow-other-keys)
4989 (let ((path (string-append (assoc-ref outputs "out")
4990 "/lib/python"
4991 ,(version-major+minor
4992 (package-version python))
4993 "/site-packages")))
4994 (substitute* "cmake/FindSIP.cmake"
4995 (("\\$\\{_process_output\\} Python3_SITEARCH")
4996 (string-append path " Python3_SITEARCH"))
4997 (("\\$\\{_process_output\\} Python3_SITELIB")
4998 (string-append path " Python3_SITELIB")))))))))
4999 (inputs (list python python-sip-4))
5000 (native-inputs (list python-setuptools))
5001 (home-page "https://github.com/Ultimaker/libSavitar")
5002 (synopsis "C++ implementation of 3mf loading with SIP python bindings")
5003 (description "LibSavitar is a C++ implementation of 3mf loading with SIP
5004python bindings. It belongs to the Cura project from Ultimaker.")
5005 (license license:lgpl3+)))
5006
5007(define-public cura
5008 (package
5009 (name "cura")
5010 (version "4.13.1")
5011 (source
5012 (origin
5013 (method git-fetch)
5014 (uri (git-reference
5015 (url "https://github.com/Ultimaker/Cura")
5016 (commit version)))
5017 (file-name (git-file-name name version))
5018 (sha256
5019 (base32 "0yg17pcrj5gm02aqcjfk40ynvpb9r9aaq9rj108dkpki1is15ks7"))))
5020 (build-system qt-build-system)
5021 (native-inputs
5022 (list python-certifi
5023 python-pytest
5024 python-requests))
5025 (inputs
5026 (list bash-minimal
5027 cura-engine
5028 libcharon
5029 libsavitar
5030 python
5031 python-keyring
5032 python-pynest2d
5033 python-pyserial
5034 python-sentry-sdk
5035 python-sip
5036 uranium))
5037 (arguments
5038 `(;; TODO: Fix tests.
5039 #:tests? #f
5040 #:configure-flags '("-DURANIUM_SCRIPTS_DIR=")
5041 #:phases
5042 (modify-phases %standard-phases
5043 (add-after 'install 'link-to-CuraEngine
5044 (lambda* (#:key inputs outputs #:allow-other-keys)
5045 (symlink (string-append (assoc-ref inputs "cura-engine")
5046 "/bin/CuraEngine")
5047 (string-append (assoc-ref outputs "out")
5048 "/bin/CuraEngine"))))
5049 (add-after 'link-to-CuraEngine 'wrap-pythonpath
5050 (lambda* (#:key outputs #:allow-other-keys)
5051 (let ((out (assoc-ref outputs "out")))
5052 (wrap-program (string-append out "/bin/cura")
5053 (list "GUIX_PYTHONPATH"
5054 'prefix (list (string-append out
5055 "/lib/python"
5056 ,(version-major+minor
5057 (package-version python))
5058 "/site-packages")
5059 (getenv "GUIX_PYTHONPATH"))))))))))
5060 (home-page "https://github.com/Ultimaker/Cura")
5061 (synopsis "Slicer for 3D printers")
5062 (description "Cura is a slicing software from Ultimaker. A @emph{slicer}
5063generates G-Code for 3D printers.")
5064 (license license:lgpl3+)))
5065
5066(define-public bcnc
5067 (package
5068 (name "bcnc")
5069 (version "0.9.15")
5070 (source
5071 (origin
5072 (method url-fetch)
5073 (uri (pypi-uri "bCNC" version))
5074 (sha256
5075 (base32 "1wsz5ppgncn992znj9wpkvjkf87m93zb2pdzlas53nnj2j4pz9vw"))
5076 ;; Comment out opencv-python which cannot be detected because
5077 ;; the opencv python library lacks necessary metadata files.
5078 ;; https://github.com/opencv/opencv-python/issues/944
5079 (modules '((guix build utils)))
5080 (snippet '(substitute* "setup.py"
5081 (("\"opencv-python.*" line)
5082 (string-append "# " line))
5083 (("\\+.*" line)
5084 (string-append "# " line))))))
5085 (build-system pyproject-build-system)
5086 ;; Tests require pyautogui which is not packaged yet.
5087 (arguments
5088 (list
5089 #:tests? #f)) ; all tests depend on not packaged pyautogui
5090 (native-inputs
5091 (list python-setuptools
5092 python-wheel))
5093 (inputs
5094 (list `(,python "tk")))
5095 (propagated-inputs
5096 (list opencv
5097 python-numpy
5098 python-pillow
5099 python-pyserial
5100 python-shxparser
5101 python-svgelements))
5102 (home-page "https://github.com/vlachoudis/bCNC")
5103 (synopsis "Swiss army knife for all your CNC/g-code needs")
5104 (description
5105 "GrblHAL CNC command sender, autoleveler, g-code editor, digitizer, CAM
5106and swiss army knife for all your CNC needs. The sender is robust and fast
5107able to work nicely with old or slow hardware.")
5108 (license (list license:gpl2+
5109 ;; XXX: Check if the mentioned sources may be unbundled,
5110 ;; they specify their own compatible licenses as take from
5111 ;; project's README:
5112 ;;
5113 ;; Numpy-STL (https://github.com/WoLpH/numpy-stl)
5114 ;; lib/stl
5115 ;; Python-Utils (https://github.com/WoLpH/python-utils)
5116 ;; lib/python_utils
5117 license:bsd-3
5118
5119 ;; MeshCut (https://github.com/julienr/meshcut)
5120 ;; Copyright (c) 2015 Julien Rebetez
5121 ;; lib/mescut.py
5122 ;; lib/ply.py
5123 ;; lib/utils.py
5124 ;; svg.path (https://github.com/regebro/svg.path)
5125 ;; Copyright (c) 2013-2014 Lennart Regebro
5126 ;; lib/svg/*
5127 license:expat))))
5128
5129(define-public candle
5130 (package
5131 (name "candle")
5132 (version "11.2")
5133 (source (origin
5134 (method git-fetch)
5135 (uri (git-reference
5136 (url "https://github.com/Denvi/Candle")
5137 (commit (string-append "v" version))))
5138 (file-name (git-file-name name version))
5139 (sha256
5140 (base32
5141 "0dn7ywfik343h62sphgxhdv16ilglb1asmgg32f8r22lvsavjb2r"))))
5142 (build-system cmake-build-system)
5143 (native-inputs (list qt5ct qttools-5 qtscript-5))
5144 (inputs
5145 (list bash-minimal
5146 qtbase-5
5147 qtmultimedia-5
5148 qtserialport-5
5149 qtwayland-5
5150 qtwebsockets-5))
5151 (arguments
5152 (list #:tests? #f ; no tests.
5153 #:phases #~(modify-phases %standard-phases
5154 (add-after 'unpack 'fix-installation-paths
5155 (lambda _
5156 (substitute* "src/designerplugins/CMakeLists.txt"
5157 (("DESIGNER_DESTINATION \"designerplugins\"")
5158 "DESIGNER_DESTINATION \"lib/designerplugins\""))
5159 (substitute* "src/customwidgets/CMakeLists.txt"
5160 (("TARGETS customwidgets RUNTIME DESTINATION .")
5161 "TARGETS customwidgets RUNTIME DESTINATION lib"))
5162 (substitute* "src/candle/CMakeLists.txt"
5163 (("candle PROPERTIES INSTALL_RPATH \"\\$ORIGIN/lib\"")
5164 "candle PROPERTIES INSTALL_RPATH \"$ORIGIN/../lib\"")
5165 (("install(.*/LICENSE DESTINATION .*)$")
5166 (string-append
5167 "install(FILES"
5168 " ${CMAKE_SOURCE_DIR}/LICENSE"
5169 " DESTINATION ${GENERAL_DESTINATION}/share/candle/)"))
5170 (("install(.*/help DESTINATION .*)$")
5171 (string-append
5172 "install(DIRECTORY"
5173 " ${CMAKE_SOURCE_DIR}/help"
5174 " DESTINATION ${GENERAL_DESTINATION}/share/candle/)"))
5175 (("TARGETS candle RUNTIME DESTINATION .")
5176 "TARGETS candle RUNTIME DESTINATION bin"))))
5177 (add-after 'install 'wrap-executable
5178 (lambda _
5179 (let ((qtbase #$(this-package-input "qtbase"))
5180 (qtwayland #$(this-package-input "qtwayland")))
5181 (wrap-program (string-append #$output "/bin/candle")
5182 `("QT_PLUGIN_PATH" ":" =
5183 (,(string-append qtwayland "/lib/qt5/plugins")))
5184 `("QT_QPA_PLATFORM_PLUGIN_PATH" ":" =
5185 (,(string-append qtwayland
5186 "/lib/qt5/plugins/platforms"))))))))))
5187 (home-page "https://github.com/Denvi/Candle")
5188 (synopsis "GRBL controller with G-Code visualizer")
5189 (description
5190 "Candle is a GRBL controller application with a visualizer for G-Code,
5191the @acronym{CNC, computer numerical control} programming language.
5192
5193Supported functions include:
5194
5195@itemize
5196@item Controlling GRBL-based cnc-machine via console commands, buttons on
5197form, numpad.
5198@item Monitoring CNC-machine state.
5199@item Loading, editing, saving and sending of G-code files to CNC-machine.
5200@item Visualizing G-code files.
5201@end itemize")
5202 (license license:gpl3+)))
5203
5204(define-public rizin
5205 (package
5206 (name "rizin")
5207 (version "0.8.2") ;keep in sync with cutter
5208 (source
5209 (origin
5210 (method url-fetch)
5211 (uri (string-append
5212 "https://github.com/rizinorg/rizin/releases/download/v"
5213 version "/rizin-src-v" version ".tar.xz"))
5214 (sha256
5215 (base32
5216 "159ddi96mlqdynixy3h831dip59gr2gnj85jgvrjyvz8p99clc0n"))))
5217 (build-system meson-build-system)
5218 (arguments
5219 (list
5220 #:configure-flags
5221 #~(list "--wrap-mode=nodownload" ;for rzgdb, rzheap, etc.
5222 "-Dpackager=guix"
5223 (string-append "-Dpackager_version=" #$version)
5224 "-Duse_sys_capstone=enabled"
5225 "-Duse_sys_magic=enabled"
5226 "-Duse_sys_libzip=enabled"
5227 "-Duse_sys_zlib=enabled"
5228 "-Duse_sys_lz4=enabled"
5229 "-Duse_sys_libzstd=enabled"
5230 "-Duse_sys_xxhash=enabled"
5231 "-Duse_sys_openssl=enabled"
5232 "-Duse_sys_tree_sitter=enabled"
5233 "-Duse_sys_lzma=enabled"
5234 "-Duse_sys_libmspack=enabled"
5235 "-Duse_sys_pcre2=enabled"
5236 "-Duse_zlib=true"
5237 "-Duse_lzma=true"
5238 "-Dinstall_sigdb=false"
5239 "-Duse_swift_demangler=true"
5240 "-Duse_gpl=true")
5241 #:phases
5242 #~(modify-phases %standard-phases
5243 (add-before 'configure 'skip-integration-tests
5244 (lambda _
5245 ;; Skip integration tests, which require prebuilt binaries at:
5246 ;; <https://github.com/rizinorg/rizin-testbins>.
5247 (substitute* "test/meson.build"
5248 (("subdir\\('integration'\\)") ""))
5249 ;;; Skip failing tests.
5250 (substitute* "test/unit/meson.build"
5251 (("'tokens',\n") "")))))))
5252 (native-inputs (list pkg-config))
5253 (inputs
5254 (list capstone
5255 file
5256 libuv
5257 libzip
5258 lz4
5259 openssl
5260 pcre2
5261 tree-sitter
5262 xxhash
5263 zlib
5264 (list zstd "lib")
5265 libmspack))
5266 (home-page "https://rizin.re")
5267 (synopsis "Disassemble, debug, analyze, and manipulate binary files")
5268 (description
5269 "Rizin is a reverse engineering framework and a set of small command-line
5270utilities, providing a complete binary analysis experience with features like
5271disassembler, hexadecimal editor, emulation, binary inspection, debugger, and
5272more.")
5273 ;; Most files are under LGPL-3.0-only, other are under: Apache-2.0,
5274 ;; BSD-2-Clause, BSD-3-Clause, CC0-1.0, CC-BY-SA-4.0, GPL-1.0-or-later,
5275 ;; GPL-2.0-only, GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.0-or-later,
5276 ;; LGPL-2.1-only, LGPL-2.1-or-later, LGPL-3.0-only, MIT, NCSA.
5277 (license license:gpl3+)))
5278
5279(define-public python-asyncua
5280 (package
5281 (name "python-asyncua")
5282 (version "2.0.1")
5283 (source
5284 (origin
5285 (method git-fetch)
5286 (uri (git-reference
5287 (url "https://github.com/FreeOpcUa/opcua-asyncio")
5288 (commit (string-append "v" version))
5289 ;; XXX: It clones <https://github.com/OPCFoundation/UA-Nodeset>
5290 ;; submodule, check if it may be unbundled.
5291 (recursive? #t)))
5292 (file-name (git-file-name name version))
5293 (sha256
5294 (base32 "1qrsrgj7x6l010s9msvfc1a23lzlygi2sis6xw1jj4mw1glxick5"))))
5295 (build-system pyproject-build-system)
5296 (arguments
5297 (list
5298 ;; tests: 774 passed, 6 skipped, 1 deselected, 2479 warnings
5299 #:test-flags
5300 ;; KeyError: 'Simple'
5301 #~(list "--deselect=tests/test_pubsub.py::test_full_simple")))
5302 (native-inputs
5303 (list python-hatchling
5304 python-pytest
5305 python-pytest-asyncio
5306 python-pytest-mock))
5307 (propagated-inputs
5308 (list python-aiosqlite
5309 python-anyio
5310 python-cryptography
5311 python-dateutil
5312 python-pyopenssl
5313 python-pytz
5314 python-sortedcontainers
5315 python-typing-extensions))
5316 (home-page "https://freeopcua.github.io/")
5317 (synopsis "OPC UA / IEC 62541 client and server library")
5318 (description "This package provides an OPC UA / IEC 62541 client and
5319server for Python and pypy3.")
5320 (license license:lgpl3+)))
5321
5322;; NOTE: modglue is frozen, receiving zero development since 2017-01-19.
5323;; However it is a dependency of cadabra 1.x, and cadabra 1.x is a
5324;; soft dependency of TeXmacs.
5325(define-public modglue
5326 (package
5327 (name "modglue")
5328 (version "1.20")
5329 (source (origin
5330 (method git-fetch)
5331 (uri (git-reference
5332 (url "https://github.com/kpeeters/modglue.git")
5333 (commit "89d65f5be9c737123b7beb721bd96c4eed650d9a")))
5334 (file-name (git-file-name name version))
5335 (sha256
5336 (base32
5337 "0cfrp2wyyfb6c71s5skg2g7gdg7bpvv77x6rvw7r9dqvamxsgmih"))
5338 (patches
5339 (search-patches "modglue-fix-build.patch"))))
5340 (build-system gnu-build-system)
5341 (arguments
5342 `(#:parallel-build? #f
5343 #:make-flags
5344 (list "TIMESTAMP=-DDATETIME=\\\"\\\" -DHOSTNAME=\\\"\\\"")
5345 #:phases
5346 (modify-phases %standard-phases
5347 (replace 'check
5348 (lambda _
5349 (invoke "make" "-C" "src" "tests"))))))
5350 (native-inputs
5351 (list pkg-config libtool))
5352 (inputs
5353 (list libsigc++-2))
5354 (synopsis "C++ library for handling of multiple co-processes")
5355 (description "This package provides a C++ library for handling of
5356multiple co-processes in cadabra.")
5357 (home-page "https://cadabra.science/")
5358 (license license:gpl2+)))
5359
5360;; NOTE: cadabra is frozen, receiving zero development since 2016-12-20.
5361;; However it is a soft dependency of TeXmacs (as a plugin).
5362(define-public cadabra
5363 (package
5364 (name "cadabra")
5365 (version "1.46")
5366 (source (origin
5367 (method git-fetch)
5368 (uri (git-reference
5369 (url "https://github.com/kpeeters/cadabra.git")
5370 (commit version)))
5371 (file-name (git-file-name name version))
5372 (sha256
5373 (base32
5374 "0kks3qv1rka9ynw386kspjwq0g7xmwjycwlr3bbmxjmnk9zvnn9h"))))
5375 (build-system gnu-build-system)
5376 (arguments
5377 `(#:configure-flags '("--disable-gui")
5378 #:make-flags
5379 (list (string-append "TIMESTAMP=-DRELEASE=\"\\\""
5380 ,version
5381 "\\\"\" -DDATETIME=\"\\\""
5382 "Thu Jan 1 01:02:00 AM CET 1970"
5383 "\\\"\" -DHOSTNAME=\"\\\""
5384 "dummy"
5385 "\\\"\""))
5386 #:test-target "test"
5387 #:phases
5388 (modify-phases %standard-phases
5389 (add-after 'unpack 'fix
5390 (lambda _
5391 (substitute* "tests/Makefile.in"
5392 (("TIMER=/usr/bin/time ")
5393 "TIMER=time "))
5394 ;; Upstream bug. spino is a pointer.
5395 (substitute* "src/exchange.cc"
5396 (("ngr.spino==false")
5397 "!ngr.spino")))))))
5398 (native-inputs
5399 (list pkg-config time))
5400 (inputs
5401 (list lie pcre gmp libsigc++-2 modglue))
5402 (synopsis "Computer algebra system geared towards field theory")
5403 (description "This package provides a computer algebra system geared
5404towards field theory. This package is mostly meant to be used by texmacs
5405and mogan.")
5406 (home-page "https://cadabra.science/")
5407 (license license:gpl3+)))
5408
5409(define-public cadabra2
5410 (package
5411 (name "cadabra2")
5412 (version "2.5.8")
5413 (source (origin
5414 (method git-fetch)
5415 (uri (git-reference
5416 (url "https://github.com/kpeeters/cadabra2")
5417 (commit version)
5418 (recursive? #t)))
5419 (file-name (git-file-name name version))
5420 (sha256
5421 (base32
5422 "0pcijvvv75x6408r6slkwljhqb4l4csnk6dhf5333dv9j9cm76ck"))))
5423 (build-system cmake-build-system)
5424 (arguments
5425 (list
5426 #:configure-flags
5427 #~(list
5428 (string-append "-DPYTHON_SITE_PATH=" #$output
5429 "/lib/python"
5430 #$(version-major+minor
5431 (package-version (this-package-input "python")))
5432 "/site-packages")
5433 (string-append "-DCMAKE_INSTALL_PREFIX="
5434 (assoc-ref %outputs "out")))
5435 #:phases
5436 #~(modify-phases %standard-phases
5437 (add-after 'unpack 'patch-paths
5438 (lambda* (#:key outputs #:allow-other-keys)
5439 (substitute* "client_server/ComputeThread.cc"
5440 (("[(]\"cadabra-server\"[)]")
5441 (string-append "(\"" (assoc-ref outputs "out")
5442 "/bin/cadabra-server\")")))
5443 (substitute* "client_server/Server.cc"
5444 (("'\" [+] python_path [+]")
5445 (string-append "'\" + std::string(\""
5446 (assoc-ref outputs "out")
5447 "/lib/python"
5448 #$(version-major+minor (package-version python))
5449 "/site-packages"
5450 "\") +")))))
5451 (add-before 'check 'prepare-checks
5452 (lambda _
5453 (setenv "HOME" "/tmp"))))))
5454 (native-inputs
5455 (list pkg-config))
5456 (inputs
5457 (list glibmm-2.66 gmp python boost-1.83 gtkmm-3 sqlite python-gmpy2 python-sympy
5458 python-mpmath python-matplotlib texlive-dvipng
5459 `(,util-linux "lib")))
5460 (synopsis "Computer algebra system geared towards field theory")
5461 (description "This package provides a computer algebra system geared
5462towards field theory.")
5463 (home-page "https://cadabra.science/")
5464 (license license:gpl3+)))
5465
5466(define-public orocos-kinematics-dynamics
5467 (let ((commit "34ecff4ca7bae52fa16ca13fdb3d9db26fd2a293")
5468 ;; There hasn't been a new release in many years (version 1.5.1)
5469 ;; Using the latest commit (which has internally set version to 1.5.2)
5470 (revision "0"))
5471 (package
5472 (name "orocos-kinematics-dynamics")
5473 (version (git-version "1.5.2" revision commit))
5474 (source
5475 (origin
5476 (method git-fetch)
5477 (uri (git-reference
5478 (url "https://github.com/orocos/orocos_kinematics_dynamics")
5479 (commit commit)))
5480 (sha256
5481 (base32 "1c7vimy065908qs5nwhnrk9pp0wh8pjgdvz2hwb12a9wcsj50kf0"))
5482 (file-name (git-file-name name version))))
5483 (build-system cmake-build-system)
5484 (native-inputs (list cppunit))
5485 (propagated-inputs (list eigen))
5486 (arguments
5487 (list
5488 #:configure-flags
5489 #~(list "-DENABLE_TESTS=ON")
5490 #:phases
5491 #~(modify-phases %standard-phases
5492 (add-after 'unpack 'fix-tests
5493 (lambda _
5494 ;; Make tests deterministic by seeding the random number generator.
5495 (substitute* '("orocos_kdl/tests/treeinvdyntest.cpp"
5496 "orocos_kdl/tests/solvertest.cpp")
5497 (("srand\\( \\(unsigned\\)time\\( NULL \\)\\)")
5498 "srand(0u)"))
5499 ;; CTest requires tests to be enabled in the top-level directory.
5500 (substitute* "orocos_kdl/CMakeLists.txt"
5501 (("IF\\( ENABLE_TESTS \\)" _all)
5502 (string-append _all "\n" "enable_testing()")))))
5503 (add-after 'fix-tests 'chdir
5504 (lambda _
5505 (chdir "orocos_kdl"))))))
5506 (home-page "https://docs.orocos.org/kdl/overview.html")
5507 (synopsis "Orocos Kinematics and Dynamics (KDL) C++ Library")
5508 (description
5509 "A C++ library for rigid body kinematics calculations
5510and representations for kinematic structures and their inverse and
5511forward kinematics solvers.")
5512 (license license:lgpl2.1+))))
5513
5514(define-public python-orocos-kinematics-dynamics
5515 (package
5516 (inherit orocos-kinematics-dynamics)
5517 (name "python-orocos-kinematics-dynamics")
5518 (source
5519 (origin
5520 (inherit (package-source orocos-kinematics-dynamics))))
5521 (native-inputs (list python pybind11-2 python-psutil))
5522 (inputs (list orocos-kinematics-dynamics))
5523 (arguments
5524 (list
5525 #:phases
5526 #~(modify-phases %standard-phases
5527 (add-after 'unpack 'fix
5528 (lambda _
5529 (substitute* "python_orocos_kdl/CMakeLists.txt"
5530 ;; Use the system pybind11 instead of the bundled version
5531 (("add_subdirectory\\(pybind11\\)")
5532 "find_package(pybind11)")
5533 ;; change debian-specific python install directory
5534 (("dist-packages")
5535 "site-packages"))
5536 ;; ROS 1 uses some dynamic attributes, which are
5537 ;; disabled by default in pybind11. No harm in enabling them
5538 ;; See "https://github.com/ros2/geometry2/issues/624
5539 ;; and https://pybind11.readthedocs.io/en/stable/classes.html
5540 ;; #dynamic-attributes <Both accessed June 1 2025>
5541 (substitute* "python_orocos_kdl/PyKDL/frames.cpp"
5542 (("m, \"Vector\"")
5543 "m, \"Vector\", py::dynamic_attr()")
5544 (("m, \"Frame\"")
5545 "m, \"Frame\", py::dynamic_attr()")
5546 (("m, \"Twist\"")
5547 "m, \"Twist\", py::dynamic_attr()")
5548 (("m, \"Wrench\"")
5549 "m, \"Wrench\", py::dynamic_attr()"))
5550 (chdir "python_orocos_kdl")))
5551 (replace 'check
5552 (lambda* (#:key tests? #:allow-other-keys)
5553 (setenv "PYTHONPATH" "./")
5554 (when tests?
5555 (invoke "python3"
5556 "../python_orocos_kdl/tests/PyKDLtest.py")))))))
5557 (synopsis "Python bindings for orocos-kinematics-dynamics")
5558 (description "Python bindings for orocos-kinematics-dynamics.")))