projects/guix·blob perlssl · refs

2290 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-9.3
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 "3.7.4")
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 "1pwa76ad5m5c3i4d3kxwd6g68fqpb5qzhb89hgkcicr6gckfbw7r"))))
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 "-DGMIC_QT_HOST=none"
978 "-DENABLE_DYNAMIC_LINKING=ON"))
979 ((#:phases phases '%standard-phases)
980 #~(modify-phases #$phases
981 (add-after 'unpack 'qt-chdir
982 (lambda _ (chdir "gmic-qt")))))))
983 (native-inputs
984 (list pkg-config qttools-5))
985 (inputs
986 (modify-inputs inputs
987 (prepend gmic qtbase-5)))
988 (synopsis "Qt frontend for the G'MIC image processing framework")
989 (license license:gpl3+)))
990
991(define-public gmic-qt-gimp
992 (package
993 (inherit gmic-qt)
994 (name "gmic-qt-gimp")
995 (inputs
996 ;; GIMP and its dependencies.
997 (modify-inputs inputs
998 (prepend gexiv2-0.14 gdk-pixbuf gegl gimp pango)))
999 (arguments
1000 (substitute-keyword-arguments arguments
1001 ((#:configure-flags flags)
1002 #~(list "-DGMIC_QT_HOST=gimp3"
1003 "-DENABLE_DYNAMIC_LINKING=ON"))))
1004 (synopsis "GIMP plugin for the G'MIC image processing framework")))
1005
1006(define-public nip2
1007 (package
1008 (name "nip2")
1009 (version "8.9.1")
1010 (source
1011 (origin
1012 (method url-fetch)
1013 (uri (string-append "https://github.com/libvips/nip2/releases/download/v"
1014 version "/nip2-" version ".tar.gz" ))
1015 (sha256
1016 (base32 "1kbndn37m0cfjvrvw25b5if9d962r8v79q78i2lzm55r7zmjcpmp"))))
1017 (build-system gnu-build-system)
1018 (arguments
1019 `(#:phases
1020 (modify-phases %standard-phases
1021 (add-before 'check 'set-home
1022 (lambda _
1023 (setenv "HOME" "/tmp"))))))
1024 (inputs (list gsl gtk+-2 vips))
1025 (native-inputs (list bison flex pkg-config))
1026 (home-page "https://github.com/libvips/nip2")
1027 (synopsis "Spreadsheet-like GUI for libvips")
1028 (description "This package provide a graphical user interface (GUI) for
1029the VIPS image processing library. It's a little like a spreadsheet: you
1030create a set of formula connecting your objects together, and on a change nip2
1031recalculates.")
1032 (license license:gpl2+)))
1033
1034(define-public paraview
1035 (package
1036 (name "paraview")
1037 (version "6.0.0")
1038 (source
1039 (origin
1040 (method git-fetch)
1041 (uri (git-reference
1042 (url "https://gitlab.kitware.com/paraview/paraview")
1043 (commit (string-append "v" version))
1044 (recursive? #t)))
1045 (file-name (git-file-name name version))
1046 (sha256
1047 (base32 "1m1c7vngrpaqdqvnjx4wj0va20hih5rb7rf0a44mp3wqgp4wgy0f"))
1048 (modules '((guix build utils)))
1049 (snippet
1050 ;; TODO: Also remove unused bundled libraries and plugins?
1051 #~(begin
1052 ;; Remove bundled ParaView libraries which are available in Guix
1053 ;; or undesired.
1054 (for-each (lambda (dir)
1055 (delete-file-recursively
1056 (string-append "ThirdParty/" dir "/vtk"
1057 (string-downcase dir))))
1058 '(;;"CosmoHaloFinder"
1059 ;;"IceT"
1060 "NvPipe" ; Don't want NvPipe support
1061 ;;"QtTesting"
1062 ;;"cinema"
1063 ;;"cinemasci"
1064 "protobuf"))
1065 ;; Remove undesired ParaView plugins.
1066 (delete-file-recursively "Plugins/pvNVIDIAIndeX")
1067 ;; Remove bundled VTK libraries which are available in Guix.
1068 (for-each (lambda (dir)
1069 (delete-file-recursively
1070 (string-append "VTK/ThirdParty/" dir "/vtk" dir)))
1071 '("cgns"
1072 "cli11"
1073 ;;"diy2"
1074 "doubleconversion"
1075 "eigen"
1076 ;;"exodusII"
1077 "expat"
1078 ;;"exprtk"
1079 ;;"fast-float"
1080 ;;"fides"
1081 "fmt"
1082 "freetype"
1083 "gl2ps"
1084 ;;"glad"
1085 ;;"h5part"
1086 "hdf5"
1087 ;;"ioss"
1088 "jpeg"
1089 "jsoncpp"
1090 ;;"kissfft"
1091 ;;"libharu" ; Requires some PRs applied to 2.3.0
1092 "libproj"
1093 "libxml2"
1094 ;;"loguru"
1095 "lz4"
1096 "lzma"
1097 "mpi4py"
1098 "netcdf"
1099 "nlohmannjson"
1100 "ogg"
1101 ;;"pegtl"
1102 "png"
1103 "pugixml"
1104 "sqlite"
1105 "theora"
1106 "tiff"
1107 ;;"token"
1108 "utf8"
1109 ;;"verdict"
1110 ;;"viskores"
1111 ;;"vpic"
1112 ;;"vtkm"
1113 ;;"xdmf2"
1114 ;;"xdmf3"
1115 "zlib"))))))
1116 (build-system qt-build-system)
1117 (arguments
1118 (list
1119 #:qtbase qtbase
1120 #:build-type "Release" ; 542 MiB in release mode
1121 #:tests? #f ; Downloads test data
1122 #:configure-flags
1123 #~(let ((doc (string-append "share/doc/" #$name "-" #$version)))
1124 (list
1125 (string-append "-DCMAKE_INSTALL_DOCDIR=" doc) ; For paraview.qch
1126
1127 ;; ParaView build options
1128 "-DPARAVIEW_BUILD_DEVELOPER_DOCUMENTATION=ON"
1129 (string-append "-DPARAVIEW_GENERATED_DOCUMENTATION_OUTPUT_DIRECTORY=" doc)
1130
1131 ;; ParaView capability options
1132 ;;"-DPARAVIEW_USE_EXTERNAL_VTK=ON" ; Unsupported by ParaView
1133 "-DPARAVIEW_USE_MPI=ON"
1134 "-DPARAVIEW_USE_PYTHON=ON"
1135 "-DPARAVIEW_USE_QTWEBENGINE=ON"
1136
1137 ;; ParaView features
1138 ;;
1139 ;; Enable those that are disabled by default.
1140 ;; Commented means the dependencies are missing from Guix
1141 ;; (or are otherwise described).
1142 ;;"-DPARAVIEW_ENABLE_ADIOS2=ON"
1143 ;;"-DPARAVIEW_ENABLE_COSMOTOOLS=ON"
1144 ;;"-DPARAVIEW_ENABLE_CATALYST=ON"
1145 "-DPARAVIEW_ENABLE_FFMPEG=ON"
1146 ;;"-DPARAVIEW_ENABLE_FIDES=ON"
1147 "-DPARAVIEW_ENABLE_GDAL=ON"
1148 ;;"-DPARAVIEW_ENABLE_LAS=ON"
1149 ;;"-DPARAVIEW_ENABLE_LOOKINGGLASS=ON" ; Downloads dependency
1150 ;;"-DPARAVIEW_ENABLE_MOMENTINVARIANTS=ON" ; Downloads dependency
1151 "-DPARAVIEW_ENABLE_MOTIONFX=ON"
1152 ;;"-DPARAVIEW_ENABLE_OPENTURNS=ON"
1153 ;;"-DPARAVIEW_ENABLE_OPENVDB=ON" ; Dependency not found
1154 ;;"-DPARAVIEW_ENABLE_PDAL=ON"
1155 ;;"-DPARAVIEW_ENABLE_RAYTRACING=ON"
1156 "-DPARAVIEW_ENABLE_VISITBRIDGE=ON"
1157 "-DPARAVIEW_ENABLE_XDMF3=ON"
1158
1159 ;; ParaView miscellaneous options
1160 ;;
1161 ;; Without -DPARAVIEW_DATA_EXCLUDE_FROM_ALL=OFF, test data is
1162 ;; downloaded even with tests disabled.
1163 "-DPARAVIEW_VERSIONED_INSTALL=OFF"
1164 "-DPARAVIEW_DATA_EXCLUDE_FROM_ALL=OFF"
1165
1166 ;; ParaView plugins
1167 ;;
1168 ;; Enable those that are disabled by default.
1169 ;; Commented means the dependencies are missing from Guix
1170 ;; (or are otherwise described).
1171 ;;"-DPARAVIEW_PLUGIN_ENABLE_AdiosReaderPixie=ON"
1172 ;;"-DPARAVIEW_PLUGIN_ENABLE_AdiosReaderStaging=ON"
1173 "-DPARAVIEW_PLUGIN_ENABLE_CAVEInteraction=ON"
1174 ;;"-DPARAVIEW_PLUGIN_ENABLE_CDIReader=ON"
1175 "-DPARAVIEW_PLUGIN_ENABLE_GeographicalMap=ON"
1176 "-DPARAVIEW_PLUGIN_ENABLE_GmshIO=ON"
1177 "-DPARAVIEW_PLUGIN_ENABLE_InSituExodus=ON"
1178 ;;"-DPARAVIEW_PLUGIN_ENABLE_LookingGlass=ON"
1179 "-DPARAVIEW_PLUGIN_ENABLE_NetCDFTimeAnnotationPlugin=ON"
1180 ;;"-DPARAVIEW_PLUGIN_ENABLE_ParFlow=ON" ; Build fails
1181 ;;"-DPARAVIEW_PLUGIN_ENABLE_PythonQtPlugin=ON"
1182 "-DPARAVIEW_PLUGIN_ENABLE_SpaceMouseInteractor=ON"
1183 ;;"-DPARAVIEW_PLUGIN_ENABLE_VDFReaderPlugin=ON"
1184 ;;"-DPARAVIEW_PLUGIN_ENABLE_XRInterface=ON" ; Build fails
1185 ;;"-DPARAVIEW_PLUGIN_ENABLE_zSpace=ON"
1186
1187 ;; VTK options
1188 "-DVTK_SMP_IMPLEMENTATION_TYPE=TBB"
1189 "-DVTKm_ENABLE_MPI=ON"
1190
1191 ;; External libraries for ParaView and VTK
1192 "-DVTK_MODULE_USE_EXTERNAL_ParaView_protobuf=ON"
1193 "-DVTK_MODULE_USE_EXTERNAL_VTK_cgns=ON"
1194 "-DVTK_MODULE_USE_EXTERNAL_VTK_cli11=ON"
1195 "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
1196 "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
1197 "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
1198 "-DVTK_MODULE_USE_EXTERNAL_VTK_fmt=ON"
1199 "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
1200 "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
1201 "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
1202 "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
1203 "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
1204 "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
1205 "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
1206 "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
1207 "-DVTK_MODULE_USE_EXTERNAL_VTK_lzma=ON"
1208 "-DVTK_MODULE_USE_EXTERNAL_VTK_mpi4py=ON"
1209 "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
1210 "-DVTK_MODULE_USE_EXTERNAL_VTK_nlohmannjson=ON"
1211 "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
1212 ;;"-DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=ON"
1213 "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
1214 "-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON"
1215 "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
1216 "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
1217 "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
1218 "-DVTK_MODULE_USE_EXTERNAL_VTK_utf8=ON"
1219 "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"))
1220 #:phases
1221 #~(modify-phases %standard-phases
1222 (add-after 'set-paths 'hide-gfortran
1223 (lambda _
1224 (setenv "CPLUS_INCLUDE_PATH"
1225 (string-join
1226 (delete (string-append #$(this-package-native-input "gfortran")
1227 "/include/c++")
1228 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
1229 ":"))))
1230 (replace 'install-license-files
1231 (lambda _
1232 (let ((src (string-append #$output "/share/licenses/ParaView"))
1233 (dst (string-append #$output "/share/doc/"
1234 #$name "-" #$version "/licenses")))
1235 (copy-recursively src dst)
1236 (delete-file-recursively (dirname src))))))))
1237 (native-inputs
1238 (list gfortran
1239 ;; For the documentation
1240 doxygen
1241 graphviz
1242 perl
1243 python-sphinx))
1244 (inputs
1245 (list boost
1246 cgns
1247 cli11
1248 curl
1249 double-conversion
1250 eigen
1251 expat
1252 ffmpeg
1253 fmt-11
1254 freetype
1255 gdal
1256 gl2ps
1257 gmsh
1258 hdf5
1259 nlohmann-json ;For ParFlow; build fails
1260 jsoncpp
1261 libjpeg-turbo
1262 libogg
1263 libpng
1264 libtheora
1265 libtiff
1266 libxcursor
1267 libxml2
1268 libxslt
1269 libxt
1270 lz4
1271 lzip
1272 mesa
1273 netcdf
1274 openmpi
1275 ;;openvdb ;For OpenVDB; dependency not found
1276 ;;openvr ;For XRInterface; build fails
1277 ;;pegtl ;For VTK; build fails
1278 proj
1279 protobuf
1280 pugixml
1281 python-cftime
1282 python-matplotlib
1283 python-mpi4py
1284 python-numpy
1285 python-wrapper
1286 qt5compat
1287 qtdeclarative
1288 qtmultimedia
1289 qtsvg
1290 qttools
1291 qtwebchannel
1292 qtwebengine
1293 sdl2
1294 sqlite
1295 onetbb
1296 utfcpp
1297 zlib))
1298 (home-page "https://www.paraview.org/")
1299 (synopsis "VTK-based, parallel data analyzer and visualizer")
1300 (description "ParaView is a VTK-based, parallel data analyzer and
1301visualizer which allows exploring data interactively in 3D or
1302programmatically.")
1303 (license license:bsd-3)))
1304
1305(define-public vxl
1306 (package
1307 (name "vxl")
1308 (version "3.5.0")
1309 (source
1310 (origin
1311 (method git-fetch)
1312 (uri (git-reference
1313 (url "https://github.com/vxl/vxl")
1314 (commit (string-append "v" version))))
1315 (file-name (git-file-name name version))
1316 (sha256
1317 (base32 "0iqq4lm51l5gvkax6r79ypifqmgir3p3vman9gsc2085d2agjvbs"))
1318 (modules '((guix build utils)))
1319 ;; TODO: vxl includes an old version of dcmtk. It won't build with
1320 ;; version 3.6.x.
1321 (snippet
1322 '(begin
1323 (for-each delete-file-recursively
1324 '("v3p/bzlib/"
1325 "v3p/geotiff/"
1326 "v3p/jpeg/"
1327 "v3p/png/"
1328 "v3p/tiff/"
1329 "v3p/zlib/"))
1330 (substitute* "v3p/CMakeLists.txt"
1331 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
1332 ""))
1333 #t))))
1334 (build-system cmake-build-system)
1335 (arguments
1336 ;; Not an actual test, but is incorrectly generated by the build system.
1337 (list #:test-exclude "vul_vul_test_driver"))
1338 (inputs
1339 (list libgeotiff libtiff libjpeg-turbo libpng zlib))
1340 (home-page "https://github.com/vxl/vxl/")
1341 (synopsis "Collection of C++ libraries for computer vision")
1342 (description "VXL (the Vision-something-Libraries) is a collection of C++
1343libraries designed for computer vision research and implementation.")
1344 (license license:bsd-3)))
1345
1346(define-public vxl-1
1347 (package (inherit vxl)
1348 (name "vxl")
1349 (version "1.18.0")
1350 (source
1351 (origin
1352 (method git-fetch)
1353 (uri (git-reference
1354 (url "https://github.com/vxl/vxl")
1355 (commit (string-append "v" version))))
1356 (file-name (git-file-name name version))
1357 (sha256
1358 (base32 "1g4mr2cc58jwm0vasscbd4y5380wj3ahkvq121z4gs83fhavvxgz"))
1359 (modules '((guix build utils)))
1360 (snippet
1361 '(begin
1362 (for-each delete-file-recursively
1363 '("v3p/bzlib/"
1364 "v3p/geotiff/"
1365 "v3p/png/"
1366 "v3p/tiff/"
1367 "v3p/zlib/"))
1368 (substitute* "v3p/CMakeLists.txt"
1369 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
1370 ""))))))
1371 (arguments
1372 (substitute-keyword-arguments arguments
1373 ((#:configure-flags flags)
1374 #~(cons* ;; Needed for itk-snap
1375 "-DVNL_CONFIG_LEGACY_METHODS=ON"
1376 "-DCMAKE_CXX_STANDARD=14"
1377 #$flags))))))
1378
1379(define-public insight-toolkit
1380 ;; For information about ITK remote modules, see:
1381 ;; https://insightsoftwareconsortium.github.io/ITKWikiArchive/Wiki/ITK/Policy_and_Procedures_for_Adding_Remote_Modules
1382 ;; For a remote MODULE, use the commit in
1383 ;; 'Modules/Remote/MODULE.remote.cmake'.
1384 ;; MorphologicalContourInterpolation is required by itk-snap.
1385 ;; SimpleITKFilters and GenericLabelInterpolator are required by simpleitk.
1386 ;; GenericLabelInterpolator and AdaptiveDenoising are required by ants.
1387 (let* ((module-mci-commit "821bf9b3ef8eaaab10391ed060dc9ca5e4d37b39")
1388 (module-mci-file (git-file-name "ITKMorphologicalContourInterpolation"
1389 module-mci-commit))
1390 (module-sitkf-commit "bb896868fc6480835495d0da4356d5db009592a6")
1391 (module-sitkf-file (git-file-name "ITKSimpleITKFilters"
1392 module-sitkf-commit))
1393 (module-gli-commit "ebf2436469ccf82c08fab54b7446f699ad0eae01")
1394 (module-gli-file (git-file-name "ITKGenericLabelInterpolator"
1395 module-gli-commit))
1396 (module-ad-commit "853934c352f83cb1e8f87e3051e1b8e75dbb41fe")
1397 (module-ad-file (git-file-name "ITKAdaptiveDenoising"
1398 module-ad-commit)))
1399 (package
1400 (name "insight-toolkit")
1401 (version "5.4.5")
1402 (source
1403 (origin
1404 (method git-fetch)
1405 (uri (git-reference
1406 (url "https://github.com/InsightSoftwareConsortium/ITK")
1407 (commit (string-append "v" version))))
1408 (file-name (git-file-name name version))
1409 (sha256
1410 (base32 "0sd037pgsdfigc5gi4lr5iwm063s0wrjl8i4b8dfxmrbipxjvn33"))
1411 ;; This patch is required to build with both ITK_USE_GPU=ON and
1412 ;; ITK_WRAP_PYTHON=ON.
1413 ;; <https://github.com/InsightSoftwareConsortium/ITK/pull/4842>
1414 (patches (search-patches "insight-toolkit-fix-build.patch"))))
1415 (build-system cmake-build-system)
1416 (outputs '("out" "python"))
1417 (arguments
1418 (list
1419 #:imported-modules (append %cmake-build-system-modules
1420 %pyproject-build-system-modules)
1421 #:modules '(((guix build pyproject-build-system) #:prefix py:)
1422 (guix build cmake-build-system)
1423 (guix build utils))
1424 #:configure-flags
1425 #~(list "-DITK_USE_GPU=ON"
1426 "-DITK_USE_SYSTEM_LIBRARIES=ON"
1427 "-DITK_USE_SYSTEM_CASTXML=ON"
1428 "-DITK_USE_SYSTEM_SWIG=ON"
1429 (string-append "-DHDF5_DIR="
1430 #$(this-package-input "hdf5") "/lib/cmake")
1431 "-DBUILD_SHARED_LIBS=ON"
1432 ;; Without this flag, there are shared libraries installed
1433 ;; in PY_SITE_PACKAGES_PATH/itk instead of #$output/lib and
1434 ;; RUNPATHs contain the *build directory* of
1435 ;; PY_SITE_PACKAGES_PATH/itk.
1436 "-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON"
1437 "-DITK_WRAPPING=ON"
1438 "-DITK_WRAP_PYTHON=ON"
1439 "-DITK_DYNAMIC_LOADING=ON"
1440 (let* ((python-version
1441 #$(version-major+minor
1442 (package-version
1443 (this-package-input "python"))))
1444 (python-lib-path (string-append #$output:python
1445 "/lib/python"
1446 python-version
1447 "/site-packages")))
1448 (string-append "-DPY_SITE_PACKAGES_PATH="
1449 python-lib-path))
1450 ;; Python is not built with Py_LIMITED_API.
1451 "-DITK_USE_PYTHON_LIMITED_API=OFF"
1452 "-DModule_MorphologicalContourInterpolation=ON"
1453 "-DModule_SimpleITKFilters=ON"
1454 "-DModule_GenericLabelInterpolator=ON"
1455 "-DModule_AdaptiveDenoising:BOOL=ON"
1456 "-DModule_ITKReview:BOOL=ON"
1457 "-DCMAKE_CXX_STANDARD=17"
1458 "-DBUILD_TESTING=OFF")
1459
1460 #:phases
1461 #~(modify-phases %standard-phases
1462 (add-after 'unpack 'do-not-tune
1463 (lambda _
1464 (substitute* "CMake/ITKSetStandardCompilerFlags.cmake"
1465 (("-mtune=native")
1466 ""))))
1467 (add-after 'unpack 'exclude-gtest-target
1468 (lambda _
1469 ;; Prevent ITKGoogleTest from being added to
1470 ;; ITK_MODULES_ENABLED in the installed
1471 ;; ITKConfig.cmake, which in turn prevents
1472 ;; 'GTest::GTest' from being added to the
1473 ;; ITK_LIBRARIES variable. This is necessary
1474 ;; because projects that use ITK fail to configure
1475 ;; otherwise. Fixes
1476 ;; <https://codeberg.org/guix/guix/issues/776>.
1477 ;; <https://github.com/microsoft/vcpkg/pull/27187>
1478 (substitute* "Modules/ThirdParty/GoogleTest/itk-module.cmake"
1479 (("DEPENDS")
1480 "DEPENDS\n EXCLUDE_FROM_DEFAULT"))))
1481 (add-after 'unpack 'prepare-remote-modules
1482 (lambda _
1483 ;; ITK module MorphologicalContourInterpolation
1484 ;; is for ITK-SNAP.
1485 (symlink #$(this-package-native-input module-mci-file)
1486 "Modules/Remote/MorphologicalContourInterpolation")
1487 (delete-file
1488 (string-append
1489 "Modules/Remote/"
1490 "MorphologicalContourInterpolation.remote.cmake"))
1491 ;; ITK modules SimpleITKFilters and GenericLabelInterpolator
1492 ;; are for SimpleITK.
1493 (symlink #$(this-package-native-input module-sitkf-file)
1494 "Modules/Remote/SimpleITKFilters")
1495 (delete-file "Modules/Remote/SimpleITKFilters.remote.cmake")
1496 (symlink #$(this-package-native-input module-gli-file)
1497 "Modules/Remote/GenericLabelInterpolator")
1498 (delete-file
1499 "Modules/Remote/GenericLabelInterpolator.remote.cmake")
1500 (symlink #$(this-package-native-input module-ad-file)
1501 "Modules/Remote/AdaptiveDenoising")
1502 (delete-file
1503 "Modules/Remote/AdaptiveDenoising.remote.cmake")))
1504 (delete 'check) ;tests require network access and external data
1505 (add-after 'install 'python-sanity-check
1506 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1507 (when tests?
1508 (py:add-installed-pythonpath inputs outputs)
1509 (invoke "python3" "-c" "import itk")))))))
1510 (inputs (list eigen
1511 expat
1512 fftw
1513 fftwf
1514 hdf5
1515 libjpeg-turbo
1516 libpng
1517 libtiff
1518 opencl-headers
1519 opencl-icd-loader
1520 perl
1521 python
1522 onetbb
1523 vxl-1
1524 zlib-ng-compat))
1525 (native-inputs
1526 (list castxml
1527 git-minimal/pinned
1528 pkg-config
1529 python-numpy ;for phase 'python-sanity-check
1530 swig-4.4
1531 which
1532 (origin
1533 (method git-fetch)
1534 (uri
1535 (git-reference
1536 (url (string-append
1537 "https://github.com/KitwareMedical/"
1538 "ITKMorphologicalContourInterpolation"))
1539 (commit module-mci-commit)))
1540 (file-name module-mci-file)
1541 (sha256
1542 (base32
1543 "00myhgvlk3n062i8bnknz1d10zkv3jlvs7f4jnk24727gd4v2n4i")))
1544 (origin
1545 (method git-fetch)
1546 (uri (git-reference
1547 (url (string-append
1548 "https://github.com/InsightSoftwareConsortium/"
1549 "ITKSimpleITKFilters"))
1550 (commit module-sitkf-commit)))
1551 (file-name module-sitkf-file)
1552 (sha256
1553 (base32
1554 "13nys94wl4k77f89i8y1dm3y4pmgmw3rrc0la1rzl0vi9h1qixii")))
1555 (origin
1556 (method git-fetch)
1557 (uri (git-reference
1558 (url (string-append
1559 "https://github.com/InsightSoftwareConsortium/"
1560 "ITKGenericLabelInterpolator"))
1561 (commit module-gli-commit)))
1562 (file-name module-gli-file)
1563 (sha256
1564 (base32
1565 "1khakqh6pzdg6csli8jypzrhcdr9xmhnzgwz265krv8r5mbnndrg")))
1566 (origin
1567 (method git-fetch)
1568 (uri (git-reference
1569 (url "https://github.com/ntustison/ITKAdaptiveDenoising")
1570 (commit module-ad-commit)))
1571 (file-name module-ad-file)
1572 (sha256
1573 (base32
1574 "0aqvhb4byg0shgbrwmb41nq2h8sbg45xn0gsdy94iiq0v72bw307")))))
1575
1576 ;; The 'CMake/ITKSetStandardCompilerFlags.cmake' file normally sets
1577 ;; '-mtune=native -march=corei7', suggesting there's something to be
1578 ;; gained from CPU-specific optimizations.
1579 (properties '((tunable? . #t)))
1580
1581 (home-page "https://github.com/InsightSoftwareConsortium/ITK/")
1582 (synopsis "Scientific image processing, segmentation and registration")
1583 (description
1584 "The Insight Toolkit (ITK) is a toolkit for N-dimensional
1585scientific image processing, segmentation, and registration. Segmentation is
1586the process of identifying and classifying data found in a digitally sampled
1587representation. Typically the sampled representation is an image acquired
1588from such medical instrumentation as CT or MRI scanners. Registration is the
1589task of aligning or developing correspondences between data. For example, in
1590the medical environment, a CT scan may be aligned with a MRI scan in order to
1591combine the information contained in both.")
1592 (license license:asl2.0))))
1593
1594;; Provide variant of insight-toolkit (ITK) built with ITK_LEGACY_REMOVE=OFF.
1595;; ITK-SNAP version 4.2.2 and 4.4.0-alpha3 require ITK >= 5.4 and for ITK to
1596;; be built this way. Note that enabling Python wrapping forces this option
1597;; to ON, so Python wrapping is not enabled for this build.
1598(define-public insight-toolkit-legacy
1599 (hidden-package
1600 (package/inherit insight-toolkit
1601 ;; Unfortunately we cannot remove the 'python output because it is
1602 ;; referenced in #:configure-flags below.
1603 (name "insight-toolkit-legacy")
1604 (arguments
1605 (substitute-keyword-arguments (package-arguments insight-toolkit)
1606 ((#:configure-flags cf '())
1607 #~(filter (lambda (flag)
1608 (not (or
1609 ;; Remove these flags to restore the default
1610 ;; ITK_LEGACY_REMOVE=OFF.
1611 (string=? "-DITK_WRAPPING=ON" flag)
1612 (string=? "-DITK_WRAP_PYTHON=ON" flag)
1613 ;; These flags are now unused.
1614 (string-prefix? "-DPY_SITE_PACKAGES_PATH=" flag)
1615 (string-prefix? "-DITK_USE_PYTHON_LIMITED_API=" flag)
1616 (string-prefix? "-DITK_USE_SYSTEM_CASTXML=" flag)
1617 (string-prefix? "-DITK_USE_SYSTEM_SWIG=" flag))))
1618 #$cf))
1619 ((#:phases phases #~%standard-phases)
1620 #~(modify-phases #$phases
1621 (delete 'python-sanity-check)))))
1622 (inputs (modify-inputs inputs
1623 (delete "python")))
1624 (native-inputs (modify-inputs native-inputs
1625 (delete "castxml")
1626 (delete "python-numpy")
1627 (delete "swig"))))))
1628
1629(define-public itk-snap
1630 ;; No tag for version 4.4.0. This seems to be the commit.
1631 (let ((commit "20f631865372dc7d1f49a1e930d83131102f7a20")
1632 (revision "0"))
1633 (package
1634 (name "itk-snap")
1635 (version (git-version "4.4.0" revision commit))
1636 (source
1637 (origin
1638 (method git-fetch)
1639 (uri (git-reference
1640 (url "https://github.com/pyushkevich/itksnap")
1641 (commit commit)))
1642 (file-name (git-file-name name version))
1643 (sha256
1644 (base32 "0zfaiz5lc1fy0n48bwbjgw3yschmscmq9bh0ym05cpaf4sbr4p7l"))))
1645 (build-system cmake-build-system)
1646 (arguments
1647 (list
1648 #:configure-flags
1649 #~(list "-DSNAP_VERSION_GIT_BRANCH=release")
1650 #:phases
1651 #~(modify-phases %standard-phases
1652 ;; During the installation phase all libraries provided by all
1653 ;; dependencies will be copied to the lib directory. That's insane,
1654 ;; so we disable this.
1655 (add-after 'unpack 'do-not-copy-dependencies
1656 (lambda _
1657 (substitute* "CMakeLists.txt"
1658 (("install\\(SCRIPT \\$\\{deploy_script\\}\\)") ""))))
1659 (add-after 'unpack 'disable-gui-tests
1660 (lambda _
1661 ;; The GUI tests just segmentation fault.
1662 (substitute* "CMakeLists.txt"
1663 ((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
1664|RandomForest|RandomForestBailOut|NaNs|4DContinuousRenderingD|EdgeAttraction\
1665|EchoCartesianDicomLoading|LabelSmoothing|PreferencesDialog|MeshImport\
1666|MeshWorkspace|SegmentationMesh|VolumeRendering|Reloading|4DToMC|MCTo4D\
1667|DeformationGrid)")
1668 ""))))
1669 (add-after 'unpack 'prepare-submodules
1670 (lambda _
1671 ;; Copy submodule instead of symlink because it is patched in
1672 ;; 'make-reproducible phase.
1673 (copy-recursively #$(this-package-native-input "c3d-checkout")
1674 "Submodules/c3d")
1675 (rmdir "Submodules/digestible")
1676 (symlink #$(this-package-native-input "digestible-checkout")
1677 "Submodules/digestible")
1678 (copy-recursively #$(this-package-native-input "greedy-checkout")
1679 "Submodules/greedy")))
1680 (add-after 'unpack 'remove-bundled-jsoncpp
1681 (lambda _
1682 (substitute* "CMakeLists.txt"
1683 ((" Common/JSon/jsoncpp\\.cpp") ""))))
1684 (add-after 'prepare-submodules 'make-reproducible
1685 (lambda _
1686 (substitute* "CMakeLists.txt"
1687 (("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
1688 "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))
1689 (substitute* "Common/SNAPCommon.cxx.in"
1690 (("@CMAKE_HOST_SYSTEM@ @CMAKE_HOST_SYSTEM_PROCESSOR@")
1691 "(removed for reproducibility)"))
1692 (substitute* "Submodules/c3d/ConvertImageVersion.cxx.in"
1693 (("@CONVERT3D_VERSION_COMPILE_DATE@")
1694 "(removed for reproducibility)"))
1695 (substitute* "Submodules/greedy/src/GreedyVersion.cxx.in"
1696 (("@GREEDY_VERSION_COMPILE_DATE@")
1697 "(removed for reproducibility)"))))
1698 (add-before 'check 'prepare-tests
1699 (lambda _
1700 ;; Needed by at least one test.
1701 (setenv "HOME" "/tmp")))
1702 (add-after 'install 'wrap-executable
1703 (lambda _
1704 (wrap-program (string-append #$output "/bin/itksnap")
1705 (list
1706 "QT_PLUGIN_PATH"
1707 'suffix
1708 (list (string-append #$(this-package-input "qtbase")
1709 "/lib/qt6/plugins")
1710 (string-append #$(this-package-input "qtdeclarative")
1711 "/lib/qt6/plugins")
1712 (string-append #$(this-package-input "qtwayland")
1713 "/lib/qt6/plugins"))))
1714 ;; The application uses argv[0] to locate itself. The wrapper
1715 ;; generated by wrap-program uses 'exec -a "${0##*/}"' which sets
1716 ;; argv[0] to just "itksnap" without a path, causing "Error
1717 ;; locating executable" on startup. Remove the -a flag so
1718 ;; argv[0] contains the full path to .itksnap-real.
1719 (substitute* (string-append #$output "/bin/itksnap")
1720 (("exec -a \"\\$\\{0##\\*/\\}\" ")
1721 "exec ")))))))
1722 (inputs
1723 (list curl
1724 freetype
1725 glew
1726 glu
1727 insight-toolkit-legacy
1728 jsoncpp
1729 libssh
1730 mesa-opencl
1731 qtbase
1732 qtdeclarative
1733 qtwayland
1734 vtk-9.5))
1735 (native-inputs
1736 (list
1737 doxygen
1738 qttools
1739 ;; Use the submodule commits in this version of ITK-SNAP.
1740 (origin
1741 (method git-fetch)
1742 (uri (git-reference
1743 (url "https://github.com/pyushkevich/c3d")
1744 (commit "d4d963629d7dfdca4b0607907f0e91827c22ea2a")))
1745 (file-name "c3d-checkout")
1746 (sha256
1747 (base32 "15yh2rdynql99yy5hanq5rha1pry9c3ryb7bfy47vvyqksk0znvs")))
1748 (origin
1749 (method git-fetch)
1750 (uri (git-reference
1751 (url "https://github.com/pyushkevich/digestible")
1752 (commit "1b66709e99c43d280bb472e1a0e36185ef2ea412")))
1753 (file-name "digestible-checkout")
1754 (sha256
1755 (base32 "1m1b954prq6l3byfdgxw2y17xsg81agd516g5n6ps60dqnxw8hqs")))
1756 (origin
1757 (method git-fetch)
1758 (uri (git-reference
1759 (url "https://github.com/pyushkevich/greedy")
1760 (commit "2d5dfa1891ac726524495d4ca8a3461be86c12f5")))
1761 (file-name "greedy-checkout")
1762 (sha256
1763 (base32 "13rz423p7p95ca94c5njr8jxbcic1hp8iqap613zlxmvl4n9vx15")))))
1764 (home-page "https://sourceforge.net/p/itk-snap/")
1765 (synopsis "Medical image segmentation")
1766 (description "ITK-SNAP is a tool for segmenting anatomical structures in
1767medical images. It provides an automatic active contour segmentation
1768pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a
1769full-featured UI aimed at clinical researchers.")
1770 ;; This includes the submodules greedy, c3d and digestible.
1771 (license license:gpl3+))))
1772
1773(define-public elastix
1774 (package
1775 (name "elastix")
1776 (version "5.3.0")
1777 (source
1778 (origin
1779 (method git-fetch)
1780 (uri (git-reference
1781 (url "https://github.com/SuperElastix/elastix")
1782 (commit version)))
1783 (file-name (git-file-name name version))
1784 (sha256
1785 (base32 "0sgw4cz4x6f78n6iqn87ll6wad32y67lmzvqfdfw1pzjkxbwzwyr"))
1786 (patches
1787 (search-patches "elastix-1404.patch"))))
1788 (properties '((tunable? . #t)))
1789 (build-system cmake-build-system)
1790 (arguments
1791 (list
1792 #:configure-flags
1793 #~(list "-DELASTIX_USE_EIGEN=ON"
1794 "-DELASTIX_ENABLE_PACKAGER:BOOL=OFF"
1795 "-DELASTIX_BUILD_EXECUTABLE:BOOL=ON"
1796 "-DCMAKE_CXX_FLAGS=-fPIC"
1797 "-DCMAKE_CXX_STANDARD=17"
1798 "-DBUILD_TESTING:BOOL=ON")
1799 ;; These tests fail and are skipped in upstream CI.
1800 #:test-exclude (string-join
1801 (list "elastix_run_example_COMPARE_IM"
1802 (string-append "elastix_run_3DCT_lung.MI.bspline."
1803 "ASGD.001_COMPARE_TP"))
1804 "|")))
1805 (inputs (list charls
1806 dcmtk
1807 eigen
1808 fftw
1809 insight-toolkit
1810 libpng
1811 libtiff
1812 zlib))
1813 (home-page "https://elastix.dev/")
1814 (synopsis "Image registration toolbox")
1815 (description
1816 "Elastix is a toolbox for rigid and nonrigid registration of images. The
1817software consists of a collection of algorithms that are commonly used to
1818perform (medical) image registration: the task of finding a spatial
1819transformation, mapping one image (the fixed image) to another (the moving
1820image), by optimizing relevant image similarity metrics.")
1821 (license license:asl2.0)))
1822
1823(define-public metapixel
1824 ;; Follow stable branch.
1825 (let ((commit "98ee9daa093b6c334941242e63f90b1c2876eb4f"))
1826 (package
1827 (name "metapixel")
1828 (version (git-version "1.0.2" "1" commit))
1829 (source
1830 (origin
1831 (method git-fetch)
1832 (uri (git-reference
1833 (url "https://github.com/schani/metapixel")
1834 (commit commit)
1835 ;; TODO: Package rwimg and lispreader?
1836 (recursive? #t)))
1837 (file-name (git-file-name name version))
1838 (sha256
1839 (base32 "0r7n3a6bvcxkbpda4mwmrpicii09iql5z69nkjqygkwxw7ny3309"))))
1840 (build-system gnu-build-system)
1841 (arguments
1842 (list
1843 #:tests? #f ; No tests.
1844 #:make-flags
1845 #~(list
1846 (string-append "PREFIX=" #$output)
1847 (format #f "MANPAGE_XSL=~a/xml/xsl/~a-~a/manpages/docbook.xsl"
1848 #$(this-package-native-input "docbook-xsl")
1849 #$(package-name
1850 (this-package-native-input "docbook-xsl"))
1851 #$(package-version
1852 (this-package-native-input "docbook-xsl"))))
1853 #:phases
1854 #~(modify-phases %standard-phases
1855 (delete 'configure)
1856 (add-before 'install 'fix-directory-creation
1857 (lambda _
1858 (mkdir-p (string-append #$output "/share/man/man1")))))))
1859 (inputs
1860 (list giflib libjpeg-turbo libpng
1861 perl))
1862 (native-inputs
1863 (list docbook-xml-4.2 docbook-xsl
1864 libxslt pkg-config))
1865 (home-page "https://www.complang.tuwien.ac.at/schani/metapixel/")
1866 (synopsis "Photomosaics generator")
1867 (description "Metapixel is a program for generating photomosaics. It can
1868generate classical photomosaics, in which the source image is viewed as a
1869matrix of equally sized rectangles for each of which a matching image is
1870substituted, as well as collage-style photomosaics, in which rectangular parts
1871of the source image at arbitrary positions (i.e. not aligned to a matrix) are
1872substituted by matching images.")
1873 (license license:gpl2))))
1874
1875(define-public scantailor-advanced
1876 (let ((commit "3d1e74e6ace413733511086934a66f4e3f7a6027"))
1877 (package
1878 (name "scantailor-advanced")
1879 (version (string-append "1.0.16-" (string-take commit 7)))
1880 (source
1881 (origin
1882 (method git-fetch)
1883 (uri (git-reference
1884 (url "https://github.com/4lex4/scantailor-advanced")
1885 (commit commit)))
1886 (file-name (git-file-name name version))
1887 (sha256
1888 (base32
1889 "0kixwjb2x457dq7927hkh34c803p7yh1pmn6n61rk9shqrcg492h"))))
1890 (build-system qt-build-system)
1891 (arguments
1892 (list
1893 #:phases
1894 #~(modify-phases %standard-phases
1895 ;; Some tests require a display and fail with offscreen mode.
1896 (add-after 'unpack 'disable-failing-tests
1897 (lambda _
1898 (setenv "ARGS" "--exclude-regex \"imageproc_.*\""))))))
1899 (native-inputs
1900 (list qttools-5))
1901 (inputs
1902 (list boost
1903 libjpeg-turbo
1904 libpng
1905 libtiff
1906 qtbase-5
1907 qtsvg-5
1908 qtwayland-5
1909 zlib))
1910 (home-page "https://github.com/4lex4/scantailor-advanced")
1911 (synopsis "Clean up scanned pages")
1912 (description "Scan Tailor is an interactive post-processing tool for
1913scanned pages. It performs operations such as page splitting, deskewing,
1914adding/removing borders, and others. You give it raw scans, and you get pages
1915ready to be printed or assembled into a PDF or DJVU file. Scanning, optical
1916character recognition, and assembling multi-page documents are out of scope of
1917this project.
1918
1919Scan Tailer Advanced is a fork of Scan Tailer that merges Scan Tailor Featured
1920and Scan Tailor Enhanced versions as well as including many more bug fixes.")
1921 (license license:gpl3+))))
1922
1923(define-public simpleitk
1924 (package
1925 (name "simpleitk")
1926 (version "2.5.4")
1927 (source
1928 (origin
1929 (method git-fetch)
1930 (uri (git-reference
1931 (url "https://github.com/SimpleITK/SimpleITK")
1932 (commit (string-append "v" version))))
1933 (file-name (git-file-name name version))
1934 (sha256
1935 (base32 "1bzj5naqbgv2b31iqgz7qqk9rixsvjqycjz6l7w3gm7v1aj14jpb"))
1936 (patches
1937 (search-patches "simpleitk-r-4.6.0.patch"))))
1938 (build-system cmake-build-system)
1939 (outputs '("out" "python" "r"))
1940 (arguments
1941 (list
1942 #:configure-flags
1943 #~(list "-DBUILD_SHARED_LIBS=ON"
1944 "-DWRAP_LUA=OFF"
1945 "-DWRAP_PYTHON=ON"
1946 "-DWRAP_R=ON"
1947 "-DSimpleITK_USE_ELASTIX=ON"
1948 "-DSimpleITK_PYTHON_USE_VIRTUALENV=OFF")
1949 #:phases
1950 #~(modify-phases %standard-phases
1951 (add-after 'unpack 'early-GTest-discovery
1952 (lambda _
1953 ;; Find GTest before targets link to 'GTest::GTest'.
1954 (substitute* "Testing/Unit/CMakeLists.txt"
1955 (("add_subdirectory\\(TestBase\\)" anchor)
1956 (string-append "find_package(GTest REQUIRED)\n" anchor)))))
1957 (add-after 'unpack 'extract-test-data
1958 (lambda _
1959 (invoke "tar" "xvf"
1960 #$(this-package-native-input
1961 (string-append "SimpleITKData-" version ".tar.gz"))
1962 "--strip-components=1")))
1963 (add-after 'unpack 'fix-runpath
1964 (lambda _
1965 ;; The SWIG-generated shared libraries do not have SimpleITK's
1966 ;; libraries in their RUNPATH.
1967 (define (cmake-snippet start)
1968 (string-append
1969 start
1970 "set_target_properties(${SWIG_MODULE_SimpleITK_TARGET_NAME} "
1971 "PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE "
1972 "INSTALL_RPATH \"" #$output "/lib\")\n"))
1973 (substitute* "Wrapping/Python/CMakeLists.txt"
1974 (("^set\\(SWIG_MODULE_SimpleITKPython.*" anchor)
1975 (cmake-snippet anchor)))
1976 (substitute* "Wrapping/R/CMakeLists.txt"
1977 (("^set\\(SWIG_MODULE_SimpleITKR.*" anchor)
1978 (cmake-snippet anchor)))))
1979 (add-after 'unpack 'patch-cmake-config-itk-path
1980 (lambda _
1981 ;; Allow building SimpleITK C++ projects without ITK installed
1982 ;; in the profile.
1983 #$(let*
1984 ((itk (this-package-input "insight-toolkit"))
1985 (itk-version (package-version itk))
1986 (itk-version-major+minor
1987 (version-major+minor itk-version)))
1988 #~(substitute* "SimpleITKConfig.cmake.in"
1989 (((string-append
1990 "find_package\\(ITK \"@ITK_VERSION@\" "
1991 "EXACT REQUIRED\\)"))
1992 (string-append
1993 "find_package(ITK \"" #$itk-version
1994 "\" EXACT REQUIRED PATHS " #$itk
1995 "/lib/cmake/ITK-"
1996 #$itk-version-major+minor ")"))))))
1997 ;; It is not clear why this test fails.
1998 (add-after 'unpack 'skip-one-elastix-test
1999 (lambda _
2000 (substitute* "Testing/Unit/sitkElastixImageFilterTests.cxx"
2001 (("TEST\\(ElastixImageFilter, DefaultParameterMaps\\)")
2002 "TEST(ElastixImageFilter, DISABLED_DefaultParameterMaps)"))))
2003 (add-after 'install 'install-language-extension-modules
2004 (lambda _
2005 (with-directory-excursion "Wrapping/Python"
2006 (invoke "python3" "setup.py" "bdist_wheel")
2007 (apply invoke "pip" "--no-cache-dir" "--no-input" "install"
2008 "--no-deps" "--prefix" #$output:python
2009 (find-files "dist" "\\.whl$")))
2010 (let ((r-package-path
2011 (string-append #$output:r "/site-library/SimpleITK")))
2012 (mkdir-p r-package-path)
2013 (copy-recursively "Wrapping/R/R_libs/SimpleITK"
2014 r-package-path))))
2015 (delete 'check)
2016 (add-after 'install 'check-after-install
2017 ;; Run the tests when the SimpleITK libraries are where the
2018 ;; language extension modules expect them to be.
2019 (assoc-ref %standard-phases 'check)))))
2020 (home-page "https://simpleitk.org")
2021 (inputs (list elastix insight-toolkit python r-minimal))
2022 (native-inputs
2023 (list googletest
2024 lua
2025 nss-certs-for-test ;for 'pip install'
2026 python-numpy ;for tests
2027 python-pip
2028 python-setuptools
2029 swig-4.4
2030 (origin
2031 (method url-fetch)
2032 (uri (string-append
2033 "https://github.com/SimpleITK/SimpleITK/releases/download/v"
2034 version "/SimpleITKData-" version ".tar.gz"))
2035 (sha256
2036 (base32
2037 "0hryvi9fgqac00ng1bfhw3lm0al1dh0ka6jglba2q368nls428nx")))))
2038 (synopsis "Simplified interface to @acronym{ITK, Insight Toolkit}")
2039 (description
2040 "SimpleITK is an image analysis toolkit built on top of @acronym{ITK,
2041Insight Toolkit}. It provides a simplified interface to most of the
2042image filters and the input/output and registration frameworks in
2043@acronym{ITK, Insight Toolkit}. It is written in C++ and provides
2044bindings for interpreted languages. This package includes the C++,
2045Python and R interfaces.")
2046 (license license:asl2.0)))
2047
2048(define-public python-imgviz
2049 (package
2050 (name "python-imgviz")
2051 (version "1.7.6")
2052 (source
2053 (origin
2054 ;; PyPi tarball lacks tests.
2055 (method git-fetch)
2056 (uri (git-reference
2057 (url "https://github.com/wkentaro/imgviz")
2058 (commit (string-append "v" version))))
2059 (file-name (git-file-name name version))
2060 (sha256
2061 (base32 "0z7nwnvqh3hbbccf7v56398aiiwqs68kyrgc5vsmmh1cp4pwrgnb"))))
2062 (build-system pyproject-build-system)
2063 (native-inputs
2064 (list python-pytest
2065 python-hatchling
2066 python-hatch-vcs
2067 python-hatch-fancy-pypi-readme))
2068 (propagated-inputs
2069 (list python-matplotlib
2070 python-numpy
2071 python-pillow
2072 python-pyyaml))
2073 (home-page "http://github.com/wkentaro/imgviz")
2074 (synopsis "Image Visualization Tools")
2075 (description "Python library for object detection, semantic and instance
2076segmentation.")
2077 (license license:expat)))
2078
2079(define-public python-pims
2080 (package
2081 (name "python-pims")
2082 (version "0.7")
2083 (source
2084 (origin
2085 (method url-fetch)
2086 (uri (pypi-uri "pims" version))
2087 (sha256
2088 (base32 "0swlh8g4kf8p24g0ghkmwcj9y45rc59lmqx459nhhmhj6167m42m"))))
2089 (build-system pyproject-build-system)
2090 (arguments
2091 (list
2092 #:test-flags
2093 ;; We don't have all the (sometimes very large) data files, so we skip
2094 ;; these tests.
2095 '(list "--ignore=pims/tests/test_common.py"
2096 "--ignore=pims/tests/test_imseq.py"
2097 "--ignore=pims/tests/test_norpix.py")
2098 #:phases
2099 #~(modify-phases %standard-phases
2100 (add-after 'unpack 'relax-requirements
2101 (lambda _
2102 (substitute* "setup.py"
2103 (("'slicerator>=.*',")
2104 "'slicerator',")))))))
2105 (native-inputs
2106 (list python-pytest python-setuptools))
2107 (propagated-inputs
2108 (list python-imageio python-numpy python-slicerator))
2109 (home-page "https://github.com/soft-matter/pims")
2110 (synopsis "Python Image Sequence")
2111 (description "Scientific video can be packaged in various ways: familiar
2112video formats like @file{.AVI} and @file{.MOV}, folders full of numbered
2113images, or \"stacks\" of TIFF images. Each of these requires a separate
2114Python module. And, once loaded, they have different methods for accessing
2115individual images, looping through the images in bulk, accessing a specific
2116range, or dealing with multidimensional files. PIMS can do all of these using
2117a consistent interface, handling the differences between different inputs
2118invisibly.")
2119 (license license:bsd-3)))
2120
2121(define-public python-spatial-image
2122 (package
2123 (name "python-spatial-image")
2124 (version "1.0.0")
2125 (source
2126 (origin
2127 (method url-fetch)
2128 (uri (pypi-uri "spatial_image" version))
2129 (sha256
2130 (base32 "0blyjwgv6bqpg7r3f4dcs7x27ysfm8n9y0zk5j7dxj74lma3wdsm"))))
2131 (build-system pyproject-build-system)
2132 (propagated-inputs (list python-numpy python-pytest python-pytest-mypy
2133 python-xarray python-xarray-dataclasses))
2134 (native-inputs (list python-flit-core python-pytest))
2135 (home-page "https://github.com/spatial-image/spatial-image")
2136 (synopsis "Multi-dimensional spatial image data structure")
2137 (description "This package implements a multi-dimensional spatial image
2138data structure for scientific Python.
2139
2140To facilitate:
2141
2142@itemize
2143@item Multi-scale processing and analysis
2144@item Registration
2145@item Resampling
2146@item Subregion parallel processing
2147@item Coupling with meshes, point sets, and annotations
2148@end itemize
2149
2150with scientific images, which are typically multi-dimensional with anisotropic
2151sampling, this package provides a spatial-image data structure. In addition
2152to an N-dimensional array of pixel values, spatial metadata defines the
2153location of the pixel sampling grid in space time. It also labels the array
2154dimensions. This metadata is easily utilized and carried through image
2155processing pipelines.")
2156 (license license:expat)))
2157
2158(define-public labelme
2159 (package
2160 (name "labelme")
2161 ;; It's the latest available version which does not require not packaged
2162 ;; <https://github.com/wkentaro/osam>.
2163 (version "5.2.1")
2164 (source
2165 (origin
2166 ;; PyPi tarball lacks tests.
2167 (method git-fetch)
2168 (uri (git-reference
2169 (url "https://github.com/wkentaro/labelme")
2170 (commit (string-append "v" version))))
2171 (file-name (git-file-name name version))
2172 (sha256
2173 (base32 "1xpyad6rlkxyx51jaai4xhdy15k1gvm62xnkjn152hc1vj1c77sr"))))
2174 (build-system pyproject-build-system)
2175 (arguments
2176 (list
2177 #:test-flags
2178 #~(list "-m" "not gpu"
2179 ;; Fails when invoking help2man for unknown reason.
2180 "--ignore=tests/docs_tests/man_tests/test_labelme_1.py")
2181 #:phases
2182 #~(modify-phases %standard-phases
2183 (add-before 'check 'start-xserver
2184 (lambda* (#:key inputs #:allow-other-keys)
2185 (let ((xorg-server #$(this-package-native-input "xorg-server")))
2186 ;; Options taken from CI workflow.
2187 (system (string-append xorg-server "/bin/Xvfb :99 -screen 0 "
2188 "1920x1200x24 -ac +extension GLX +render "
2189 "-noreset &"))
2190 (setenv "DISPLAY" ":99.0")))))))
2191 (native-inputs
2192 (list python-pytest
2193 python-pytest-qt
2194 python-setuptools
2195 xorg-server-for-tests))
2196 (propagated-inputs
2197 (list python-imgviz
2198 python-matplotlib
2199 python-natsort
2200 python-numpy
2201 python-pillow
2202 python-pyqt
2203 python-pyyaml
2204 python-qtpy
2205 python-termcolor))
2206 (home-page "https://github.com/wkentaro/labelme")
2207 (synopsis "Image Polygonal Annotation")
2208 (description
2209 "Image and video labeling tool supporting different shapes like polygons,
2210rectangles, circles, lines, points and VOC/COCO export.")
2211 (license license:gpl3+)))
2212
2213(define-public charls
2214 (package
2215 (name "charls")
2216 (version "2.4.2")
2217 (source (origin
2218 (method git-fetch)
2219 (uri (git-reference
2220 (url "https://github.com/team-charls/charls/")
2221 (commit (string-append version))))
2222 (file-name (git-file-name name version))
2223 (sha256
2224 (base32
2225 "0vp6mjjm6hi2r1swwvbg86asvn604w58nam7yvqk1qr13aizjl71"))))
2226 (build-system cmake-build-system)
2227 (arguments
2228 `(#:configure-flags '("-DCMAKE_BUILD_TYPE:STRING=Release"
2229 "-DBUILD_SHARED_LIBS=On")))
2230 (native-inputs (list git pkg-config))
2231 (home-page "https://github.com/team-charls/charls")
2232 (synopsis "Library for using JPEG-LS compliant images")
2233 (description
2234 "CharLS is a codec library that can be used to build applications that
2235can handle JPEG-LS compliant images. In the application you are writing you
2236can call the CharLS codec and pass it images (sometimes called raster bitmaps),
2237 to have them encoded to JPEG-LS, or JPEG-LS streams, which CharLS will decode
2238to images.")
2239 (license license:bsd-3)))
2240
2241(define-public libansilove
2242 (package
2243 (name "libansilove")
2244 (version "1.4.1")
2245 (source (origin
2246 (method git-fetch)
2247 (uri (git-reference
2248 (url "https://github.com/ansilove/libansilove")
2249 (commit (string-append version))))
2250 (file-name (git-file-name name version))
2251 (sha256
2252 (base32
2253 "169njlck4a2bmf1kmjas1w594hyda543ykdnwg7fwkviij39l9z6"))))
2254 (build-system cmake-build-system)
2255 (arguments
2256 (list #:tests? #f)) ; No tests included
2257 (native-inputs
2258 (list gd))
2259 (home-page "https://www.ansilove.org/")
2260 (synopsis "Library for converting ANSI, ASCII, and other formats to PNG")
2261 (description
2262 "libansilove is a library for converting artscene file types to PNG images,
2263including ANSI (.ANS) and many others. The library primarily serves to support
2264the ansilove tool.")
2265 (license license:bsd-2)))
2266
2267(define-public ansilove
2268 (package
2269 (name "ansilove")
2270 (version "4.2.0")
2271 (source (origin
2272 (method git-fetch)
2273 (uri (git-reference
2274 (url "https://github.com/ansilove/ansilove")
2275 (commit (string-append version))))
2276 (file-name (git-file-name name version))
2277 (sha256
2278 (base32
2279 "1h9r759krjl8wi68yxs1d46qfrx6v89a8vmmv3aqym8vn9x430kh"))))
2280 (build-system cmake-build-system)
2281 (native-inputs
2282 (list libansilove))
2283 (home-page "https://www.ansilove.org/")
2284 (synopsis "ANSI and ASCII art to PNG converter")
2285 (description
2286 "AnsiLove is an ANSI and ASCII art to PNG converter, allowing to convert
2287ANSI and artscene-related file formats into PNG images, supporting ANSI (.ANS),
2288PCBoard (.PCB), Binary (.BIN), Artworx (.ADF), iCE Draw (.IDF), Tundra (.TND)
2289and XBin (.XB) formats.")
2290 (license license:bsd-2)))