projects/guix·blob ruby-team · refs

2292 lines · 92.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017 John Darrington <[email protected]>
3;;; Copyright © 2017, 2019, 2021-2026 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2014, 2021-2023, 2026 Ludovic Courtès <[email protected]>
5;;; Copyright © 2014 Mark H Weaver <[email protected]>
6;;; Copyright © 2016 Eric Bavier <[email protected]>
7;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
8;;; Copyright © 2018 Björn Höfling <[email protected]>
9;;; Copyright © 2018 Lprndn <[email protected]>
10;;; Copyright © 2019, 2021, 2023 Efraim Flashner <[email protected]>
11;;; Copyright © 2020 Vincent Legoll <[email protected]>
12;;; Copyright © 2020, 2021, 2024, 2025 Vinicius Monego <[email protected]>
13;;; Copyright © 2020 Pierre Neidhardt <[email protected]>
14;;; Copyright © 2020 Brendan Tildesley <[email protected]>
15;;; Copyright © 2021 Oleh Malyi <[email protected]>
16;;; Copyright © 2021, 2022, 2024 Felix Gruber <[email protected]>
17;;; Copyright © 2021 Andy Tai <[email protected]>
18;;; Copyright © 2021 Ekaitz Zarraga <[email protected]>
19;;; Copyright © 2021 Paul Garlick <[email protected]>
20;;; Copyright © 2021 Guillaume Le Vaillant <[email protected]>
21;;; Copyright © 2021 Ivan Gankevich <[email protected]>
22;;; Copyright © 2022, 2025 Maxim Cournoyer <[email protected]>
23;;; Copyright © 2022 Tomasz Jeneralczyk <[email protected]>
24;;; Copyright © 2022 Paul A. Patience <[email protected]>
25;;; Copyright © 2023 Cairn <[email protected]>
26;;; Copyright © 2024 Nicolas Graves <[email protected]>
27;;; Copyright © 2025, 2026 Jake Forster <[email protected]>
28;;; Copyright © 2025 Anderson Torres <[email protected]>
29;;; Copyright © 2025, 2026 Andreas Enge <[email protected]>
30;;; Copyright © 2025 dan <[email protected]>
31;;; Copyright © 2026 Cayetano Santos <[email protected]>
32;;; Copyright © 2026 Arun Isaac <[email protected]>
33;;;
34;;; This file is part of GNU Guix.
35;;;
36;;; GNU Guix is free software; you can redistribute it and/or modify it
37;;; under the terms of the GNU General Public License as published by
38;;; the Free Software Foundation; either version 3 of the License, or (at
39;;; your option) any later version.
40;;;
41;;; GNU Guix is distributed in the hope that it will be useful, but
42;;; WITHOUT ANY WARRANTY; without even the implied warranty of
43;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44;;; GNU General Public License for more details.
45;;;
46;;; You should have received a copy of the GNU General Public License
47;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
48
49(define-module (gnu packages image-processing)
50 #:use-module ((guix licenses) #:prefix license:)
51 #:use-module (guix packages)
52 #:use-module (guix gexp)
53 #:use-module (guix utils)
54 #:use-module (guix download)
55 #:use-module (guix git-download)
56 #:use-module (guix build-system copy)
57 #:use-module (guix build-system qt)
58 #:use-module (guix build-system cmake)
59 #:use-module (guix build-system gnu)
60 #:use-module (guix build-system meson)
61 #:use-module (guix build-system pyproject)
62 #:use-module (gnu packages)
63 #:use-module (gnu packages algebra)
64 #:use-module (gnu packages base)
65 #:use-module (gnu packages bash)
66 #:use-module (gnu packages bison)
67 #:use-module (gnu packages boost)
68 #:use-module (gnu packages check)
69 #:use-module (gnu packages compression)
70 #:use-module (gnu packages cpp)
71 #:use-module (gnu packages curl)
72 #:use-module (gnu packages docbook)
73 #:use-module (gnu packages documentation)
74 #:use-module (gnu packages engineering)
75 #:use-module (gnu packages compiler-tools)
76 #:use-module (gnu packages fontutils)
77 #:use-module (gnu packages game-development)
78 #:use-module (gnu packages gcc)
79 #:use-module (gnu packages gd)
80 #:use-module (gnu packages geo)
81 #:use-module (gnu packages ghostscript)
82 #:use-module (gnu packages gimp)
83 #:use-module (gnu packages gl)
84 #:use-module (gnu packages glib)
85 #:use-module (gnu packages gnome)
86 #:use-module (gnu packages graphics)
87 #:use-module (gnu packages graphviz)
88 #:use-module (gnu packages gstreamer)
89 #:use-module (gnu packages gtk)
90 #:use-module (gnu packages icu4c)
91 #:use-module (gnu packages image)
92 #:use-module (gnu packages imagemagick)
93 #:use-module (gnu packages linux)
94 #:use-module (gnu packages lua)
95 #:use-module (gnu packages machine-learning)
96 #:use-module (gnu packages maths)
97 #:use-module (gnu packages mpi)
98 #:use-module (gnu packages nss)
99 #:use-module (gnu packages oneapi)
100 #:use-module (gnu packages opencl)
101 #:use-module (gnu packages pdf)
102 #:use-module (gnu packages perl)
103 #:use-module (gnu packages photo)
104 #:use-module (gnu packages pkg-config)
105 #:use-module (gnu packages pretty-print)
106 #:use-module (gnu packages protobuf)
107 #:use-module (gnu packages python)
108 #:use-module (gnu packages python-build)
109 #:use-module (gnu packages python-check)
110 #:use-module (gnu packages python-science)
111 #:use-module (gnu packages python-xyz)
112 #:use-module (gnu packages qt)
113 #:use-module (gnu packages sdl)
114 #:use-module (gnu packages serialization)
115 #:use-module (gnu packages sphinx)
116 #:use-module (gnu packages sqlite)
117 #:use-module (gnu packages ssh)
118 #:use-module (gnu packages statistics)
119 #:use-module (gnu packages swig)
120 #:use-module (gnu packages textutils)
121 #:use-module (gnu packages tls)
122 #:use-module (gnu packages version-control)
123 #:use-module (gnu packages video)
124 #:use-module (gnu packages xiph)
125 #:use-module (gnu packages xml)
126 #:use-module (gnu packages xorg)
127 #:use-module (ice-9 match)
128 #:use-module (srfi srfi-1))
129
130(define-public bart
131 (package
132 (name "bart")
133 (version "0.9.00")
134 (source
135 (origin
136 (method git-fetch)
137 (uri (git-reference
138 (url "https://github.com/mrirecon/bart")
139 (commit (string-append "v" version))))
140 (file-name (git-file-name name version))
141 (sha256
142 (base32 "0mj6jmw31rsnvqmpfqahhj4cy9iv5xgrhzmcsrikdz5dgd45lmjz"))))
143 (build-system gnu-build-system)
144 (arguments
145 (list
146 #:test-target "utest"
147 #:make-flags #~(list
148 (string-append "PREFIX=" #$output)
149 "PARALLEL=1"
150 "PARALLEL_NJOBS=1"
151 "OPENBLAS=1"
152 "SCALAPACK=1"
153 (string-append "BLAS_BASE=" #$(this-package-input "openblas"))
154 (string-append "CC=" #$(cc-for-target))
155 (string-append "FFTW_BASE=" #$(this-package-input "fftw")))
156 #:parallel-build? #false ;leads to non-deterministic output
157 #:phases
158 #~(modify-phases %standard-phases
159 (delete 'configure)
160 (add-after 'unpack 'patch-/bin/bash
161 (lambda _
162 (substitute* "tests/pics.mk"
163 (("/bin/bash") (which "bash"))))))))
164 (inputs
165 (list fftw
166 fftwf
167 libpng
168 openblas
169 python
170 scalapack))
171 (native-inputs
172 (list doxygen
173 util-linux)) ;for flock
174 (home-page "https://mrirecon.github.io/bart/")
175 (synopsis "Toolbox for computational magnetic resonance imaging")
176 (description "The Berkeley Advanced Reconstruction Toolbox (BART) is an
177image-reconstruction framework for Computational Magnetic Resonance Imaging.
178The tools in this software implement various reconstruction algorithms for
179Magnetic Resonance Imaging.")
180 (license license:bsd-3)))
181
182(define-public cimg
183 (package
184 (name "cimg")
185 (version "3.7.2")
186 (source
187 (origin
188 (method git-fetch)
189 (uri (git-reference
190 (url "https://github.com/GreycLab/CImg")
191 (commit (string-append "v." version))))
192 (file-name (git-file-name name version))
193 (sha256
194 (base32 "017yhaq1qysimiq0xi3a4kngwm521s5ghhv2w5mr9dmf8vaxdx31"))))
195 (build-system copy-build-system)
196 (arguments
197 (list
198 #:phases
199 #~(modify-phases %standard-phases
200 (add-before 'install 'check
201 (lambda* (#:key tests? #:allow-other-keys)
202 (when tests?
203 (with-directory-excursion "examples"
204 ;; This is from upstream CI but parallelized.
205 (invoke "make" "-j"
206 (number->string (parallel-job-count)) "mlinux")
207 (invoke "./image2ascii")
208 (invoke "./generate_loop_macros")
209 ;; Build an example that requires an external library.
210 ;; Running it requires a display.
211 (invoke "make" "use_jpeg_buffer"
212 (string-append "CONF_CFLAGS="
213 (string-join '("-Dcimg_display=0"
214 "-O3"
215 "-mtune=generic"
216 "-Dcimg_use_jpeg")
217 " "))
218 "CONF_LIBS=-ljpeg"))))))
219 #:install-plan
220 #~'(("CImg.h" "include/")
221 ("plugins" "include/CImg/plugins"))))
222 (native-inputs (list libjpeg-turbo)) ;for 'check
223 (home-page "https://cimg.eu")
224 (synopsis "Small C++ image processing library")
225 (description
226 "The @acronym{CImg, Cool Image} Library is a small C++ toolkit for
227image processing. It is made of a single header file @code{CImg.h}
228that can be compiled using a minimal set of standard C++ and system
229libraries. It includes a plugin mechanism to extend its functionality
230with external tools and libraries.")
231 ;; Dual-licensed, either license applies.
232 (license (list license:cecill-c license:cecill))))
233
234(define-public dcmtk
235 (package
236 (name "dcmtk")
237 (version "3.6.9")
238 (source
239 (origin
240 (method git-fetch)
241 (uri (git-reference
242 (url "https://git.dcmtk.org/dcmtk")
243 (commit (string-append "DCMTK-" version))))
244 (sha256
245 (base32 "0x99gg1kahkzbayfciyhkw5xdcm8cs4r8cmv15kniw9pldi3zllr"))
246 (file-name (git-file-name name version))))
247 (build-system cmake-build-system)
248 (arguments
249 ;; By default, only static archives are built.
250 (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")))
251 (inputs
252 (list icu4c
253 libjpeg-turbo
254 libpng
255 libtiff
256 libxml2
257 openssl
258 zlib))
259 (native-inputs
260 (list doxygen)) ; for HTML documentation
261 (home-page "https://dcmtk.org")
262 (synopsis "Libraries and programs implementing parts of the DICOM standard")
263 (description "DCMTK is a collection of libraries and applications
264implementing large parts the DICOM standard. It includes software for
265examining, constructing and converting DICOM image files, handling offline
266media, sending and receiving images over a network connection, as well as
267demonstrative image storage and worklist servers.")
268 (license (license:fsf-free
269 "file://COPYRIGHT"
270 "A union of the Apache 2.0 licence and various non-copyleft
271licences similar to the Modified BSD licence."))))
272
273(define-public opencolorio
274 (package
275 (name "opencolorio")
276 (version "2.4.2")
277 (source
278 (origin
279 (method git-fetch)
280 (uri (git-reference
281 (url "https://github.com/AcademySoftwareFoundation/OpenColorIO")
282 (commit (string-append "v" version))))
283 (sha256
284 (base32 "1h5n1adm7hlblq4z9qdbnh5jy3f6aimlk96cn1k4ah3f8vqx7zpq"))
285 (file-name (git-file-name name version))))
286 (build-system cmake-build-system)
287 (arguments
288 ;; XXX: GPU tests are failing.
289 (list #:configure-flags #~(list "-DOCIO_BUILD_GPU_TESTS=false")
290 #:phases
291 #~(modify-phases %standard-phases
292 (add-after 'unpack 'disable-test
293 ;; The approach is somewhat desperate and removes not only
294 ;; line 1436 of the failing
295 ;; FileFormatCTF/difficult_xml_unknown_elements test,
296 ;; but also the identical line 1524 of the succeeding
297 ;; FileFormatCTF/unknown_elements test.
298 (lambda _
299 (substitute* "tests/cpu/fileformats/FileFormatCTF_tests.cpp"
300 (("OCIO_CHECK_NE.*ErrorOutputs.*")
301 ""))))
302 (add-after 'unpack 'fix-broken-test
303 (lambda _
304 ;; Replace the invalid multi-line list. It is unclear why
305 ;; this is now failing after only build system updates.
306 ;; (see https://github.com/AcademySoftwareFoundation/OpenColorIO/blob/v2.4.2/tests/cpu/Config_tests.cpp#L6227)
307 (substitute* "tests/cpu/Config_tests.cpp"
308 (("cs1\\\\t\\\\n \\\\n, \\\\ncs2")
309 "cs1, cs2"))))
310 ;; Disable a failing test case on arm and riscv due to FMA
311 ;; instructions being generated.
312 ;; (see https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1784)
313 #$@(if (or (target-arm?)
314 (target-riscv64?))
315 #~((add-after 'unpack 'disable-failing-test
316 (lambda _
317 (substitute* "tests/cpu/ops/gamma/GammaOpCPU_tests.cpp"
318 ((".*apply_moncurve_mirror_style_fwd.*" all)
319 (string-append "#if 0\n" all))
320 ((".*apply_moncurve_mirror_style_rev.*" all)
321 (string-append "#endif\n" all))))))
322 #~()))))
323 (native-inputs
324 ;; XXX: OCIO has unit tests for OpenShadingLanguage, but they fail.
325 ;; They also require OIIO, but OCIO is an optional dependency to it.
326 (list pybind11-2 python-wrapper))
327 (inputs
328 (list expat
329 freeglut
330 glew
331 imath
332 lcms
333 libglvnd
334 ;; [email protected] fails to build with [email protected]
335 minizip-ng-4.0.9
336 openexr
337 pystring
338 yaml-cpp
339 zlib))
340 (home-page "https://opencolorio.org")
341 (synopsis "Color management for visual effects and animation")
342 (description
343 "OpenColorIO, or OCIO, is a complete color management solution geared
344towards motion picture production, with an emphasis on visual effects and
345computer animation. It provides a straightforward and consistent user
346experience across all supporting applications while allowing for sophisticated
347back-end configuration options suitable for high-end production usage.
348
349OCIO is compatible with the @acronym{ACES, Academy Color Encoding
350Specification} and is @acronym{LUT, look-up table}-format agnostic, supporting
351many popular formats.")
352 (license license:bsd-3)))
353
354(define-public vtk
355 (package
356 (name "vtk")
357 (version "9.6.0")
358 (source (origin
359 (method url-fetch)
360 (uri (string-append "https://vtk.org/files/release/"
361 (version-major+minor version)
362 "/VTK-" version ".tar.gz"))
363 (sha256
364 (base32
365 "1wmq7cd6c60hp7xip08mjrwhwygna4vabfbqcn0xrbzsjh31hzfp"))
366 (modules '((guix build utils)))
367 (snippet
368 '(begin
369 (for-each
370 (lambda (dir)
371 (delete-file-recursively
372 (string-append "ThirdParty/" dir "/vtk" dir)))
373 ;; pugixml depended upon unconditionally
374 '("eigen" "expat" "freetype" "gl2ps"
375 "hdf5" "jpeg" "jsoncpp" "libharu" "libproj"
376 "libxml2" "lz4" "netcdf" "ogg" "png" "sqlite" "theora"
377 "tiff" "zlib"))))))
378 (properties `((release-monitoring-url . "https://vtk.org/download/")))
379 (build-system cmake-build-system)
380 (arguments
381 (list #:build-type "Release" ;Build without '-g' to save space.
382 #:configure-flags
383 #~'("-DVTK_USE_EXTERNAL=OFF" ;default
384 "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
385 "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
386 "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
387 "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
388 "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
389 "-DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON"
390 "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
391 "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
392 "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
393 "-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=ON"
394 "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
395 "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
396 "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
397 "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
398 "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
399 "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
400 ;;"-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON" ;breaks IO/CityGML
401 "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
402 "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
403 "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
404 "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"
405 "-DVTK_MODULE_ENABLE_VTK_RenderingExternal=YES" ;for F3D
406 "-DVTK_MODULE_ENABLE_VTK_GUISupportQt=YES" ;for itk-snap
407 "-DVTK_WRAP_PYTHON=ON"
408 "-DVTK_PYTHON_VERSION:STRING=3"
409
410 "-DVTK_SMP_ENABLE_OPENNMP=ON"
411 "-DVTK_SMP_ENABLE_TBB=ON"
412 "-DVTK_USE_MPI=ON"
413 #$@(if (target-riscv64?)
414 '("-DCMAKE_SHARED_LINKER_FLAGS=-latomic"
415 "-DCMAKE_EXE_LINKER_FLAGS=-latomic")
416 '()))
417
418 #:phases
419 #~(modify-phases %standard-phases
420 (add-after 'unpack 'clear-reference-to-compiler
421 (lambda _
422 (define (choose . files)
423 (let loop ((files files))
424 (if (null? files)
425 #f
426 (if (file-exists? (car files))
427 (car files)
428 (loop (cdr files))))))
429
430 ;; Do not retain a reference to GCC.
431 (substitute* (choose
432 "Common/Core/vtkBuild.h.in" ;dummy >=v9.3
433 "Common/Core/vtkConfigureDeprecated.h.in" ;v9.x
434 "Common/Core/vtkConfigure.h.in") ;v7.x
435 (("@CMAKE_CXX_COMPILER@") "c++")))))
436
437 #:tests? #f)) ;XXX: test data not included
438 (inputs
439 (list double-conversion
440 eigen
441 expat
442 freetype
443 gl2ps
444 glew
445 glu
446 hdf5
447 libharu
448 libjpeg-turbo
449 jsoncpp
450 libtheora
451 libx11
452 libxml2
453 libxt
454 lz4
455 mesa
456 netcdf
457 libpng
458 libtiff
459 openmpi
460 proj
461 python
462 ;("pugixml" ,pugixml)
463 sqlite
464 xorgproto
465 qtbase
466 zlib))
467 (propagated-inputs
468 ;; VTK's 'VTK-vtk-module-find-packages.cmake' calls
469 ;; 'find_package(THEORA)', which in turns looks for libogg. Likewise for
470 ;; TBB.
471 (list libogg
472 onetbb))
473 (home-page "https://vtk.org/")
474 (synopsis "Libraries for 3D computer graphics")
475 (description
476 "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics,
477image processing and visualization. It supports a wide variety of
478visualization algorithms including: scalar, vector, tensor, texture, and
479volumetric methods; and advanced modeling techniques such as: implicit
480modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay
481triangulation. VTK has an extensive information visualization framework, has
482a suite of 3D interaction widgets, supports parallel processing, and
483integrates with various databases on GUI toolkits such as Qt and Tk.")
484 (license license:bsd-3)))
485
486(define-public vtk-9.5
487 (package
488 (inherit vtk)
489 (version "9.5.2")
490 (source (origin
491 (method url-fetch)
492 (uri (string-append "https://vtk.org/files/release/"
493 (version-major+minor version)
494 "/VTK-" version ".tar.gz"))
495 (sha256
496 (base32
497 "12f9cbazgxrm71r4fpdlxk0mlpgzim2i7vziv8177zvhsac4prnf"))
498 (modules '((guix build utils)))
499 (snippet
500 '(begin
501 (for-each
502 (lambda (dir)
503 (delete-file-recursively
504 (string-append "ThirdParty/" dir "/vtk" dir)))
505 ;; pugixml depended upon unconditionally
506 '("doubleconversion" "eigen" "expat" "freetype" "gl2ps"
507 "hdf5" "jpeg" "jsoncpp" "libharu" "libproj"
508 "libxml2" "lz4" "netcdf" "ogg" "png" "sqlite" "theora"
509 "tiff" "zlib"))))))))
510
511(define-public vtk-9.4
512 (package
513 (inherit vtk)
514 (version "9.4.2")
515 (source (origin
516 (method url-fetch)
517 (uri (string-append "https://vtk.org/files/release/"
518 (version-major+minor version)
519 "/VTK-" version ".tar.gz"))
520 (sha256
521 (base32
522 "00kahpi53hld3ip3cfswdnvfg4llmabq0w2kzqq2mcbbm46qxj9n"))
523 (modules '((guix build utils)))
524 (snippet
525 '(begin
526 (for-each
527 (lambda (dir)
528 (delete-file-recursively
529 (string-append "ThirdParty/" dir "/vtk" dir)))
530 ;; pugixml depended upon unconditionally
531 '("doubleconversion" "eigen" "expat" "freetype" "gl2ps"
532 "hdf5" "jpeg" "jsoncpp" "libharu" "libproj"
533 "libxml2" "lz4" "netcdf" "ogg" "png" "sqlite" "theora"
534 "tiff" "zlib"))))))))
535
536(define-public vtk-9.3
537 (package
538 (inherit vtk)
539 (version "9.3.1")
540 (source (origin
541 (method url-fetch)
542 (uri (string-append "https://vtk.org/files/release/"
543 (version-major+minor version)
544 "/VTK-" version ".tar.gz"))
545 (sha256
546 (base32
547 "1f6ac40db7wkb3bfh31d71qc5gy44cw29r6v4cyxrlm09q4fqm43"))
548 (modules '((guix build utils)))
549 (snippet
550 '(begin
551 (for-each
552 (lambda (dir)
553 (delete-file-recursively
554 (string-append "ThirdParty/" dir "/vtk" dir)))
555 ;; pugixml depended upon unconditionally
556 '("doubleconversion" "eigen" "expat" "freetype" "gl2ps"
557 "glew" "hdf5" "jpeg" "jsoncpp" "libharu" "libproj"
558 "libxml2" "lz4" "netcdf" "ogg" "png" "sqlite" "theora"
559 "tiff" "zlib"))
560 (substitute* "IO/ExportPDF/vtkPDFContextDevice2D.cxx"
561 (("\\bHPDF_UINT16 (noPen|dash|dot|denseDot|dashDot|dashDotDot)\\b"
562 _ var)
563 (string-append "HPDF_REAL " var)))))))))
564
565(define-public vktdiff
566 (package
567 (name "vtkdiff")
568 (version "1.0.0")
569 (source
570 (origin
571 (method git-fetch)
572 (uri (git-reference
573 (url "https://github.com/ufz/vtkdiff")
574 (commit version)))
575 (file-name (git-file-name name version))
576 (sha256
577 (base32 "15nwzfhgyjfvd083kw1s19xkxcds9h31hx9cr339x3bkllbj609j"))))
578 (build-system cmake-build-system)
579 (inputs (list tclap vtk))
580 (arguments
581 (list
582 #:tests? #f ;There are no tests.
583 #:configure-flags #~(list "-DGUIX_BUILD=ON")))
584 (home-page "https://github.com/ufz/vtkdiff")
585 (synopsis "Numerical difference of data arrays in vtk files")
586 (description
587 "The vtkdiff tool shall provide means of numerical comparison of
588different data arrays similar to those available in the numdiff software.")
589 (license license:bsd-3)))
590
591(define-public opencv
592 (package
593 (name "opencv")
594 (version "4.13.0")
595 (source (origin
596 (method git-fetch)
597 (uri (git-reference
598 (url "https://github.com/opencv/opencv")
599 (commit version)))
600 (file-name (git-file-name name version))
601 (snippet
602 #~(begin
603 (use-modules (guix build utils)
604 (ice-9 ftw)
605 (srfi srfi-26))
606 ;; Delete any bundled .jar files.
607 (for-each delete-file (find-files "." "\\.jar$"))
608 (define (delete-all-but directory . preserve)
609 (with-directory-excursion directory
610 (let* ((pred (negate (cut member <>
611 (cons* "." ".." preserve))))
612 (items (scandir "." pred)))
613 (for-each (cut delete-file-recursively <>) items))))
614 (delete-all-but "3rdparty"
615 "fastcv" ;TODO: Unbundle these
616 "libspng"
617 "libtim-vx"
618 "orbbecsdk"
619 "quirc"
620 "zlib-ng")))
621 (sha256
622 (base32
623 "15w4fqjqv5k1yw70jbjsnlgiky39mqpy05rvmm2fbyjrif4kbgkl"))))
624 (build-system cmake-build-system)
625 (arguments
626 (list
627 #:parallel-tests? #f
628 #:configure-flags
629 #~(list "-DWITH_ADE=OFF" ;we don't have a package for ade yet
630 "-DWITH_IPP=OFF"
631 "-DWITH_ITT=OFF"
632 "-DWITH_CAROTENE=OFF" ; only visible on arm/aarch64
633 "-DENABLE_PRECOMPILED_HEADERS=OFF"
634 "-DOPENCV_GENERATE_PKGCONFIG=ON"
635
636 ;; CPU-Features:
637 ;; See cmake/OpenCVCompilerOptimizations.cmake
638 ;; (CPU_ALL_OPTIMIZATIONS) for a list of all optimizations
639 ;; BASELINE is the minimum optimization all CPUs must support
640 ;;
641 ;; DISPATCH is the list of optional dispatches.
642 "-DCPU_BASELINE=SSE2"
643
644 ;; Build Python bindings.
645 "-DBUILD_opencv_python3=ON"
646
647 #$@(match (%current-system)
648 ("x86_64-linux"
649 '("-DCPU_DISPATCH=NEON;VFPV3;FP16;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX"
650 "-DCPU_DISPATCH_REQUIRE=SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2"))
651 ("armhf-linux"
652 '("-DCPU_BASELINE_DISABLE=NEON")) ; causes build failures
653 ("aarch64-linux"
654 '("-DCPU_BASELINE=NEON"
655 "-DCPU_DISPATCH=NEON;VFPV3;FP16"))
656 (_ '()))
657
658 "-DBUILD_PERF_TESTS=OFF"
659 "-DBUILD_TESTS=ON"
660
661 (string-append "-DOPENCV_EXTRA_MODULES_PATH=" (getcwd)
662 "/opencv-contrib/modules")
663
664 ;;Define test data:
665 (string-append "-DOPENCV_TEST_DATA_PATH=" (getcwd)
666 "/opencv-extra/testdata")
667
668 ;; Is ON by default and would try to rebuild 3rd-party protobuf,
669 ;; which we had removed, which would lead to an error:
670 "-DBUILD_PROTOBUF=OFF"
671
672 ;; OpenCV tries to use flatbuffers in 3rdparty which we removed
673 ;; so for now we don't buildfor flatbuffer support
674 ;; TODO: make OpenCV use system flatbuffers which involves
675 ;; modifying CMake files
676 "-DWITH_FLATBUFFERS=OFF"
677
678 ;; Rebuild protobuf files, because we have a slightly different
679 ;; version than the included one. If we would not update, we
680 ;; would get a compile error later:
681 "-DPROTOBUF_UPDATE_FILES=ON"
682
683 ;; For xfeatures2d.
684 "-DOPENCV_SKIP_FEATURES2D_DOWNLOADING=ON")
685 #:phases
686 #~(modify-phases %standard-phases
687 (add-after 'unpack 'disable-broken-tests
688 (lambda _
689 ;; This test fails with "unknown file: Failure"
690 ;; But I couldn't figure out which file was missing:
691 (substitute* "../opencv-contrib/modules/face/test/test_face_align.cpp"
692 (("\\bcan_detect_landmarks\\b" all)
693 (string-append "DISABLED_" all)))
694
695 ;; This all fails with a comparison between the expected 396 and
696 ;; the actual 440 in file size.
697 (substitute* "modules/imgcodecs/test/test_exr.impl.hpp"
698 (("\\breadWrite_32FC1\\b" all)
699 (string-append "DISABLED_" all)))
700
701 ;; These fail with protobuf parse errors that come from
702 ;; opencv-extra/alldata.
703 (substitute* "modules/dnn/test/test_layers.cpp"
704 (("\\b(Accum|DataAugmentation|Resample|Correlation|Interp)\\b" all)
705 (string-append "DISABLED_" all)))
706
707 ;; This test fails on x86-64, loosen the bounds.
708 ;; Expected: (max) < (0.1), actual: 0.2 vs 0.1
709 (substitute* "modules/photo/test/test_hdr.cpp"
710 (("0\\.1\\)") "0.222)"))
711
712 #$@(if (target-aarch64?)
713 `(;; This test fails on aarch64, loosen the bounds.
714 ;; Expected: (max) < (0.131), actual: 0.207148 vs 0.131
715 (substitute* "modules/photo/test/test_hdr.cpp"
716 (("0\\.131") "0.222"))
717 ;; These tests hang forever on aarch64.
718 (delete-file-recursively "modules/videoio/test/")
719 ;; This test fails on aarch64 due to floating-point precision
720 ;; differences with ARM NEON.
721 ;; Expected: RMSE <= 0.34, actual: 0.407627
722 (substitute* "../opencv-contrib/modules/optflow/test/test_OF_accuracy.cpp"
723 (("\\bReferenceAccuracy\\b" all)
724 (string-append "DISABLED_" all))))
725 '())
726
727 #$@(if (target-riscv64?)
728 `(;; This test fails on riscv64, loosen the bounds.
729 ;; Expected: (max) < (0.1), actual: 0.220829 vs 0.1
730 (substitute* "modules/photo/test/test_hdr.cpp"
731 (("0\\.1") "0.240"))
732 ;; Expected equality of these values:
733 ;; ellipses.size()
734 ;; Which is: 668
735 ;; ellipses_size
736 ;; Which is: 2449
737 (substitute* "../opencv-contrib/modules/ximgproc/test/test_fld.cpp"
738 (("\\bManySmallCircles\\b" all)
739 (string-append "DISABLED_" all))))
740 '())))
741 (add-after 'unpack 'unpack-submodule-sources
742 (lambda* (#:key inputs #:allow-other-keys)
743 (mkdir "../opencv-extra")
744 (mkdir "../opencv-contrib")
745 (copy-recursively (assoc-ref inputs "opencv-extra")
746 "../opencv-extra")
747 (copy-recursively (assoc-ref inputs "opencv-contrib")
748 "../opencv-contrib")
749
750 ;; Disable downloads of Boost and VGG descriptors as we include
751 ;; them in native inputs.
752 (substitute* "../opencv-contrib/modules/xfeatures2d/CMakeLists.txt"
753 (("download_(boost|vgg)_descriptors") "#"))
754 (copy-recursively (assoc-ref inputs "opencv-3rdparty-boost")
755 "../downloads/xfeatures2d")
756 (for-each make-file-writable
757 (find-files "../downloads/xfeatures2d" "."))
758 (copy-recursively (assoc-ref inputs "opencv-3rdparty-vgg")
759 "../downloads/xfeatures2d")))
760 (add-after 'build 'do-not-install-3rdparty-file
761 (lambda _
762 (substitute* "cmake_install.cmake"
763 (("file\\(INSTALL .*3rdparty/include/opencl/LICENSE.txt.*")
764 ""))))
765 (add-before 'check 'start-xserver
766 (lambda* (#:key inputs #:allow-other-keys)
767 (let ((xorg-server (assoc-ref inputs "xorg-server"))
768 (disp ":1"))
769 (setenv "HOME" (getcwd))
770 (setenv "DISPLAY" disp)
771 ;; There must be a running X server and make check doesn't start one.
772 ;; Therefore we must do it.
773 (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server disp)))))))))
774 (native-inputs
775 `(("pkg-config" ,pkg-config)
776 ("xorg-server" ,xorg-server-for-tests) ;For running the tests
777 ;; These are files that are derived from the binary descriptors that
778 ;; are part of the BinBoost package. The BinBoost package is released
779 ;; under GPLv2+. See
780 ;; https://www.epfl.ch/labs/cvlab/research/descriptors-and-keypoints/research-detect-binboost/
781 ;; See xfeatures2d/cmake/download_boostdesc.cmake for commit hash.
782 ("opencv-3rdparty-boost"
783 ,(let ((commit "34e4206aef44d50e6bbcd0ab06354b52e7466d26"))
784 (origin
785 (method git-fetch)
786 (uri (git-reference (url "https://github.com/opencv/opencv_3rdparty")
787 (commit commit)))
788 (file-name (git-file-name "opencv_3rdparty" commit))
789 (sha256
790 (base32
791 "13yig1xhvgghvxspxmdidss5lqiikpjr0ddm83jsi0k85j92sn62")))))
792 ;; These are the Visual Geometry Group descriptors, released under
793 ;; BSD-3. They are generated files produced by the DLCO framework.
794 ;; See xfeatures2d/cmake/download_vgg.cmake for commit hash.
795 ("opencv-3rdparty-vgg"
796 ,(let ((commit "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d"))
797 (origin
798 (method git-fetch)
799 (uri (git-reference (url "https://github.com/opencv/opencv_3rdparty")
800 (commit commit)))
801 (file-name (git-file-name "opencv_3rdparty" commit))
802 (sha256
803 (base32
804 "0r9fam8dplyqqsd3qgpnnfgf9l7lj44di19rxwbm8mxiw0rlcdvy")))))
805 ("opencv-extra"
806 ,(origin
807 (method git-fetch)
808 (uri (git-reference
809 (url "https://github.com/opencv/opencv_extra")
810 (commit version)))
811 (file-name (git-file-name "opencv_extra" version))
812 (sha256
813 (base32
814 "0jbph7zg4cczpnly9n2xarwk2l1gxlv3644avjny4rkr32kcggdg"))))
815 ("opencv-contrib"
816 ,(origin
817 (method git-fetch)
818 (uri (git-reference (url "https://github.com/opencv/opencv_contrib")
819 (commit version)))
820 (file-name (git-file-name "opencv_contrib" version))
821 (sha256
822 (base32
823 "121qkc7g9kwgkv094khxdqqm5bf7ykqplmaadgszcsgxa6ml517i"))))))
824 (inputs
825 (list dlpack
826 eigen
827 ffmpeg-4
828 ;; TODO: add gstreamer
829 gtk+
830 hdf5
831 imath ;should be propagated by openexr
832 jasper
833 libgphoto2
834 libjpeg-turbo
835 libpng
836 libtiff
837 libwebp
838 openblas
839 opencl-headers
840 openexr
841 openmpi
842 openjpeg
843 protobuf
844 python
845 python-numpy
846 vtk-9.3
847 zlib))
848 ;; These three CVEs are not a problem of OpenCV, see:
849 ;; https://github.com/opencv/opencv/issues/10998
850 (properties '((lint-hidden-cve . ("CVE-2018-7712"
851 "CVE-2018-7713"
852 "CVE-2018-7714"))))
853 (synopsis "Computer vision library")
854 (description "OpenCV is a library aimed at real-time computer vision,
855including several hundred computer vision algorithms. It can be used to do
856things like:
857
858@itemize
859@item image and video input and output
860@item image and video processing
861@item displaying
862@item feature recognition
863@item segmentation
864@item facial recognition
865@item stereo vision
866@item structure from motion
867@item augmented reality
868@item machine learning
869@end itemize\n
870
871This package includes the Python bindings for OpenCV, which are also known as
872the OpenCV-Python library.")
873 (home-page "https://opencv.org/")
874 (license license:bsd-3)))
875
876(define-public vips
877 (package
878 (name "vips")
879 (version "8.17.0")
880 (source
881 (origin
882 (method git-fetch)
883 (uri (git-reference
884 (url "https://github.com/libvips/libvips")
885 (commit (string-append "v" version))))
886 (file-name (git-file-name name version))
887 (sha256
888 (base32 "1rdz2mmivr02s7cksqgbramv37yw95w6s8r20hgjqx36in2ndnbl"))))
889 (build-system meson-build-system)
890 (native-inputs
891 (list `(,glib "bin")
892 gobject-introspection
893 pkg-config))
894 (inputs
895 (list glib
896 hdf5
897 imagemagick
898 poppler))
899 ;; Propagated to satisfy vips.pc.
900 (propagated-inputs
901 (list expat
902 fftw
903 lcms
904 libexif
905 libgsf
906 libjpeg-turbo
907 libpng
908 (librsvg-for-system)
909 libtiff
910 libwebp
911 matio
912 openexr
913 orc
914 pango))
915 (home-page "https://www.libvips.org/")
916 (synopsis "Multithreaded image processing system with low memory needs")
917 (description
918 "VIPS is a demand-driven, horizontally threaded image processing library.
919It's particularly good at processing large images, working with colour,
920scientific analysis, and general research & development.
921
922Compared to most image processing libraries VIPS needs little RAM and runs
923quickly, especially on machines with more than one CPU core. This is primarily
924due to its architecture which automatically parallelises the image workflows.")
925 (license license:lgpl2.1+)))
926
927(define-public gmic
928 (package
929 (name "gmic")
930 (version "4.0.3")
931 (source
932 (origin
933 (method url-fetch)
934 (uri (string-append "https://gmic.eu/files/source/gmic_"
935 version ".tar.gz"))
936 (sha256
937 (base32 "0azqllvaqqsy69qxcsnpi2bznffjyrminfjlhrfqqz36mia4cf20"))))
938 (build-system cmake-build-system)
939 (arguments
940 (list
941 #:tests? #f ;there are no tests
942 #:configure-flags #~(list "-DBUILD_LIB_STATIC=OFF"
943 "-DENABLE_DYNAMIC_LINKING=ON"
944 (string-append "-DCMAKE_EXE_LINKER_FLAGS="
945 "-Wl,-rpath=" #$output "/lib")
946 "-DENABLE_LTO=ON")))
947 (native-inputs
948 (list pkg-config))
949 (inputs
950 (list curl
951 fftw
952 graphicsmagick
953 imath
954 libjpeg-turbo
955 libpng
956 libtiff
957 libx11
958 openexr
959 zlib))
960 (home-page "https://gmic.eu/")
961 (synopsis "Full-featured framework for digital image processing")
962 (description "G'MIC is a full-featured framework for digital image
963processing. It provides several user interfaces to convert / manipulate
964/ filter / visualize generic image datasets, ranging from 1D scalar
965signals to 3D+t sequences of multi-spectral volumetric images, hence
966including 2D color images.")
967 ;; Dual-licensed, either license applies.
968 (license (list license:cecill license:cecill-c))))
969
970(define-public gmic-qt
971 (package
972 (inherit gmic)
973 (name "gmic-qt")
974 (arguments
975 (substitute-keyword-arguments arguments
976 ((#:configure-flags _)
977 #~(list "-DBUILD_WITH_QT6=ON"
978 "-DGMIC_QT_HOST=none"
979 "-DENABLE_DYNAMIC_LINKING=ON"))
980 ((#:phases phases '%standard-phases)
981 #~(modify-phases #$phases
982 (add-after 'unpack 'qt-chdir
983 (lambda _ (chdir "gmic-qt")))))))
984 (native-inputs
985 (list pkg-config qttools))
986 (inputs
987 (modify-inputs inputs
988 (prepend gmic qtbase)))
989 (synopsis "Qt frontend for the G'MIC image processing framework")
990 (license license:gpl3+)))
991
992(define-public gmic-qt-gimp
993 (package
994 (inherit gmic-qt)
995 (name "gmic-qt-gimp")
996 (inputs
997 ;; GIMP and its dependencies.
998 (modify-inputs inputs
999 (prepend gexiv2-0.14 gdk-pixbuf gegl gimp pango)))
1000 (arguments
1001 (substitute-keyword-arguments arguments
1002 ((#:configure-flags flags)
1003 #~(list "-DBUILD_WITH_QT6=ON"
1004 "-DGMIC_QT_HOST=gimp3"
1005 "-DENABLE_DYNAMIC_LINKING=ON"))))
1006 (synopsis "GIMP plugin for the G'MIC image processing framework")))
1007
1008(define-public nip2
1009 (package
1010 (name "nip2")
1011 (version "8.9.1")
1012 (source
1013 (origin
1014 (method url-fetch)
1015 (uri (string-append "https://github.com/libvips/nip2/releases/download/v"
1016 version "/nip2-" version ".tar.gz" ))
1017 (sha256
1018 (base32 "1kbndn37m0cfjvrvw25b5if9d962r8v79q78i2lzm55r7zmjcpmp"))))
1019 (build-system gnu-build-system)
1020 (arguments
1021 `(#:phases
1022 (modify-phases %standard-phases
1023 (add-before 'check 'set-home
1024 (lambda _
1025 (setenv "HOME" "/tmp"))))))
1026 (inputs (list gsl gtk+-2 vips))
1027 (native-inputs (list bison flex pkg-config))
1028 (home-page "https://github.com/libvips/nip2")
1029 (synopsis "Spreadsheet-like GUI for libvips")
1030 (description "This package provide a graphical user interface (GUI) for
1031the VIPS image processing library. It's a little like a spreadsheet: you
1032create a set of formula connecting your objects together, and on a change nip2
1033recalculates.")
1034 (license license:gpl2+)))
1035
1036(define-public paraview
1037 (package
1038 (name "paraview")
1039 (version "6.0.0")
1040 (source
1041 (origin
1042 (method git-fetch)
1043 (uri (git-reference
1044 (url "https://gitlab.kitware.com/paraview/paraview")
1045 (commit (string-append "v" version))
1046 (recursive? #t)))
1047 (file-name (git-file-name name version))
1048 (sha256
1049 (base32 "1m1c7vngrpaqdqvnjx4wj0va20hih5rb7rf0a44mp3wqgp4wgy0f"))
1050 (modules '((guix build utils)))
1051 (snippet
1052 ;; TODO: Also remove unused bundled libraries and plugins?
1053 #~(begin
1054 ;; Remove bundled ParaView libraries which are available in Guix
1055 ;; or undesired.
1056 (for-each (lambda (dir)
1057 (delete-file-recursively
1058 (string-append "ThirdParty/" dir "/vtk"
1059 (string-downcase dir))))
1060 '(;;"CosmoHaloFinder"
1061 ;;"IceT"
1062 "NvPipe" ; Don't want NvPipe support
1063 ;;"QtTesting"
1064 ;;"cinema"
1065 ;;"cinemasci"
1066 "protobuf"))
1067 ;; Remove undesired ParaView plugins.
1068 (delete-file-recursively "Plugins/pvNVIDIAIndeX")
1069 ;; Remove bundled VTK libraries which are available in Guix.
1070 (for-each (lambda (dir)
1071 (delete-file-recursively
1072 (string-append "VTK/ThirdParty/" dir "/vtk" dir)))
1073 '("cgns"
1074 "cli11"
1075 ;;"diy2"
1076 "doubleconversion"
1077 "eigen"
1078 ;;"exodusII"
1079 "expat"
1080 ;;"exprtk"
1081 ;;"fast-float"
1082 ;;"fides"
1083 "fmt"
1084 "freetype"
1085 "gl2ps"
1086 ;;"glad"
1087 ;;"h5part"
1088 "hdf5"
1089 ;;"ioss"
1090 "jpeg"
1091 "jsoncpp"
1092 ;;"kissfft"
1093 ;;"libharu" ; Requires some PRs applied to 2.3.0
1094 "libproj"
1095 "libxml2"
1096 ;;"loguru"
1097 "lz4"
1098 "lzma"
1099 "mpi4py"
1100 "netcdf"
1101 "nlohmannjson"
1102 "ogg"
1103 ;;"pegtl"
1104 "png"
1105 "pugixml"
1106 "sqlite"
1107 "theora"
1108 "tiff"
1109 ;;"token"
1110 "utf8"
1111 ;;"verdict"
1112 ;;"viskores"
1113 ;;"vpic"
1114 ;;"vtkm"
1115 ;;"xdmf2"
1116 ;;"xdmf3"
1117 "zlib"))))))
1118 (build-system qt-build-system)
1119 (arguments
1120 (list
1121 #:qtbase qtbase
1122 #:build-type "Release" ; 542 MiB in release mode
1123 #:tests? #f ; Downloads test data
1124 #:configure-flags
1125 #~(let ((doc (string-append "share/doc/" #$name "-" #$version)))
1126 (list
1127 (string-append "-DCMAKE_INSTALL_DOCDIR=" doc) ; For paraview.qch
1128
1129 ;; ParaView build options
1130 "-DPARAVIEW_BUILD_DEVELOPER_DOCUMENTATION=ON"
1131 (string-append "-DPARAVIEW_GENERATED_DOCUMENTATION_OUTPUT_DIRECTORY=" doc)
1132
1133 ;; ParaView capability options
1134 ;;"-DPARAVIEW_USE_EXTERNAL_VTK=ON" ; Unsupported by ParaView
1135 "-DPARAVIEW_USE_MPI=ON"
1136 "-DPARAVIEW_USE_PYTHON=ON"
1137 "-DPARAVIEW_USE_QTWEBENGINE=ON"
1138
1139 ;; ParaView features
1140 ;;
1141 ;; Enable those that are disabled by default.
1142 ;; Commented means the dependencies are missing from Guix
1143 ;; (or are otherwise described).
1144 ;;"-DPARAVIEW_ENABLE_ADIOS2=ON"
1145 ;;"-DPARAVIEW_ENABLE_COSMOTOOLS=ON"
1146 ;;"-DPARAVIEW_ENABLE_CATALYST=ON"
1147 "-DPARAVIEW_ENABLE_FFMPEG=ON"
1148 ;;"-DPARAVIEW_ENABLE_FIDES=ON"
1149 "-DPARAVIEW_ENABLE_GDAL=ON"
1150 ;;"-DPARAVIEW_ENABLE_LAS=ON"
1151 ;;"-DPARAVIEW_ENABLE_LOOKINGGLASS=ON" ; Downloads dependency
1152 ;;"-DPARAVIEW_ENABLE_MOMENTINVARIANTS=ON" ; Downloads dependency
1153 "-DPARAVIEW_ENABLE_MOTIONFX=ON"
1154 ;;"-DPARAVIEW_ENABLE_OPENTURNS=ON"
1155 ;;"-DPARAVIEW_ENABLE_OPENVDB=ON" ; Dependency not found
1156 ;;"-DPARAVIEW_ENABLE_PDAL=ON"
1157 ;;"-DPARAVIEW_ENABLE_RAYTRACING=ON"
1158 "-DPARAVIEW_ENABLE_VISITBRIDGE=ON"
1159 "-DPARAVIEW_ENABLE_XDMF3=ON"
1160
1161 ;; ParaView miscellaneous options
1162 ;;
1163 ;; Without -DPARAVIEW_DATA_EXCLUDE_FROM_ALL=OFF, test data is
1164 ;; downloaded even with tests disabled.
1165 "-DPARAVIEW_VERSIONED_INSTALL=OFF"
1166 "-DPARAVIEW_DATA_EXCLUDE_FROM_ALL=OFF"
1167
1168 ;; ParaView plugins
1169 ;;
1170 ;; Enable those that are disabled by default.
1171 ;; Commented means the dependencies are missing from Guix
1172 ;; (or are otherwise described).
1173 ;;"-DPARAVIEW_PLUGIN_ENABLE_AdiosReaderPixie=ON"
1174 ;;"-DPARAVIEW_PLUGIN_ENABLE_AdiosReaderStaging=ON"
1175 "-DPARAVIEW_PLUGIN_ENABLE_CAVEInteraction=ON"
1176 ;;"-DPARAVIEW_PLUGIN_ENABLE_CDIReader=ON"
1177 "-DPARAVIEW_PLUGIN_ENABLE_GeographicalMap=ON"
1178 "-DPARAVIEW_PLUGIN_ENABLE_GmshIO=ON"
1179 "-DPARAVIEW_PLUGIN_ENABLE_InSituExodus=ON"
1180 ;;"-DPARAVIEW_PLUGIN_ENABLE_LookingGlass=ON"
1181 "-DPARAVIEW_PLUGIN_ENABLE_NetCDFTimeAnnotationPlugin=ON"
1182 ;;"-DPARAVIEW_PLUGIN_ENABLE_ParFlow=ON" ; Build fails
1183 ;;"-DPARAVIEW_PLUGIN_ENABLE_PythonQtPlugin=ON"
1184 "-DPARAVIEW_PLUGIN_ENABLE_SpaceMouseInteractor=ON"
1185 ;;"-DPARAVIEW_PLUGIN_ENABLE_VDFReaderPlugin=ON"
1186 ;;"-DPARAVIEW_PLUGIN_ENABLE_XRInterface=ON" ; Build fails
1187 ;;"-DPARAVIEW_PLUGIN_ENABLE_zSpace=ON"
1188
1189 ;; VTK options
1190 "-DVTK_SMP_IMPLEMENTATION_TYPE=TBB"
1191 "-DVTKm_ENABLE_MPI=ON"
1192
1193 ;; External libraries for ParaView and VTK
1194 "-DVTK_MODULE_USE_EXTERNAL_ParaView_protobuf=ON"
1195 "-DVTK_MODULE_USE_EXTERNAL_VTK_cgns=ON"
1196 "-DVTK_MODULE_USE_EXTERNAL_VTK_cli11=ON"
1197 "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
1198 "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
1199 "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
1200 "-DVTK_MODULE_USE_EXTERNAL_VTK_fmt=ON"
1201 "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
1202 "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
1203 "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
1204 "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
1205 "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
1206 "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
1207 "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
1208 "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
1209 "-DVTK_MODULE_USE_EXTERNAL_VTK_lzma=ON"
1210 "-DVTK_MODULE_USE_EXTERNAL_VTK_mpi4py=ON"
1211 "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
1212 "-DVTK_MODULE_USE_EXTERNAL_VTK_nlohmannjson=ON"
1213 "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
1214 ;;"-DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=ON"
1215 "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
1216 "-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON"
1217 "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
1218 "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
1219 "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
1220 "-DVTK_MODULE_USE_EXTERNAL_VTK_utf8=ON"
1221 "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"))
1222 #:phases
1223 #~(modify-phases %standard-phases
1224 (add-after 'set-paths 'hide-gfortran
1225 (lambda _
1226 (setenv "CPLUS_INCLUDE_PATH"
1227 (string-join
1228 (delete (string-append #$(this-package-native-input "gfortran")
1229 "/include/c++")
1230 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
1231 ":"))))
1232 (replace 'install-license-files
1233 (lambda _
1234 (let ((src (string-append #$output "/share/licenses/ParaView"))
1235 (dst (string-append #$output "/share/doc/"
1236 #$name "-" #$version "/licenses")))
1237 (copy-recursively src dst)
1238 (delete-file-recursively (dirname src))))))))
1239 (native-inputs
1240 (list gfortran
1241 ;; For the documentation
1242 doxygen
1243 graphviz
1244 perl
1245 python-sphinx))
1246 (inputs
1247 (list boost
1248 cgns
1249 cli11
1250 curl
1251 double-conversion
1252 eigen
1253 expat
1254 ffmpeg
1255 fmt-11
1256 freetype
1257 gdal
1258 gl2ps
1259 gmsh
1260 hdf5
1261 nlohmann-json ;For ParFlow; build fails
1262 jsoncpp
1263 libjpeg-turbo
1264 libogg
1265 libpng
1266 libtheora
1267 libtiff
1268 libxcursor
1269 libxml2
1270 libxslt
1271 libxt
1272 lz4
1273 lzip
1274 mesa
1275 netcdf
1276 openmpi
1277 ;;openvdb ;For OpenVDB; dependency not found
1278 ;;openvr ;For XRInterface; build fails
1279 ;;pegtl ;For VTK; build fails
1280 proj
1281 protobuf
1282 pugixml
1283 python-cftime
1284 python-matplotlib
1285 python-mpi4py
1286 python-numpy
1287 python-wrapper
1288 qt5compat
1289 qtdeclarative
1290 qtmultimedia
1291 qtsvg
1292 qttools
1293 qtwebchannel
1294 qtwebengine
1295 sdl2
1296 sqlite
1297 onetbb
1298 utfcpp
1299 zlib))
1300 (home-page "https://www.paraview.org/")
1301 (synopsis "VTK-based, parallel data analyzer and visualizer")
1302 (description "ParaView is a VTK-based, parallel data analyzer and
1303visualizer which allows exploring data interactively in 3D or
1304programmatically.")
1305 (license license:bsd-3)))
1306
1307(define-public vxl
1308 (package
1309 (name "vxl")
1310 (version "3.5.0")
1311 (source
1312 (origin
1313 (method git-fetch)
1314 (uri (git-reference
1315 (url "https://github.com/vxl/vxl")
1316 (commit (string-append "v" version))))
1317 (file-name (git-file-name name version))
1318 (sha256
1319 (base32 "0iqq4lm51l5gvkax6r79ypifqmgir3p3vman9gsc2085d2agjvbs"))
1320 (modules '((guix build utils)))
1321 ;; TODO: vxl includes an old version of dcmtk. It won't build with
1322 ;; version 3.6.x.
1323 (snippet
1324 '(begin
1325 (for-each delete-file-recursively
1326 '("v3p/bzlib/"
1327 "v3p/geotiff/"
1328 "v3p/jpeg/"
1329 "v3p/png/"
1330 "v3p/tiff/"
1331 "v3p/zlib/"))
1332 (substitute* "v3p/CMakeLists.txt"
1333 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
1334 ""))
1335 #t))))
1336 (build-system cmake-build-system)
1337 (arguments
1338 ;; Not an actual test, but is incorrectly generated by the build system.
1339 (list #:test-exclude "vul_vul_test_driver"))
1340 (inputs
1341 (list libgeotiff libtiff libjpeg-turbo libpng zlib))
1342 (home-page "https://github.com/vxl/vxl/")
1343 (synopsis "Collection of C++ libraries for computer vision")
1344 (description "VXL (the Vision-something-Libraries) is a collection of C++
1345libraries designed for computer vision research and implementation.")
1346 (license license:bsd-3)))
1347
1348(define-public vxl-1
1349 (package (inherit vxl)
1350 (name "vxl")
1351 (version "1.18.0")
1352 (source
1353 (origin
1354 (method git-fetch)
1355 (uri (git-reference
1356 (url "https://github.com/vxl/vxl")
1357 (commit (string-append "v" version))))
1358 (file-name (git-file-name name version))
1359 (sha256
1360 (base32 "1g4mr2cc58jwm0vasscbd4y5380wj3ahkvq121z4gs83fhavvxgz"))
1361 (modules '((guix build utils)))
1362 (snippet
1363 '(begin
1364 (for-each delete-file-recursively
1365 '("v3p/bzlib/"
1366 "v3p/geotiff/"
1367 "v3p/png/"
1368 "v3p/tiff/"
1369 "v3p/zlib/"))
1370 (substitute* "v3p/CMakeLists.txt"
1371 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
1372 ""))))))
1373 (arguments
1374 (substitute-keyword-arguments arguments
1375 ((#:configure-flags flags)
1376 #~(cons* ;; Needed for itk-snap
1377 "-DVNL_CONFIG_LEGACY_METHODS=ON"
1378 "-DCMAKE_CXX_STANDARD=14"
1379 #$flags))))))
1380
1381(define-public insight-toolkit
1382 ;; For information about ITK remote modules, see:
1383 ;; https://insightsoftwareconsortium.github.io/ITKWikiArchive/Wiki/ITK/Policy_and_Procedures_for_Adding_Remote_Modules
1384 ;; For a remote MODULE, use the commit in
1385 ;; 'Modules/Remote/MODULE.remote.cmake'.
1386 ;; MorphologicalContourInterpolation is required by itk-snap.
1387 ;; SimpleITKFilters and GenericLabelInterpolator are required by simpleitk.
1388 ;; GenericLabelInterpolator and AdaptiveDenoising are required by ants.
1389 (let* ((module-mci-commit "821bf9b3ef8eaaab10391ed060dc9ca5e4d37b39")
1390 (module-mci-file (git-file-name "ITKMorphologicalContourInterpolation"
1391 module-mci-commit))
1392 (module-sitkf-commit "bb896868fc6480835495d0da4356d5db009592a6")
1393 (module-sitkf-file (git-file-name "ITKSimpleITKFilters"
1394 module-sitkf-commit))
1395 (module-gli-commit "ebf2436469ccf82c08fab54b7446f699ad0eae01")
1396 (module-gli-file (git-file-name "ITKGenericLabelInterpolator"
1397 module-gli-commit))
1398 (module-ad-commit "853934c352f83cb1e8f87e3051e1b8e75dbb41fe")
1399 (module-ad-file (git-file-name "ITKAdaptiveDenoising"
1400 module-ad-commit)))
1401 (package
1402 (name "insight-toolkit")
1403 (version "5.4.5")
1404 (source
1405 (origin
1406 (method git-fetch)
1407 (uri (git-reference
1408 (url "https://github.com/InsightSoftwareConsortium/ITK")
1409 (commit (string-append "v" version))))
1410 (file-name (git-file-name name version))
1411 (sha256
1412 (base32 "0sd037pgsdfigc5gi4lr5iwm063s0wrjl8i4b8dfxmrbipxjvn33"))
1413 ;; This patch is required to build with both ITK_USE_GPU=ON and
1414 ;; ITK_WRAP_PYTHON=ON.
1415 ;; <https://github.com/InsightSoftwareConsortium/ITK/pull/4842>
1416 (patches (search-patches "insight-toolkit-fix-build.patch"))))
1417 (build-system cmake-build-system)
1418 (outputs '("out" "python"))
1419 (arguments
1420 (list
1421 #:imported-modules (append %cmake-build-system-modules
1422 %pyproject-build-system-modules)
1423 #:modules '(((guix build pyproject-build-system) #:prefix py:)
1424 (guix build cmake-build-system)
1425 (guix build utils))
1426 #:configure-flags
1427 #~(list "-DITK_USE_GPU=ON"
1428 "-DITK_USE_SYSTEM_LIBRARIES=ON"
1429 "-DITK_USE_SYSTEM_CASTXML=ON"
1430 "-DITK_USE_SYSTEM_SWIG=ON"
1431 (string-append "-DHDF5_DIR="
1432 #$(this-package-input "hdf5") "/lib/cmake")
1433 "-DBUILD_SHARED_LIBS=ON"
1434 ;; Without this flag, there are shared libraries installed
1435 ;; in PY_SITE_PACKAGES_PATH/itk instead of #$output/lib and
1436 ;; RUNPATHs contain the *build directory* of
1437 ;; PY_SITE_PACKAGES_PATH/itk.
1438 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
1439 "-DITK_WRAPPING=ON"
1440 "-DITK_WRAP_PYTHON=ON"
1441 "-DITK_DYNAMIC_LOADING=ON"
1442 (let* ((python-version
1443 #$(version-major+minor
1444 (package-version
1445 (this-package-input "python"))))
1446 (python-lib-path (string-append #$output:python
1447 "/lib/python"
1448 python-version
1449 "/site-packages")))
1450 (string-append "-DPY_SITE_PACKAGES_PATH="
1451 python-lib-path))
1452 ;; Python is not built with Py_LIMITED_API.
1453 "-DITK_USE_PYTHON_LIMITED_API=OFF"
1454 "-DModule_MorphologicalContourInterpolation=ON"
1455 "-DModule_SimpleITKFilters=ON"
1456 "-DModule_GenericLabelInterpolator=ON"
1457 "-DModule_AdaptiveDenoising:BOOL=ON"
1458 "-DModule_ITKReview:BOOL=ON"
1459 "-DCMAKE_CXX_STANDARD=17"
1460 "-DBUILD_TESTING=OFF")
1461
1462 #:phases
1463 #~(modify-phases %standard-phases
1464 (add-after 'unpack 'do-not-tune
1465 (lambda _
1466 (substitute* "CMake/ITKSetStandardCompilerFlags.cmake"
1467 (("-mtune=native")
1468 ""))))
1469 (add-after 'unpack 'exclude-gtest-target
1470 (lambda _
1471 ;; Prevent ITKGoogleTest from being added to
1472 ;; ITK_MODULES_ENABLED in the installed
1473 ;; ITKConfig.cmake, which in turn prevents
1474 ;; 'GTest::GTest' from being added to the
1475 ;; ITK_LIBRARIES variable. This is necessary
1476 ;; because projects that use ITK fail to configure
1477 ;; otherwise. Fixes
1478 ;; <https://codeberg.org/guix/guix/issues/776>.
1479 ;; <https://github.com/microsoft/vcpkg/pull/27187>
1480 (substitute* "Modules/ThirdParty/GoogleTest/itk-module.cmake"
1481 (("DEPENDS")
1482 "DEPENDS\n EXCLUDE_FROM_DEFAULT"))))
1483 (add-after 'unpack 'prepare-remote-modules
1484 (lambda _
1485 ;; ITK module MorphologicalContourInterpolation
1486 ;; is for ITK-SNAP.
1487 (symlink #$(this-package-native-input module-mci-file)
1488 "Modules/Remote/MorphologicalContourInterpolation")
1489 (delete-file
1490 (string-append
1491 "Modules/Remote/"
1492 "MorphologicalContourInterpolation.remote.cmake"))
1493 ;; ITK modules SimpleITKFilters and GenericLabelInterpolator
1494 ;; are for SimpleITK.
1495 (symlink #$(this-package-native-input module-sitkf-file)
1496 "Modules/Remote/SimpleITKFilters")
1497 (delete-file "Modules/Remote/SimpleITKFilters.remote.cmake")
1498 (symlink #$(this-package-native-input module-gli-file)
1499 "Modules/Remote/GenericLabelInterpolator")
1500 (delete-file
1501 "Modules/Remote/GenericLabelInterpolator.remote.cmake")
1502 (symlink #$(this-package-native-input module-ad-file)
1503 "Modules/Remote/AdaptiveDenoising")
1504 (delete-file
1505 "Modules/Remote/AdaptiveDenoising.remote.cmake")))
1506 (delete 'check) ;tests require network access and external data
1507 (add-after 'install 'python-sanity-check
1508 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1509 (when tests?
1510 (py:add-installed-pythonpath inputs outputs)
1511 (invoke "python3" "-c" "import itk")))))))
1512 (inputs (list eigen
1513 expat
1514 fftw
1515 fftwf
1516 hdf5
1517 libjpeg-turbo
1518 libpng
1519 libtiff
1520 opencl-headers
1521 opencl-icd-loader
1522 perl
1523 python
1524 onetbb
1525 vxl-1
1526 zlib-ng-compat))
1527 (native-inputs
1528 (list castxml
1529 git-minimal/pinned
1530 pkg-config
1531 python-numpy ;for phase 'python-sanity-check
1532 swig-4.4
1533 which
1534 (origin
1535 (method git-fetch)
1536 (uri
1537 (git-reference
1538 (url (string-append
1539 "https://github.com/KitwareMedical/"
1540 "ITKMorphologicalContourInterpolation"))
1541 (commit module-mci-commit)))
1542 (file-name module-mci-file)
1543 (sha256
1544 (base32
1545 "00myhgvlk3n062i8bnknz1d10zkv3jlvs7f4jnk24727gd4v2n4i")))
1546 (origin
1547 (method git-fetch)
1548 (uri (git-reference
1549 (url (string-append
1550 "https://github.com/InsightSoftwareConsortium/"
1551 "ITKSimpleITKFilters"))
1552 (commit module-sitkf-commit)))
1553 (file-name module-sitkf-file)
1554 (sha256
1555 (base32
1556 "13nys94wl4k77f89i8y1dm3y4pmgmw3rrc0la1rzl0vi9h1qixii")))
1557 (origin
1558 (method git-fetch)
1559 (uri (git-reference
1560 (url (string-append
1561 "https://github.com/InsightSoftwareConsortium/"
1562 "ITKGenericLabelInterpolator"))
1563 (commit module-gli-commit)))
1564 (file-name module-gli-file)
1565 (sha256
1566 (base32
1567 "1khakqh6pzdg6csli8jypzrhcdr9xmhnzgwz265krv8r5mbnndrg")))
1568 (origin
1569 (method git-fetch)
1570 (uri (git-reference
1571 (url "https://github.com/ntustison/ITKAdaptiveDenoising")
1572 (commit module-ad-commit)))
1573 (file-name module-ad-file)
1574 (sha256
1575 (base32
1576 "0aqvhb4byg0shgbrwmb41nq2h8sbg45xn0gsdy94iiq0v72bw307")))))
1577
1578 ;; The 'CMake/ITKSetStandardCompilerFlags.cmake' file normally sets
1579 ;; '-mtune=native -march=corei7', suggesting there's something to be
1580 ;; gained from CPU-specific optimizations.
1581 (properties '((tunable? . #t)))
1582
1583 (home-page "https://github.com/InsightSoftwareConsortium/ITK/")
1584 (synopsis "Scientific image processing, segmentation and registration")
1585 (description
1586 "The Insight Toolkit (ITK) is a toolkit for N-dimensional
1587scientific image processing, segmentation, and registration. Segmentation is
1588the process of identifying and classifying data found in a digitally sampled
1589representation. Typically the sampled representation is an image acquired
1590from such medical instrumentation as CT or MRI scanners. Registration is the
1591task of aligning or developing correspondences between data. For example, in
1592the medical environment, a CT scan may be aligned with a MRI scan in order to
1593combine the information contained in both.")
1594 (license license:asl2.0))))
1595
1596;; Provide variant of insight-toolkit (ITK) built with ITK_LEGACY_REMOVE=OFF.
1597;; ITK-SNAP version 4.2.2 and 4.4.0-alpha3 require ITK >= 5.4 and for ITK to
1598;; be built this way. Note that enabling Python wrapping forces this option
1599;; to ON, so Python wrapping is not enabled for this build.
1600(define-public insight-toolkit-legacy
1601 (hidden-package
1602 (package/inherit insight-toolkit
1603 ;; Unfortunately we cannot remove the 'python output because it is
1604 ;; referenced in #:configure-flags below.
1605 (name "insight-toolkit-legacy")
1606 (arguments
1607 (substitute-keyword-arguments (package-arguments insight-toolkit)
1608 ((#:configure-flags cf '())
1609 #~(filter (lambda (flag)
1610 (not (or
1611 ;; Remove these flags to restore the default
1612 ;; ITK_LEGACY_REMOVE=OFF.
1613 (string=? "-DITK_WRAPPING=ON" flag)
1614 (string=? "-DITK_WRAP_PYTHON=ON" flag)
1615 ;; These flags are now unused.
1616 (string-prefix? "-DPY_SITE_PACKAGES_PATH=" flag)
1617 (string-prefix? "-DITK_USE_PYTHON_LIMITED_API=" flag)
1618 (string-prefix? "-DITK_USE_SYSTEM_CASTXML=" flag)
1619 (string-prefix? "-DITK_USE_SYSTEM_SWIG=" flag))))
1620 #$cf))
1621 ((#:phases phases #~%standard-phases)
1622 #~(modify-phases #$phases
1623 (delete 'python-sanity-check)))))
1624 (inputs (modify-inputs inputs
1625 (delete "python")))
1626 (native-inputs (modify-inputs native-inputs
1627 (delete "castxml")
1628 (delete "python-numpy")
1629 (delete "swig"))))))
1630
1631(define-public itk-snap
1632 ;; No tag for version 4.4.0. This seems to be the commit.
1633 (let ((commit "20f631865372dc7d1f49a1e930d83131102f7a20")
1634 (revision "0"))
1635 (package
1636 (name "itk-snap")
1637 (version (git-version "4.4.0" revision commit))
1638 (source
1639 (origin
1640 (method git-fetch)
1641 (uri (git-reference
1642 (url "https://github.com/pyushkevich/itksnap")
1643 (commit commit)))
1644 (file-name (git-file-name name version))
1645 (sha256
1646 (base32 "0zfaiz5lc1fy0n48bwbjgw3yschmscmq9bh0ym05cpaf4sbr4p7l"))))
1647 (build-system cmake-build-system)
1648 (arguments
1649 (list
1650 #:configure-flags
1651 #~(list "-DSNAP_VERSION_GIT_BRANCH=release")
1652 #:phases
1653 #~(modify-phases %standard-phases
1654 ;; During the installation phase all libraries provided by all
1655 ;; dependencies will be copied to the lib directory. That's insane,
1656 ;; so we disable this.
1657 (add-after 'unpack 'do-not-copy-dependencies
1658 (lambda _
1659 (substitute* "CMakeLists.txt"
1660 (("install\\(SCRIPT \\$\\{deploy_script\\}\\)") ""))))
1661 (add-after 'unpack 'disable-gui-tests
1662 (lambda _
1663 ;; The GUI tests just segmentation fault.
1664 (substitute* "CMakeLists.txt"
1665 ((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
1666|RandomForest|RandomForestBailOut|NaNs|4DContinuousRenderingD|EdgeAttraction\
1667|EchoCartesianDicomLoading|LabelSmoothing|PreferencesDialog|MeshImport\
1668|MeshWorkspace|SegmentationMesh|VolumeRendering|Reloading|4DToMC|MCTo4D\
1669|DeformationGrid)")
1670 ""))))
1671 (add-after 'unpack 'prepare-submodules
1672 (lambda _
1673 ;; Copy submodule instead of symlink because it is patched in
1674 ;; 'make-reproducible phase.
1675 (copy-recursively #$(this-package-native-input "c3d-checkout")
1676 "Submodules/c3d")
1677 (rmdir "Submodules/digestible")
1678 (symlink #$(this-package-native-input "digestible-checkout")
1679 "Submodules/digestible")
1680 (copy-recursively #$(this-package-native-input "greedy-checkout")
1681 "Submodules/greedy")))
1682 (add-after 'unpack 'remove-bundled-jsoncpp
1683 (lambda _
1684 (substitute* "CMakeLists.txt"
1685 ((" Common/JSon/jsoncpp\\.cpp") ""))))
1686 (add-after 'prepare-submodules 'make-reproducible
1687 (lambda _
1688 (substitute* "CMakeLists.txt"
1689 (("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
1690 "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))
1691 (substitute* "Common/SNAPCommon.cxx.in"
1692 (("@CMAKE_HOST_SYSTEM@ @CMAKE_HOST_SYSTEM_PROCESSOR@")
1693 "(removed for reproducibility)"))
1694 (substitute* "Submodules/c3d/ConvertImageVersion.cxx.in"
1695 (("@CONVERT3D_VERSION_COMPILE_DATE@")
1696 "(removed for reproducibility)"))
1697 (substitute* "Submodules/greedy/src/GreedyVersion.cxx.in"
1698 (("@GREEDY_VERSION_COMPILE_DATE@")
1699 "(removed for reproducibility)"))))
1700 (add-before 'check 'prepare-tests
1701 (lambda _
1702 ;; Needed by at least one test.
1703 (setenv "HOME" "/tmp")))
1704 (add-after 'install 'wrap-executable
1705 (lambda _
1706 (wrap-program (string-append #$output "/bin/itksnap")
1707 (list
1708 "QT_PLUGIN_PATH"
1709 'suffix
1710 (list (string-append #$(this-package-input "qtbase")
1711 "/lib/qt6/plugins")
1712 (string-append #$(this-package-input "qtdeclarative")
1713 "/lib/qt6/plugins")
1714 (string-append #$(this-package-input "qtwayland")
1715 "/lib/qt6/plugins"))))
1716 ;; The application uses argv[0] to locate itself. The wrapper
1717 ;; generated by wrap-program uses 'exec -a "${0##*/}"' which sets
1718 ;; argv[0] to just "itksnap" without a path, causing "Error
1719 ;; locating executable" on startup. Remove the -a flag so
1720 ;; argv[0] contains the full path to .itksnap-real.
1721 (substitute* (string-append #$output "/bin/itksnap")
1722 (("exec -a \"\\$\\{0##\\*/\\}\" ")
1723 "exec ")))))))
1724 (inputs
1725 (list curl
1726 freetype
1727 glew
1728 glu
1729 insight-toolkit-legacy
1730 jsoncpp
1731 libssh
1732 mesa-opencl
1733 qtbase
1734 qtdeclarative
1735 qtwayland
1736 vtk-9.5))
1737 (native-inputs
1738 (list
1739 doxygen
1740 qttools
1741 ;; Use the submodule commits in this version of ITK-SNAP.
1742 (origin
1743 (method git-fetch)
1744 (uri (git-reference
1745 (url "https://github.com/pyushkevich/c3d")
1746 (commit "d4d963629d7dfdca4b0607907f0e91827c22ea2a")))
1747 (file-name "c3d-checkout")
1748 (sha256
1749 (base32 "15yh2rdynql99yy5hanq5rha1pry9c3ryb7bfy47vvyqksk0znvs")))
1750 (origin
1751 (method git-fetch)
1752 (uri (git-reference
1753 (url "https://github.com/pyushkevich/digestible")
1754 (commit "1b66709e99c43d280bb472e1a0e36185ef2ea412")))
1755 (file-name "digestible-checkout")
1756 (sha256
1757 (base32 "1m1b954prq6l3byfdgxw2y17xsg81agd516g5n6ps60dqnxw8hqs")))
1758 (origin
1759 (method git-fetch)
1760 (uri (git-reference
1761 (url "https://github.com/pyushkevich/greedy")
1762 (commit "2d5dfa1891ac726524495d4ca8a3461be86c12f5")))
1763 (file-name "greedy-checkout")
1764 (sha256
1765 (base32 "13rz423p7p95ca94c5njr8jxbcic1hp8iqap613zlxmvl4n9vx15")))))
1766 (home-page "https://sourceforge.net/p/itk-snap/")
1767 (synopsis "Medical image segmentation")
1768 (description "ITK-SNAP is a tool for segmenting anatomical structures in
1769medical images. It provides an automatic active contour segmentation
1770pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a
1771full-featured UI aimed at clinical researchers.")
1772 ;; This includes the submodules greedy, c3d and digestible.
1773 (license license:gpl3+))))
1774
1775(define-public elastix
1776 (package
1777 (name "elastix")
1778 (version "5.3.0")
1779 (source
1780 (origin
1781 (method git-fetch)
1782 (uri (git-reference
1783 (url "https://github.com/SuperElastix/elastix")
1784 (commit version)))
1785 (file-name (git-file-name name version))
1786 (sha256
1787 (base32 "0sgw4cz4x6f78n6iqn87ll6wad32y67lmzvqfdfw1pzjkxbwzwyr"))
1788 (patches
1789 (search-patches "elastix-1404.patch"))))
1790 (properties '((tunable? . #t)))
1791 (build-system cmake-build-system)
1792 (arguments
1793 (list
1794 #:configure-flags
1795 #~(list "-DELASTIX_USE_EIGEN=ON"
1796 "-DELASTIX_ENABLE_PACKAGER:BOOL=OFF"
1797 "-DELASTIX_BUILD_EXECUTABLE:BOOL=ON"
1798 "-DCMAKE_CXX_FLAGS=-fPIC"
1799 "-DCMAKE_CXX_STANDARD=17"
1800 "-DBUILD_TESTING:BOOL=ON")
1801 ;; These tests fail and are skipped in upstream CI.
1802 #:test-exclude (string-join
1803 (list "elastix_run_example_COMPARE_IM"
1804 (string-append "elastix_run_3DCT_lung.MI.bspline."
1805 "ASGD.001_COMPARE_TP"))
1806 "|")))
1807 (inputs (list charls
1808 dcmtk
1809 eigen
1810 fftw
1811 insight-toolkit
1812 libpng
1813 libtiff
1814 zlib))
1815 (home-page "https://elastix.dev/")
1816 (synopsis "Image registration toolbox")
1817 (description
1818 "Elastix is a toolbox for rigid and nonrigid registration of images. The
1819software consists of a collection of algorithms that are commonly used to
1820perform (medical) image registration: the task of finding a spatial
1821transformation, mapping one image (the fixed image) to another (the moving
1822image), by optimizing relevant image similarity metrics.")
1823 (license license:asl2.0)))
1824
1825(define-public metapixel
1826 ;; Follow stable branch.
1827 (let ((commit "98ee9daa093b6c334941242e63f90b1c2876eb4f"))
1828 (package
1829 (name "metapixel")
1830 (version (git-version "1.0.2" "1" commit))
1831 (source
1832 (origin
1833 (method git-fetch)
1834 (uri (git-reference
1835 (url "https://github.com/schani/metapixel")
1836 (commit commit)
1837 ;; TODO: Package rwimg and lispreader?
1838 (recursive? #t)))
1839 (file-name (git-file-name name version))
1840 (sha256
1841 (base32 "0r7n3a6bvcxkbpda4mwmrpicii09iql5z69nkjqygkwxw7ny3309"))))
1842 (build-system gnu-build-system)
1843 (arguments
1844 (list
1845 #:tests? #f ; No tests.
1846 #:make-flags
1847 #~(list
1848 (string-append "PREFIX=" #$output)
1849 (format #f "MANPAGE_XSL=~a/xml/xsl/~a-~a/manpages/docbook.xsl"
1850 #$(this-package-native-input "docbook-xsl")
1851 #$(package-name
1852 (this-package-native-input "docbook-xsl"))
1853 #$(package-version
1854 (this-package-native-input "docbook-xsl"))))
1855 #:phases
1856 #~(modify-phases %standard-phases
1857 (delete 'configure)
1858 (add-before 'install 'fix-directory-creation
1859 (lambda _
1860 (mkdir-p (string-append #$output "/share/man/man1")))))))
1861 (inputs
1862 (list giflib libjpeg-turbo libpng
1863 perl))
1864 (native-inputs
1865 (list docbook-xml-4.2 docbook-xsl
1866 libxslt pkg-config))
1867 (home-page "https://www.complang.tuwien.ac.at/schani/metapixel/")
1868 (synopsis "Photomosaics generator")
1869 (description "Metapixel is a program for generating photomosaics. It can
1870generate classical photomosaics, in which the source image is viewed as a
1871matrix of equally sized rectangles for each of which a matching image is
1872substituted, as well as collage-style photomosaics, in which rectangular parts
1873of the source image at arbitrary positions (i.e. not aligned to a matrix) are
1874substituted by matching images.")
1875 (license license:gpl2))))
1876
1877(define-public scantailor-advanced
1878 (let ((commit "3d1e74e6ace413733511086934a66f4e3f7a6027"))
1879 (package
1880 (name "scantailor-advanced")
1881 (version (string-append "1.0.16-" (string-take commit 7)))
1882 (source
1883 (origin
1884 (method git-fetch)
1885 (uri (git-reference
1886 (url "https://github.com/4lex4/scantailor-advanced")
1887 (commit commit)))
1888 (file-name (git-file-name name version))
1889 (sha256
1890 (base32
1891 "0kixwjb2x457dq7927hkh34c803p7yh1pmn6n61rk9shqrcg492h"))))
1892 (build-system qt-build-system)
1893 (arguments
1894 (list
1895 #:phases
1896 #~(modify-phases %standard-phases
1897 ;; Some tests require a display and fail with offscreen mode.
1898 (add-after 'unpack 'disable-failing-tests
1899 (lambda _
1900 (setenv "ARGS" "--exclude-regex \"imageproc_.*\""))))))
1901 (native-inputs
1902 (list qttools-5))
1903 (inputs
1904 (list boost
1905 libjpeg-turbo
1906 libpng
1907 libtiff
1908 qtbase-5
1909 qtsvg-5
1910 qtwayland-5
1911 zlib))
1912 (home-page "https://github.com/4lex4/scantailor-advanced")
1913 (synopsis "Clean up scanned pages")
1914 (description "Scan Tailor is an interactive post-processing tool for
1915scanned pages. It performs operations such as page splitting, deskewing,
1916adding/removing borders, and others. You give it raw scans, and you get pages
1917ready to be printed or assembled into a PDF or DJVU file. Scanning, optical
1918character recognition, and assembling multi-page documents are out of scope of
1919this project.
1920
1921Scan Tailer Advanced is a fork of Scan Tailer that merges Scan Tailor Featured
1922and Scan Tailor Enhanced versions as well as including many more bug fixes.")
1923 (license license:gpl3+))))
1924
1925(define-public simpleitk
1926 (package
1927 (name "simpleitk")
1928 (version "2.5.4")
1929 (source
1930 (origin
1931 (method git-fetch)
1932 (uri (git-reference
1933 (url "https://github.com/SimpleITK/SimpleITK")
1934 (commit (string-append "v" version))))
1935 (file-name (git-file-name name version))
1936 (sha256
1937 (base32 "1bzj5naqbgv2b31iqgz7qqk9rixsvjqycjz6l7w3gm7v1aj14jpb"))
1938 (patches
1939 (search-patches "simpleitk-r-4.6.0.patch"))))
1940 (build-system cmake-build-system)
1941 (outputs '("out" "python" "r"))
1942 (arguments
1943 (list
1944 #:configure-flags
1945 #~(list "-DBUILD_SHARED_LIBS=ON"
1946 "-DWRAP_LUA=OFF"
1947 "-DWRAP_PYTHON=ON"
1948 "-DWRAP_R=ON"
1949 "-DSimpleITK_USE_ELASTIX=ON"
1950 "-DSimpleITK_PYTHON_USE_VIRTUALENV=OFF")
1951 #:phases
1952 #~(modify-phases %standard-phases
1953 (add-after 'unpack 'early-GTest-discovery
1954 (lambda _
1955 ;; Find GTest before targets link to 'GTest::GTest'.
1956 (substitute* "Testing/Unit/CMakeLists.txt"
1957 (("add_subdirectory\\(TestBase\\)" anchor)
1958 (string-append "find_package(GTest REQUIRED)\n" anchor)))))
1959 (add-after 'unpack 'extract-test-data
1960 (lambda _
1961 (invoke "tar" "xvf"
1962 #$(this-package-native-input
1963 (string-append "SimpleITKData-" version ".tar.gz"))
1964 "--strip-components=1")))
1965 (add-after 'unpack 'fix-runpath
1966 (lambda _
1967 ;; The SWIG-generated shared libraries do not have SimpleITK's
1968 ;; libraries in their RUNPATH.
1969 (define (cmake-snippet start)
1970 (string-append
1971 start
1972 "set_target_properties(${SWIG_MODULE_SimpleITK_TARGET_NAME} "
1973 "PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE "
1974 "INSTALL_RPATH \"" #$output "/lib\")\n"))
1975 (substitute* "Wrapping/Python/CMakeLists.txt"
1976 (("^set\\(SWIG_MODULE_SimpleITKPython.*" anchor)
1977 (cmake-snippet anchor)))
1978 (substitute* "Wrapping/R/CMakeLists.txt"
1979 (("^set\\(SWIG_MODULE_SimpleITKR.*" anchor)
1980 (cmake-snippet anchor)))))
1981 (add-after 'unpack 'patch-cmake-config-itk-path
1982 (lambda _
1983 ;; Allow building SimpleITK C++ projects without ITK installed
1984 ;; in the profile.
1985 #$(let*
1986 ((itk (this-package-input "insight-toolkit"))
1987 (itk-version (package-version itk))
1988 (itk-version-major+minor
1989 (version-major+minor itk-version)))
1990 #~(substitute* "SimpleITKConfig.cmake.in"
1991 (((string-append
1992 "find_package\\(ITK \"@ITK_VERSION@\" "
1993 "EXACT REQUIRED\\)"))
1994 (string-append
1995 "find_package(ITK \"" #$itk-version
1996 "\" EXACT REQUIRED PATHS " #$itk
1997 "/lib/cmake/ITK-"
1998 #$itk-version-major+minor ")"))))))
1999 ;; It is not clear why this test fails.
2000 (add-after 'unpack 'skip-one-elastix-test
2001 (lambda _
2002 (substitute* "Testing/Unit/sitkElastixImageFilterTests.cxx"
2003 (("TEST\\(ElastixImageFilter, DefaultParameterMaps\\)")
2004 "TEST(ElastixImageFilter, DISABLED_DefaultParameterMaps)"))))
2005 (add-after 'install 'install-language-extension-modules
2006 (lambda _
2007 (with-directory-excursion "Wrapping/Python"
2008 (invoke "python3" "setup.py" "bdist_wheel")
2009 (apply invoke "pip" "--no-cache-dir" "--no-input" "install"
2010 "--no-deps" "--prefix" #$output:python
2011 (find-files "dist" "\\.whl$")))
2012 (let ((r-package-path
2013 (string-append #$output:r "/site-library/SimpleITK")))
2014 (mkdir-p r-package-path)
2015 (copy-recursively "Wrapping/R/R_libs/SimpleITK"
2016 r-package-path))))
2017 (delete 'check)
2018 (add-after 'install 'check-after-install
2019 ;; Run the tests when the SimpleITK libraries are where the
2020 ;; language extension modules expect them to be.
2021 (assoc-ref %standard-phases 'check)))))
2022 (home-page "https://simpleitk.org")
2023 (inputs (list elastix insight-toolkit python r-minimal))
2024 (native-inputs
2025 (list googletest
2026 lua
2027 nss-certs-for-test ;for 'pip install'
2028 python-numpy ;for tests
2029 python-pip
2030 python-setuptools
2031 swig-4.4
2032 (origin
2033 (method url-fetch)
2034 (uri (string-append
2035 "https://github.com/SimpleITK/SimpleITK/releases/download/v"
2036 version "/SimpleITKData-" version ".tar.gz"))
2037 (sha256
2038 (base32
2039 "0hryvi9fgqac00ng1bfhw3lm0al1dh0ka6jglba2q368nls428nx")))))
2040 (synopsis "Simplified interface to @acronym{ITK, Insight Toolkit}")
2041 (description
2042 "SimpleITK is an image analysis toolkit built on top of @acronym{ITK,
2043Insight Toolkit}. It provides a simplified interface to most of the
2044image filters and the input/output and registration frameworks in
2045@acronym{ITK, Insight Toolkit}. It is written in C++ and provides
2046bindings for interpreted languages. This package includes the C++,
2047Python and R interfaces.")
2048 (license license:asl2.0)))
2049
2050(define-public python-imgviz
2051 (package
2052 (name "python-imgviz")
2053 (version "1.7.6")
2054 (source
2055 (origin
2056 ;; PyPi tarball lacks tests.
2057 (method git-fetch)
2058 (uri (git-reference
2059 (url "https://github.com/wkentaro/imgviz")
2060 (commit (string-append "v" version))))
2061 (file-name (git-file-name name version))
2062 (sha256
2063 (base32 "0z7nwnvqh3hbbccf7v56398aiiwqs68kyrgc5vsmmh1cp4pwrgnb"))))
2064 (build-system pyproject-build-system)
2065 (native-inputs
2066 (list python-pytest
2067 python-hatchling
2068 python-hatch-vcs
2069 python-hatch-fancy-pypi-readme))
2070 (propagated-inputs
2071 (list python-matplotlib
2072 python-numpy
2073 python-pillow
2074 python-pyyaml))
2075 (home-page "http://github.com/wkentaro/imgviz")
2076 (synopsis "Image Visualization Tools")
2077 (description "Python library for object detection, semantic and instance
2078segmentation.")
2079 (license license:expat)))
2080
2081(define-public python-pims
2082 (package
2083 (name "python-pims")
2084 (version "0.7")
2085 (source
2086 (origin
2087 (method url-fetch)
2088 (uri (pypi-uri "pims" version))
2089 (sha256
2090 (base32 "0swlh8g4kf8p24g0ghkmwcj9y45rc59lmqx459nhhmhj6167m42m"))))
2091 (build-system pyproject-build-system)
2092 (arguments
2093 (list
2094 #:test-flags
2095 ;; We don't have all the (sometimes very large) data files, so we skip
2096 ;; these tests.
2097 '(list "--ignore=pims/tests/test_common.py"
2098 "--ignore=pims/tests/test_imseq.py"
2099 "--ignore=pims/tests/test_norpix.py")
2100 #:phases
2101 #~(modify-phases %standard-phases
2102 (add-after 'unpack 'relax-requirements
2103 (lambda _
2104 (substitute* "setup.py"
2105 (("'slicerator>=.*',")
2106 "'slicerator',")))))))
2107 (native-inputs
2108 (list python-pytest python-setuptools))
2109 (propagated-inputs
2110 (list python-imageio python-numpy python-slicerator))
2111 (home-page "https://github.com/soft-matter/pims")
2112 (synopsis "Python Image Sequence")
2113 (description "Scientific video can be packaged in various ways: familiar
2114video formats like @file{.AVI} and @file{.MOV}, folders full of numbered
2115images, or \"stacks\" of TIFF images. Each of these requires a separate
2116Python module. And, once loaded, they have different methods for accessing
2117individual images, looping through the images in bulk, accessing a specific
2118range, or dealing with multidimensional files. PIMS can do all of these using
2119a consistent interface, handling the differences between different inputs
2120invisibly.")
2121 (license license:bsd-3)))
2122
2123(define-public python-spatial-image
2124 (package
2125 (name "python-spatial-image")
2126 (version "1.0.0")
2127 (source
2128 (origin
2129 (method url-fetch)
2130 (uri (pypi-uri "spatial_image" version))
2131 (sha256
2132 (base32 "0blyjwgv6bqpg7r3f4dcs7x27ysfm8n9y0zk5j7dxj74lma3wdsm"))))
2133 (build-system pyproject-build-system)
2134 (propagated-inputs (list python-numpy python-pytest python-pytest-mypy
2135 python-xarray python-xarray-dataclasses))
2136 (native-inputs (list python-flit-core python-pytest))
2137 (home-page "https://github.com/spatial-image/spatial-image")
2138 (synopsis "Multi-dimensional spatial image data structure")
2139 (description "This package implements a multi-dimensional spatial image
2140data structure for scientific Python.
2141
2142To facilitate:
2143
2144@itemize
2145@item Multi-scale processing and analysis
2146@item Registration
2147@item Resampling
2148@item Subregion parallel processing
2149@item Coupling with meshes, point sets, and annotations
2150@end itemize
2151
2152with scientific images, which are typically multi-dimensional with anisotropic
2153sampling, this package provides a spatial-image data structure. In addition
2154to an N-dimensional array of pixel values, spatial metadata defines the
2155location of the pixel sampling grid in space time. It also labels the array
2156dimensions. This metadata is easily utilized and carried through image
2157processing pipelines.")
2158 (license license:expat)))
2159
2160(define-public labelme
2161 (package
2162 (name "labelme")
2163 ;; It's the latest available version which does not require not packaged
2164 ;; <https://github.com/wkentaro/osam>.
2165 (version "5.2.1")
2166 (source
2167 (origin
2168 ;; PyPi tarball lacks tests.
2169 (method git-fetch)
2170 (uri (git-reference
2171 (url "https://github.com/wkentaro/labelme")
2172 (commit (string-append "v" version))))
2173 (file-name (git-file-name name version))
2174 (sha256
2175 (base32 "1xpyad6rlkxyx51jaai4xhdy15k1gvm62xnkjn152hc1vj1c77sr"))))
2176 (build-system pyproject-build-system)
2177 (arguments
2178 (list
2179 #:test-flags
2180 #~(list "-m" "not gpu"
2181 ;; Fails when invoking help2man for unknown reason.
2182 "--ignore=tests/docs_tests/man_tests/test_labelme_1.py")
2183 #:phases
2184 #~(modify-phases %standard-phases
2185 (add-before 'check 'start-xserver
2186 (lambda* (#:key inputs #:allow-other-keys)
2187 (let ((xorg-server #$(this-package-native-input "xorg-server")))
2188 ;; Options taken from CI workflow.
2189 (system (string-append xorg-server "/bin/Xvfb :99 -screen 0 "
2190 "1920x1200x24 -ac +extension GLX +render "
2191 "-noreset &"))
2192 (setenv "DISPLAY" ":99.0")))))))
2193 (native-inputs
2194 (list python-pytest
2195 python-pytest-qt
2196 python-setuptools
2197 xorg-server-for-tests))
2198 (propagated-inputs
2199 (list python-imgviz
2200 python-matplotlib
2201 python-natsort
2202 python-numpy
2203 python-pillow
2204 python-pyqt
2205 python-pyyaml
2206 python-qtpy
2207 python-termcolor))
2208 (home-page "https://github.com/wkentaro/labelme")
2209 (synopsis "Image Polygonal Annotation")
2210 (description
2211 "Image and video labeling tool supporting different shapes like polygons,
2212rectangles, circles, lines, points and VOC/COCO export.")
2213 (license license:gpl3+)))
2214
2215(define-public charls
2216 (package
2217 (name "charls")
2218 (version "2.4.2")
2219 (source (origin
2220 (method git-fetch)
2221 (uri (git-reference
2222 (url "https://github.com/team-charls/charls/")
2223 (commit (string-append version))))
2224 (file-name (git-file-name name version))
2225 (sha256
2226 (base32
2227 "0vp6mjjm6hi2r1swwvbg86asvn604w58nam7yvqk1qr13aizjl71"))))
2228 (build-system cmake-build-system)
2229 (arguments
2230 `(#:configure-flags '("-DCMAKE_BUILD_TYPE:STRING=Release"
2231 "-DBUILD_SHARED_LIBS=On")))
2232 (native-inputs (list git pkg-config))
2233 (home-page "https://github.com/team-charls/charls")
2234 (synopsis "Library for using JPEG-LS compliant images")
2235 (description
2236 "CharLS is a codec library that can be used to build applications that
2237can handle JPEG-LS compliant images. In the application you are writing you
2238can call the CharLS codec and pass it images (sometimes called raster bitmaps),
2239 to have them encoded to JPEG-LS, or JPEG-LS streams, which CharLS will decode
2240to images.")
2241 (license license:bsd-3)))
2242
2243(define-public libansilove
2244 (package
2245 (name "libansilove")
2246 (version "1.4.1")
2247 (source (origin
2248 (method git-fetch)
2249 (uri (git-reference
2250 (url "https://github.com/ansilove/libansilove")
2251 (commit (string-append version))))
2252 (file-name (git-file-name name version))
2253 (sha256
2254 (base32
2255 "169njlck4a2bmf1kmjas1w594hyda543ykdnwg7fwkviij39l9z6"))))
2256 (build-system cmake-build-system)
2257 (arguments
2258 (list #:tests? #f)) ; No tests included
2259 (native-inputs
2260 (list gd))
2261 (home-page "https://www.ansilove.org/")
2262 (synopsis "Library for converting ANSI, ASCII, and other formats to PNG")
2263 (description
2264 "libansilove is a library for converting artscene file types to PNG images,
2265including ANSI (.ANS) and many others. The library primarily serves to support
2266the ansilove tool.")
2267 (license license:bsd-2)))
2268
2269(define-public ansilove
2270 (package
2271 (name "ansilove")
2272 (version "4.2.0")
2273 (source (origin
2274 (method git-fetch)
2275 (uri (git-reference
2276 (url "https://github.com/ansilove/ansilove")
2277 (commit (string-append version))))
2278 (file-name (git-file-name name version))
2279 (sha256
2280 (base32
2281 "1h9r759krjl8wi68yxs1d46qfrx6v89a8vmmv3aqym8vn9x430kh"))))
2282 (build-system cmake-build-system)
2283 (native-inputs
2284 (list libansilove))
2285 (home-page "https://www.ansilove.org/")
2286 (synopsis "ANSI and ASCII art to PNG converter")
2287 (description
2288 "AnsiLove is an ANSI and ASCII art to PNG converter, allowing to convert
2289ANSI and artscene-related file formats into PNG images, supporting ANSI (.ANS),
2290PCBoard (.PCB), Binary (.BIN), Artworx (.ADF), iCE Draw (.IDF), Tundra (.TND)
2291and XBin (.XB) formats.")
2292 (license license:bsd-2)))