projects/guix·blob wip-postfix · refs

1812 lines · 69.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2017 John Darrington <[email protected]>
3;;; Copyright © 2017, 2019, 2022 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2014, 2021-2023 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 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 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 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;;;
27;;; This file is part of GNU Guix.
28;;;
29;;; GNU Guix is free software; you can redistribute it and/or modify it
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
34;;; GNU Guix is distributed in the hope that it will be useful, but
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42(define-module (gnu packages image-processing)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix gexp)
46 #:use-module (guix utils)
47 #:use-module (guix download)
48 #:use-module (guix git-download)
49 #:use-module (guix build-system qt)
50 #:use-module (guix build-system cmake)
51 #:use-module (guix build-system gnu)
52 #:use-module (guix build-system python)
53 #:use-module (gnu packages)
54 #:use-module (gnu packages algebra)
55 #:use-module (gnu packages bison)
56 #:use-module (gnu packages boost)
57 #:use-module (gnu packages check)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages cpp)
60 #:use-module (gnu packages curl)
61 #:use-module (gnu packages docbook)
62 #:use-module (gnu packages documentation)
63 #:use-module (gnu packages flex)
64 #:use-module (gnu packages fontutils)
65 #:use-module (gnu packages game-development)
66 #:use-module (gnu packages gcc)
67 #:use-module (gnu packages gd)
68 #:use-module (gnu packages geo)
69 #:use-module (gnu packages ghostscript)
70 #:use-module (gnu packages gimp)
71 #:use-module (gnu packages gl)
72 #:use-module (gnu packages glib)
73 #:use-module (gnu packages gnome)
74 #:use-module (gnu packages graphics)
75 #:use-module (gnu packages graphviz)
76 #:use-module (gnu packages gstreamer)
77 #:use-module (gnu packages gtk)
78 #:use-module (gnu packages icu4c)
79 #:use-module (gnu packages image)
80 #:use-module (gnu packages imagemagick)
81 #:use-module (gnu packages linux)
82 #:use-module (gnu packages maths)
83 #:use-module (gnu packages mpi)
84 #:use-module (gnu packages opencl)
85 #:use-module (gnu packages pdf)
86 #:use-module (gnu packages perl)
87 #:use-module (gnu packages photo)
88 #:use-module (gnu packages pkg-config)
89 #:use-module (gnu packages pretty-print)
90 #:use-module (gnu packages protobuf)
91 #:use-module (gnu packages python)
92 #:use-module (gnu packages python-check)
93 #:use-module (gnu packages python-science)
94 #:use-module (gnu packages python-xyz)
95 #:use-module (gnu packages qt)
96 #:use-module (gnu packages sdl)
97 #:use-module (gnu packages serialization)
98 #:use-module (gnu packages sphinx)
99 #:use-module (gnu packages sqlite)
100 #:use-module (gnu packages tbb)
101 #:use-module (gnu packages textutils)
102 #:use-module (gnu packages tls)
103 #:use-module (gnu packages version-control)
104 #:use-module (gnu packages video)
105 #:use-module (gnu packages xiph)
106 #:use-module (gnu packages xml)
107 #:use-module (gnu packages xorg)
108 #:use-module (ice-9 match)
109 #:use-module (srfi srfi-1))
110
111;; TODO: this is not reproducible.
112(define-public bart
113 (package
114 (name "bart")
115 (version "0.8.00")
116 (source
117 (origin
118 (method git-fetch)
119 (uri (git-reference
120 (url "https://github.com/mrirecon/bart")
121 (commit "eacc67b95cf128487ecc48f0e6541ea4dca08818")))
122 (file-name (git-file-name name version))
123 (sha256
124 (base32 "05lcf7c3g7ms5h82bw1mi4kzkdv5wpqi1zrfhqfkgbcpd3irj6aq"))))
125 (build-system gnu-build-system)
126 (arguments
127 (list
128 #:test-target "utest"
129 #:make-flags #~(list
130 (string-append "PREFIX=" #$output)
131 "PARALLEL=1"
132 "PARALLEL_NJOBS=1"
133 "OPENBLAS=1"
134 "SCALAPACK=1"
135 (string-append "BLAS_BASE=" #$(this-package-input "openblas"))
136 (string-append "FFTW_BASE=" #$(this-package-input "fftw")))
137 #:parallel-build? #false ;leads to non-deterministic output
138 #:phases
139 #~(modify-phases %standard-phases
140 (delete 'configure)
141 (add-after 'unpack 'patch-/bin/bash
142 (lambda _
143 (substitute* "tests/pics.mk"
144 (("/bin/bash") (which "bash"))))))))
145 (inputs
146 (list fftw
147 fftwf
148 libpng
149 openblas
150 python
151 scalapack))
152 (native-inputs
153 (list doxygen
154 util-linux)) ;for flock
155 (home-page "https://mrirecon.github.io/bart/")
156 (synopsis "Toolbox for computational magnetic resonance imaging")
157 (description "The Berkeley Advanced Reconstruction Toolbox (BART) is an
158image-reconstruction framework for Computational Magnetic Resonance Imaging.
159The tools in this software implement various reconstruction algorithms for
160Magnetic Resonance Imaging.")
161 (license license:bsd-3)))
162
163(define-public dcmtk
164 (package
165 (name "dcmtk")
166 (version "3.6.7")
167 (source
168 (origin
169 (method url-fetch)
170 (uri
171 (string-append "ftp://dicom.offis.de/pub/dicom/offis/software/dcmtk/"
172 "dcmtk" (string-join (string-split version #\.) "")
173 "/dcmtk-" version ".tar.gz"))
174 (sha256
175 (base32 "02kix73qhndgb56cmi5327666i6imp7hi17wwqp26q4d7s72jn3w"))))
176 (build-system cmake-build-system)
177 (arguments
178 ;; By default, only static archives are built.
179 (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")))
180 (inputs
181 (list icu4c
182 libjpeg-turbo
183 libpng
184 libtiff
185 libxml2
186 openssl
187 zlib))
188 (native-inputs
189 (list doxygen)) ; for HTML documentation
190 (home-page "https://dcmtk.org")
191 (synopsis "Libraries and programs implementing parts of the DICOM standard")
192 (description "DCMTK is a collection of libraries and applications
193implementing large parts the DICOM standard. It includes software for
194examining, constructing and converting DICOM image files, handling offline
195media, sending and receiving images over a network connection, as well as
196demonstrative image storage and worklist servers.")
197 (license (license:fsf-free
198 "file://COPYRIGHT"
199 "A union of the Apache 2.0 licence and various non-copyleft
200licences similar to the Modified BSD licence."))))
201
202(define-public mia
203 (package
204 (name "mia")
205 (version "2.4.7")
206 (source (origin
207 (method url-fetch)
208 (uri (string-append "mirror://sourceforge/mia/mia/"
209 (version-major+minor version)
210 "/mia-" version ".tar.xz"))
211 (sha256
212 (base32
213 "0qpcd3n26q52dpyibm11f5l6cgscdr54p2jish39gc3p1f5h3ws1"))
214 (patches (search-patches "mia-fix-boost-headers.patch"
215 "mia-vtk9.patch"
216 "mia-vtk92.patch"
217 "mia-vtk-version.patch"))))
218 (build-system cmake-build-system)
219 (arguments
220 `(#:configure-flags
221 (list "-DMIA_CREATE_NIPYPE_INTERFACES=OFF"
222 "-DCMAKE_CXX_FLAGS=-fpermissive")))
223 (inputs
224 (list boost
225 dcmtk
226 doxygen
227 eigen
228 fftw
229 fftwf
230 gsl
231 gts
232 hdf5
233 itpp
234 libjpeg-turbo
235 libpng
236 libtiff
237 libxml2
238 libxml++
239 maxflow
240 niftilib
241 nlopt
242 openexr-2
243 python-lxml
244 vtk))
245 (native-inputs
246 (list pkg-config
247 python-wrapper))
248 (home-page "https://mia.sourceforge.net")
249 (synopsis "Toolkit for gray scale medical image analysis")
250 (description "MIA provides a combination of command line tools, plug-ins,
251and libraries that make it possible run image processing tasks interactively
252in a command shell and to prototype using the shell's scripting language. It
253is built around a plug-in structure that makes it easy to add functionality
254without compromising the original code base and it makes use of a wide variety
255of external libraries that provide additional functionality.")
256 (license license:gpl3+)))
257
258(define-public opencolorio
259 (package
260 (name "opencolorio")
261 (version "1.1.1")
262 (source
263 (origin
264 (method git-fetch)
265 (uri (git-reference
266 (url "https://github.com/AcademySoftwareFoundation/OpenColorIO")
267 (commit (string-append "v" version))))
268 (patches (search-patches "opencolorio-fix-build-with-gcc11.patch"))
269 (sha256
270 (base32 "12srvxca51czpfjl0gabpidj9n84mw78ivxy5w75qhq2mmc798sb"))
271 (file-name (git-file-name name version))
272 (modules '((guix build utils)))
273 (snippet
274 `(begin
275 ;; Remove bundled tarballs, patches, and .jars(!). XXX: Upstream
276 ;; claims to have fixed USE_EXTERNAL_YAML, but it still fails with:
277 ;; https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/517
278 ;; When removing it, also remove it from the licence field comment.
279 (for-each delete-file-recursively
280 (filter
281 (lambda (full-name)
282 (let ((file (basename full-name)))
283 (not (or (string-prefix? "yaml-cpp-0.3" file)
284 (string=? "unittest.h" file)))))
285 (find-files "ext" ".*")))
286
287 #t))))
288 (build-system cmake-build-system)
289 (arguments
290 `(#:configure-flags
291 (list (string-append "-DCMAKE_CXX_FLAGS="
292 "-Wno-error=deprecated-declarations "
293 "-Wno-error=unused-function")
294 "-DOCIO_BUILD_STATIC=OFF"
295 ;; "-DUSE_EXTERNAL_YAML=ON"
296 "-DUSE_EXTERNAL_TINYXML=ON"
297 "-DUSE_EXTERNAL_LCMS=ON")
298 #:phases
299 (modify-phases %standard-phases
300 (add-after 'unpack 'patch-test-suite
301 (lambda _
302 (substitute* "src/core_tests/CMakeLists.txt"
303 (("/bin/sh") (which "bash")))
304 #t)))))
305 (native-inputs
306 (list git pkg-config))
307 (inputs
308 ;; XXX Adding freeglut, glew, ilmbase, mesa, and openimageio for
309 ;; ocioconvert fails: error: conflicting declaration ?typedef void
310 ;; (* PFNGLGETFRAGMENTMATERIALFVSGIXPROC)(GLenum, GLenum, GLfloat*)
311 (list lcms openexr-2 tinyxml))
312 (home-page "https://opencolorio.org")
313 (synopsis "Color management for visual effects and animation")
314 (description
315 "OpenColorIO, or OCIO, is a complete color management solution geared
316towards motion picture production, with an emphasis on visual effects and
317computer animation. It provides a straightforward and consistent user
318experience across all supporting applications while allowing for sophisticated
319back-end configuration options suitable for high-end production usage.
320
321OCIO is compatible with the @acronym{ACES, Academy Color Encoding
322Specification} and is @acronym{LUT, look-up table}-format agnostic, supporting
323many popular formats.")
324 (license (list license:expat ; docs/ociotheme/static, ext/yaml-cpp-*
325 license:zlib ; src/core/md5
326 license:bsd-3)))) ; the rest
327
328(define-public vtk
329 (package
330 (name "vtk")
331 (version "9.2.2")
332 (source (origin
333 (method url-fetch)
334 (uri (string-append "https://vtk.org/files/release/"
335 (version-major+minor version)
336 "/VTK-" version ".tar.gz"))
337 (sha256
338 (base32
339 "0x8h2bwxq2870067j7wqd0qym87pa3inkbri93zrdb0zwwmhlnqw"))
340 (modules '((guix build utils)))
341 (snippet
342 '(begin
343 (for-each
344 (lambda (dir)
345 (delete-file-recursively
346 (string-append "ThirdParty/" dir "/vtk" dir)))
347 ;; pugixml depended upon unconditionally
348 '("doubleconversion" "eigen" "expat" "freetype" "gl2ps"
349 "glew" "hdf5" "jpeg" "jsoncpp" "libharu" "libproj"
350 "libxml2" "lz4" "netcdf" "ogg" "png" "sqlite" "theora"
351 "tiff" "zlib"))
352 (substitute* "IO/ExportPDF/vtkPDFContextDevice2D.cxx"
353 (("\\bHPDF_UINT16 (noPen|dash|dot|denseDot|dashDot|dashDotDot)\\b"
354 _ var)
355 (string-append "HPDF_REAL " var)))))))
356 (properties `((release-monitoring-url . "https://vtk.org/download/")))
357 (build-system cmake-build-system)
358 (arguments
359 (list #:build-type "Release" ;Build without '-g' to save space.
360 #:configure-flags
361 #~'( ;;"-DBUILD_TESTING:BOOL=TRUE" ;not honored
362 "-DVTK_USE_EXTERNAL=OFF" ;default
363 "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
364 "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
365 "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
366 "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
367 "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
368 "-DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON"
369 "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
370 "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
371 "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
372 "-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=ON"
373 "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
374 "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
375 "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
376 "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
377 "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
378 "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
379 ;;"-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON" ;breaks IO/CityGML
380 "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
381 "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
382 "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
383 "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"
384 "-DVTK_MODULE_ENABLE_VTK_RenderingExternal=YES" ;for F3D
385 "-DVTK_WRAP_PYTHON=ON"
386 "-DVTK_PYTHON_VERSION:STRING=3"
387
388 "-DVTK_SMP_ENABLE_OPENNMP=ON"
389 "-DVTK_SMP_ENABLE_TBB=ON"
390 "-DVTK_USE_MPI=ON"
391 #$@(if (target-riscv64?)
392 '("-DCMAKE_SHARED_LINKER_FLAGS=-latomic"
393 "-DCMAKE_EXE_LINKER_FLAGS=-latomic")
394 '()))
395
396 #:phases
397 #~(modify-phases %standard-phases
398 (add-after 'unpack 'clear-reference-to-compiler
399 (lambda _
400 (define (choose . files)
401 (let loop ((files files))
402 (if (null? files)
403 #f
404 (if (file-exists? (car files))
405 (car files)
406 (loop (cdr files))))))
407
408 ;; Do not retain a reference to GCC.
409 (substitute* (choose
410 "Common/Core/vtkConfigureDeprecated.h.in" ;v9.x
411 "Common/Core/vtkConfigure.h.in") ;v7.x
412 (("@CMAKE_CXX_COMPILER@") "c++")))))
413
414 #:tests? #f)) ;XXX: test data not included
415 (inputs
416 (list double-conversion
417 eigen
418 expat
419 freetype
420 gl2ps
421 glew
422 glu
423 hdf5
424 libharu
425 libjpeg-turbo
426 jsoncpp
427 libtheora
428 libx11
429 libxml2
430 libxt
431 lz4
432 mesa
433 netcdf
434 libpng
435 libtiff
436 openmpi
437 proj
438 python
439 ;("pugixml" ,pugixml)
440 sqlite
441 xorgproto
442 zlib))
443 (propagated-inputs
444 ;; VTK's 'VTK-vtk-module-find-packages.cmake' calls
445 ;; 'find_package(THEORA)', which in turns looks for libogg. Likewise for
446 ;; TBB.
447 (list libogg
448 tbb))
449 (home-page "https://vtk.org/")
450 (synopsis "Libraries for 3D computer graphics")
451 (description
452 "The Visualization Toolkit (VTK) is a C++ library for 3D computer graphics,
453image processing and visualization. It supports a wide variety of
454visualization algorithms including: scalar, vector, tensor, texture, and
455volumetric methods; and advanced modeling techniques such as: implicit
456modeling, polygon reduction, mesh smoothing, cutting, contouring, and Delaunay
457triangulation. VTK has an extensive information visualization framework, has
458a suite of 3D interaction widgets, supports parallel processing, and
459integrates with various databases on GUI toolkits such as Qt and Tk.")
460 (license license:bsd-3)))
461
462(define-public vtk-7
463 (package
464 (inherit vtk)
465 (version "7.1.1")
466 (source (origin
467 (method url-fetch)
468 (uri (string-append "https://vtk.org/files/release/"
469 (version-major+minor version)
470 "/VTK-" version ".tar.gz"))
471 (sha256
472 (base32
473 "0nm7xwwj7rnsxjdv2ssviys8nhci4n9iiiqm2y14s520hl2dsp1d"))
474 (patches (search-patches "vtk-7-python-compat.patch"
475 "vtk-7-hdf5-compat.patch"
476 "vtk-7-gcc-10-compat.patch"
477 "vtk-7-gcc-11-compat.patch"))))
478 (arguments
479 (substitute-keyword-arguments (package-arguments vtk)
480 ((#:configure-flags flags)
481 ;; Otherwise, the build would fail with: "error: invalid conversion
482 ;; from ‘const char*’ to ‘char*’ [-fpermissive]".
483 #~(cons "-DCMAKE_CXX_FLAGS=-fpermissive" #$flags))
484 ((#:phases phases)
485 #~(modify-phases #$phases
486 (add-after 'unpack 'remove-kernel-version
487 ;; Avoid embedding the kernel version for reproducible builds
488 (lambda _
489 (substitute*
490 "ThirdParty/hdf5/vtkhdf5/config/cmake/libhdf5.settings.cmake.in"
491 (("Host system: \\@CMAKE_HOST_SYSTEM\\@")
492 "Host system: @CMAKE_SYSTEM_NAME@"))))))))))
493
494(define-public opencv
495 (package
496 (name "opencv")
497 (version "4.8.0")
498 (source (origin
499 (method git-fetch)
500 (uri (git-reference
501 (url "https://github.com/opencv/opencv")
502 (commit version)))
503 (file-name (git-file-name name version))
504 (modules '((guix build utils)))
505 (snippet
506 '(begin
507 ;; Remove external libraries. Almost all of them are
508 ;; available in Guix.
509 (with-directory-excursion "3rdparty"
510 (for-each delete-file-recursively
511 '("carotene"
512 "cpufeatures"
513 "flatbuffers"
514 "ffmpeg"
515 "include"
516 "ippicv"
517 "ittnotify"
518 "libjasper"
519 "libjpeg"
520 "libjpeg-turbo"
521 "libpng"
522 "libtengine"
523 "libtiff"
524 "libwebp"
525 "openexr"
526 "openjpeg"
527 "openvx"
528 "protobuf"
529 ;;"quirc"
530 "tbb"
531 "zlib")))
532
533 ;; Delete any bundled .jar files.
534 (for-each delete-file (find-files "." "\\.jar$"))))
535 (sha256
536 (base32
537 "14bjpb0ahhaqnim8g6vs0gyd6jgnmly1amx25a0rk1a6ii2aiywn"))))
538 (build-system cmake-build-system)
539 (arguments
540 `(#:configure-flags
541 (list "-DWITH_ADE=OFF" ;we don't have a package for ade yet
542 "-DWITH_IPP=OFF"
543 "-DWITH_ITT=OFF"
544 "-DWITH_CAROTENE=OFF" ; only visible on arm/aarch64
545 "-DENABLE_PRECOMPILED_HEADERS=OFF"
546 "-DOPENCV_GENERATE_PKGCONFIG=ON"
547
548 ;; CPU-Features:
549 ;; See cmake/OpenCVCompilerOptimizations.cmake
550 ;; (CPU_ALL_OPTIMIZATIONS) for a list of all optimizations
551 ;; BASELINE is the minimum optimization all CPUs must support
552 ;;
553 ;; DISPATCH is the list of optional dispatches.
554 "-DCPU_BASELINE=SSE2"
555
556 ;; Build Python bindings.
557 "-DBUILD_opencv_python3=ON"
558
559 ,@(match (%current-system)
560 ("x86_64-linux"
561 '("-DCPU_DISPATCH=NEON;VFPV3;FP16;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX"
562 "-DCPU_DISPATCH_REQUIRE=SSE3,SSSE3,SSE4_1,SSE4_2,AVX,AVX2"))
563 ("armhf-linux"
564 '("-DCPU_BASELINE_DISABLE=NEON")) ; causes build failures
565 ("aarch64-linux"
566 '("-DCPU_BASELINE=NEON"
567 "-DCPU_DISPATCH=NEON;VFPV3;FP16"))
568 (_ '()))
569
570 "-DBUILD_PERF_TESTS=OFF"
571 "-DBUILD_TESTS=ON"
572
573 (string-append "-DOPENCV_EXTRA_MODULES_PATH=" (getcwd)
574 "/opencv-contrib/modules")
575
576 ;;Define test data:
577 (string-append "-DOPENCV_TEST_DATA_PATH=" (getcwd)
578 "/opencv-extra/testdata")
579
580 ;; Is ON by default and would try to rebuild 3rd-party protobuf,
581 ;; which we had removed, which would lead to an error:
582 "-DBUILD_PROTOBUF=OFF"
583
584 ;; OpenCV tries to use flatbuffers in 3rdparty which we removed
585 ;; so for now we don't buildfor flatbuffer support
586 ;; TODO: make OpenCV use system flatbuffers which involves
587 ;; modifying CMake files
588 "-DWITH_FLATBUFFERS=OFF"
589
590 ;; Rebuild protobuf files, because we have a slightly different
591 ;; version than the included one. If we would not update, we
592 ;; would get a compile error later:
593 "-DPROTOBUF_UPDATE_FILES=ON"
594
595 ;; xfeatures2d disabled, because it downloads extra binaries from
596 ;; https://github.com/opencv/opencv_3rdparty
597 ;; defined in xfeatures2d/cmake/download_{vgg|bootdesc}.cmake
598 ;; Cmp this bug entry:
599 ;; https://github.com/opencv/opencv_contrib/issues/1131
600 "-DBUILD_opencv_xfeatures2d=OFF")
601 #:phases
602 (modify-phases %standard-phases
603 (add-after 'unpack 'disable-broken-tests
604 (lambda _
605 ;; This test fails with "unknown file: Failure"
606 ;; But I couldn't figure out which file was missing:
607 (substitute* "../opencv-contrib/modules/face/test/test_face_align.cpp"
608 (("\\bcan_detect_landmarks\\b" all)
609 (string-append "DISABLED_" all)))
610
611 ;; This all fails with a comparison between the expected 396 and
612 ;; the actual 440 in file size.
613 (substitute* "modules/imgcodecs/test/test_exr.impl.hpp"
614 (("\\breadWrite_32FC1\\b" all)
615 (string-append "DISABLED_" all)))
616
617 ;; These fail with protobuf parse errors that come from
618 ;; opencv-extra/alldata.
619 (substitute* "modules/dnn/test/test_layers.cpp"
620 (("\\b(Accum|DataAugmentation|Resample|Correlation|Interp)\\b" all)
621 (string-append "DISABLED_" all)))
622
623 ;; This test fails on x86-64, loosen the bounds.
624 ;; Expected: (max) < (0.1), actual: 0.2 vs 0.1
625 (substitute* "modules/photo/test/test_hdr.cpp"
626 (("0\\.1\\)") "0.222)"))
627
628 ,@(if (target-aarch64?)
629 `(;; This test fails on aarch64, loosen the bounds.
630 ;; Expected: (max) < (0.131), actual: 0.207148 vs 0.131
631 (substitute* "modules/photo/test/test_hdr.cpp"
632 (("0\\.131") "0.222"))
633 ;; These tests hang forever on aarch64.
634 (delete-file-recursively "modules/videoio/test/"))
635 '())
636
637 ,@(if (target-riscv64?)
638 `(;; This test fails on riscv64, loosen the bounds.
639 ;; Expected: (max) < (0.1), actual: 0.220829 vs 0.1
640 (substitute* "modules/photo/test/test_hdr.cpp"
641 (("0\\.1") "0.240"))
642 ;; Expected equality of these values:
643 ;; ellipses.size()
644 ;; Which is: 668
645 ;; ellipses_size
646 ;; Which is: 2449
647 (substitute* "../opencv-contrib/modules/ximgproc/test/test_fld.cpp"
648 (("\\bManySmallCircles\\b" all)
649 (string-append "DISABLED_" all))))
650 '())))
651 (add-after 'unpack 'unpack-submodule-sources
652 (lambda* (#:key inputs #:allow-other-keys)
653 (mkdir "../opencv-extra")
654 (mkdir "../opencv-contrib")
655 (copy-recursively (assoc-ref inputs "opencv-extra")
656 "../opencv-extra")
657 (copy-recursively (assoc-ref inputs "opencv-contrib")
658 "../opencv-contrib")))
659 (add-after 'build 'do-not-install-3rdparty-file
660 (lambda _
661 (substitute* "cmake_install.cmake"
662 (("file\\(INSTALL .*3rdparty/include/opencl/LICENSE.txt.*")
663 ""))))
664 (add-before 'check 'start-xserver
665 (lambda* (#:key inputs #:allow-other-keys)
666 (let ((xorg-server (assoc-ref inputs "xorg-server"))
667 (disp ":1"))
668 (setenv "HOME" (getcwd))
669 (setenv "DISPLAY" disp)
670 ;; There must be a running X server and make check doesn't start one.
671 ;; Therefore we must do it.
672 (zero? (system (format #f "~a/bin/Xvfb ~a &" xorg-server disp)))))))))
673 (native-inputs
674 `(("pkg-config" ,pkg-config)
675 ("xorg-server" ,xorg-server-for-tests) ;For running the tests
676 ("opencv-extra"
677 ,(origin
678 (method git-fetch)
679 (uri (git-reference
680 (url "https://github.com/opencv/opencv_extra")
681 (commit version)))
682 (file-name (git-file-name "opencv_extra" version))
683 (sha256
684 (base32
685 "11y9b35j74gg4gqll4v366qmhvjkcqml45khiajd8zsk1fraf70l"))))
686 ("opencv-contrib"
687 ,(origin
688 (method git-fetch)
689 (uri (git-reference (url "https://github.com/opencv/opencv_contrib")
690 (commit version)))
691 (file-name (git-file-name "opencv_contrib" version))
692 (sha256
693 (base32
694 "16crcca9r4y4rby0dqdhc06qi84hjk6qxy2sql2dhh35hfs856rr"))))))
695 (inputs
696 (list eigen
697 ffmpeg-4
698 ;; TODO: add gstreamer
699 gtk+
700 gtkglext
701 hdf5
702 ilmbase
703 imath ;should be propagated by openexr
704 jasper
705 libgphoto2
706 libjpeg-turbo
707 libpng
708 libtiff
709 libwebp
710 openblas
711 opencl-headers
712 openexr
713 openmpi
714 openjpeg
715 protobuf
716 python
717 python-numpy
718 vtk
719 zlib))
720 ;; These three CVEs are not a problem of OpenCV, see:
721 ;; https://github.com/opencv/opencv/issues/10998
722 (properties '((lint-hidden-cve . ("CVE-2018-7712"
723 "CVE-2018-7713"
724 "CVE-2018-7714"))))
725 (synopsis "Computer vision library")
726 (description "OpenCV is a library aimed at real-time computer vision,
727including several hundred computer vision algorithms. It can be used to do
728things like:
729
730@itemize
731@item image and video input and output
732@item image and video processing
733@item displaying
734@item feature recognition
735@item segmentation
736@item facial recognition
737@item stereo vision
738@item structure from motion
739@item augmented reality
740@item machine learning
741@end itemize\n
742
743This package includes the Python bindings for OpenCV, which are also known as
744the OpenCV-Python library.")
745 (home-page "https://opencv.org/")
746 (license license:bsd-3)))
747
748(define-public vips
749 (package
750 (name "vips")
751 (version "8.13.1")
752 (source
753 (origin
754 (method url-fetch)
755 (uri (string-append
756 "https://github.com/libvips/libvips/releases/download/v"
757 version "/vips-" version ".tar.gz"))
758 (sha256
759 (base32 "00kp3439jcqv9l2gcjg88xzvlq8clv54z1m3x66i3chvarz7ndxd"))))
760 (build-system gnu-build-system)
761 (native-inputs
762 (list gobject-introspection pkg-config))
763 (inputs
764 (list expat
765 fftw
766 giflib
767 glib
768 hdf5
769 imagemagick
770 lcms
771 libexif
772 libgsf
773 libjpeg-turbo
774 libpng
775 (librsvg-for-system)
776 libtiff
777 libxml2
778 libwebp
779 matio
780 niftilib
781 openexr-2
782 orc
783 pango
784 poppler))
785 (home-page "https://libvips.github.io/libvips/")
786 (synopsis "Multithreaded image processing system with low memory needs")
787 (description
788 "VIPS is a demand-driven, horizontally threaded image processing library.
789It's particularly good at processing large images, working with colour,
790scientific analysis, and general research & development.
791
792Compared to most image processing libraries VIPS needs little RAM and runs
793quickly, especially on machines with more than one CPU core. This is primarily
794due to its architecture which automatically parallelises the image workflows.")
795 (license license:lgpl2.1+)))
796
797(define-public gmic
798 (package
799 (name "gmic")
800 (version "3.0.0")
801 (source
802 (origin
803 (method url-fetch)
804 (uri (string-append "https://gmic.eu/files/source/gmic_"
805 version ".tar.gz"))
806 (sha256
807 (base32 "080inz0wisv3rhvbnzrgcs3j25wq86gybp68yi56gw6vwswnn19z"))))
808 (build-system cmake-build-system)
809 (arguments
810 `(#:tests? #f ;there are no tests
811 #:configure-flags '("-DBUILD_LIB_STATIC=OFF"
812 "-DENABLE_DYNAMIC_LINKING=ON"
813 "-DENABLE_LTO=ON")
814 #:phases
815 (modify-phases %standard-phases
816 (add-before 'configure 'set-LDFLAGS
817 (lambda* (#:key inputs outputs #:allow-other-keys)
818 (setenv "LDFLAGS"
819 (string-append
820 "-Wl,-rpath="
821 (assoc-ref outputs "out") "/lib")))))))
822 (native-inputs
823 (list pkg-config))
824 (inputs
825 (list curl
826 fftw
827 graphicsmagick
828 imath
829 libjpeg-turbo
830 libpng
831 libtiff
832 libx11
833 ;;opencv ;OpenCV is currently broken in the CI
834 openexr
835 zlib))
836 (home-page "https://gmic.eu/")
837 (synopsis "Full-featured framework for digital image processing")
838 (description "G'MIC is a full-featured framework for digital image
839processing. It provides several user interfaces to convert / manipulate
840/ filter / visualize generic image datasets, ranging from 1D scalar
841signals to 3D+t sequences of multi-spectral volumetric images, hence
842including 2D color images.")
843 ;; Dual-licensed, either license applies.
844 (license (list license:cecill license:cecill-c))))
845
846(define-public gmic-qt
847 (package
848 (inherit gmic)
849 (name "gmic-qt")
850 (arguments
851 (substitute-keyword-arguments (package-arguments gmic)
852 ((#:configure-flags _)
853 `(list "-DGMIC_QT_HOST=none" "-DENABLE_DYNAMIC_LINKING=ON"
854 (string-append "-DGMIC_LIB_PATH="
855 (assoc-ref %build-inputs "gmic") "/lib")))
856 ((#:phases phases)
857 `(modify-phases ,phases
858 (add-after 'unpack 'qt-chdir
859 (lambda _ (chdir "gmic-qt") #t))))))
860 (native-inputs
861 (list pkg-config qttools-5))
862 (inputs
863 (modify-inputs (package-inputs gmic)
864 (prepend gmic qtbase-5)))
865 (synopsis "Qt frontend for the G'MIC image processing framework")
866 (license license:gpl3+)))
867
868(define-public gmic-qt-krita
869 (package
870 (inherit gmic-qt)
871 (name "gmic-qt-krita")
872 (arguments
873 (substitute-keyword-arguments (package-arguments gmic-qt)
874 ((#:configure-flags flags)
875 '(list "-DGMIC_QT_HOST=krita" "-DENABLE_DYNAMIC_LINKING=ON"
876 (string-append "-DGMIC_LIB_PATH="
877 (assoc-ref %build-inputs "gmic") "/lib")))))
878 (synopsis "Krita plugin for the G'MIC image processing framework")))
879
880(define-public gmic-qt-gimp
881 (package
882 (inherit gmic-qt)
883 (name "gmic-qt-gimp")
884 (inputs
885 ;; GIMP and its dependencies.
886 (modify-inputs (package-inputs gmic-qt)
887 (prepend gimp gdk-pixbuf cairo gegl)))
888 (arguments
889 (substitute-keyword-arguments (package-arguments gmic-qt)
890 ((#:configure-flags flags)
891 '(list "-DGMIC_QT_HOST=gimp" "-DENABLE_DYNAMIC_LINKING=ON"
892 (string-append "-DGMIC_LIB_PATH="
893 (assoc-ref %build-inputs "gmic") "/lib")))))
894 (synopsis "GIMP plugin for the G'MIC image processing framework")))
895
896(define-public nip2
897 (package
898 (name "nip2")
899 (version "8.7.1")
900 (source
901 (origin
902 (method url-fetch)
903 (uri (string-append "https://github.com/libvips/nip2/releases/download/v"
904 version "/nip2-" version ".tar.gz" ))
905 (sha256
906 (base32 "0l7n427njif53npqn02gfjjly8y3khbrkzqxp10j5vp9h97psgiw"))))
907 (build-system gnu-build-system)
908 (arguments
909 `(#:phases
910 (modify-phases %standard-phases
911 ;; test_conv.ws keep failing so disabling for now.
912 (add-after 'unpack 'disable-test-conv
913 (lambda _
914 (delete-file "test/workspaces/test_conv.ws")
915 #t))
916 (add-before 'check 'set-home
917 (lambda _
918 (setenv "HOME" "/tmp") #t)))))
919 (inputs
920 (list vips
921 glib
922 libtiff
923 gtk+-2
924 libxml2
925 libexif
926 libjpeg-turbo ;required by vips.pc
927 (librsvg-for-system)
928 fftw
929 libgsf
930 imagemagick
931 orc
932 matio
933 lcms
934 libwebp
935 openexr-2
936 poppler
937 gsl))
938 (native-inputs
939 (list flex bison pkg-config))
940 (home-page "https://github.com/libvips/nip2")
941 (synopsis "Spreadsheet-like GUI for libvips")
942 (description "This package provide a graphical user interface (GUI) for
943the VIPS image processing library. It's a little like a spreadsheet: you
944create a set of formula connecting your objects together, and on a change nip2
945recalculates.")
946 (license license:gpl2+)))
947
948(define-public paraview
949 (package
950 (name "paraview")
951 (version "5.11.1")
952 (source
953 (origin
954 (method git-fetch)
955 (uri (git-reference
956 (url "https://gitlab.kitware.com/paraview/paraview.git")
957 (commit (string-append "v" version))
958 (recursive? #t)))
959 (file-name (git-file-name name version))
960 (sha256
961 (base32 "0m1lgkl95f0pyhxp97gq2rf8hibv39v4c49imfj1va40z0flvard"))
962 (modules '((guix build utils)))
963 (snippet
964 ;; TODO: Also remove unused bundled libraries and plugins?
965 #~(begin
966 ;; Remove bundled ParaView libraries which are available in Guix
967 ;; or undesired.
968 (for-each (lambda (dir)
969 (delete-file-recursively
970 (string-append "ThirdParty/" dir "/vtk"
971 (string-downcase dir))))
972 '(;;"CosmoHaloFinder"
973 ;;"IceT"
974 "NvPipe" ; Don't want NvPipe support
975 ;;"QtTesting"
976 ;;"cinema"
977 ;;"cinemasci"
978 "protobuf"))
979 ;; Remove undesired ParaView plugins.
980 (delete-file-recursively "Plugins/pvNVIDIAIndeX")
981 ;; Remove bundled VTK libraries which are available in Guix.
982 (for-each (lambda (dir)
983 (delete-file-recursively
984 (string-append "VTK/ThirdParty/" dir "/vtk" dir)))
985 '(;;"cgns"
986 "cli11"
987 ;;"diy2"
988 "doubleconversion"
989 "eigen"
990 ;;"exodusII"
991 "expat"
992 ;;"exprtk"
993 ;;"fides"
994 "fmt"
995 "freetype"
996 "gl2ps"
997 "glew"
998 ;;"h5part"
999 "hdf5"
1000 ;;"ioss"
1001 "jpeg"
1002 "jsoncpp"
1003 ;;"kissfft"
1004 ;;"libharu" ; Requires some PRs applied to 2.3.0
1005 "libproj"
1006 "libxml2"
1007 ;;"loguru"
1008 "lz4"
1009 "lzma"
1010 "mpi4py"
1011 "netcdf"
1012 "nlohmannjson"
1013 "ogg"
1014 ;;"pegtl"
1015 "png"
1016 "pugixml"
1017 "sqlite"
1018 "theora"
1019 "tiff"
1020 "utf8"
1021 ;;"verdict"
1022 ;;"vpic"
1023 ;;"vtkm"
1024 ;;"xdmf2"
1025 ;;"xdmf3"
1026 ;;"zfp"
1027 "zlib"))))))
1028 (build-system qt-build-system)
1029 (arguments
1030 (list
1031 #:build-type "Release" ; 542 MiB in release mode
1032 #:tests? #f ; Downloads test data
1033 #:configure-flags
1034 #~(let ((doc (string-append #$output "/share/doc/" #$name "-" #$version)))
1035 (list
1036 (string-append "-DCMAKE_INSTALL_DOCDIR=" doc) ; For paraview.qch
1037
1038 ;; ParaView build options
1039 "-DPARAVIEW_BUILD_DEVELOPER_DOCUMENTATION=ON"
1040 (string-append "-DPARAVIEW_GENERATED_DOCUMENTATION_OUTPUT_DIRECTORY=" doc)
1041
1042 ;; ParaView capability options
1043 ;;"-DPARAVIEW_USE_EXTERNAL_VTK=ON" ; Unsupported by ParaView
1044 "-DPARAVIEW_USE_MPI=ON"
1045 "-DPARAVIEW_USE_PYTHON=ON"
1046 "-DPARAVIEW_USE_QTWEBENGINE=ON"
1047
1048 ;; ParaView features
1049 ;;
1050 ;; Enable those that are disabled by default.
1051 ;; Commented means the dependencies are missing from Guix
1052 ;; (or are otherwise described).
1053 ;;"-DPARAVIEW_ENABLE_ADIOS2=ON"
1054 ;;"-DPARAVIEW_ENABLE_COSMOTOOLS=ON"
1055 ;;"-DPARAVIEW_ENABLE_CATALYST=ON"
1056 "-DPARAVIEW_ENABLE_FFMPEG=ON"
1057 ;;"-DPARAVIEW_ENABLE_FIDES=ON"
1058 "-DPARAVIEW_ENABLE_GDAL=ON"
1059 ;;"-DPARAVIEW_ENABLE_LAS=ON"
1060 ;;"-DPARAVIEW_ENABLE_LOOKINGGLASS=ON" ; Downloads dependency
1061 ;;"-DPARAVIEW_ENABLE_MOMENTINVARIANTS=ON" ; Downloads dependency
1062 "-DPARAVIEW_ENABLE_MOTIONFX=ON"
1063 ;;"-DPARAVIEW_ENABLE_OPENTURNS=ON"
1064 ;;"-DPARAVIEW_ENABLE_OPENVDB=ON" ; Dependency not found
1065 ;;"-DPARAVIEW_ENABLE_PDAL=ON"
1066 ;;"-DPARAVIEW_ENABLE_RAYTRACING=ON"
1067 "-DPARAVIEW_ENABLE_VISITBRIDGE=ON"
1068 "-DPARAVIEW_ENABLE_XDMF3=ON"
1069
1070 ;; ParaView miscellaneous options
1071 ;;
1072 ;; Without -DPARAVIEW_DATA_EXCLUDE_FROM_ALL=OFF, test data is
1073 ;; downloaded even with tests disabled.
1074 "-DPARAVIEW_VERSIONED_INSTALL=OFF"
1075 "-DPARAVIEW_DATA_EXCLUDE_FROM_ALL=OFF"
1076
1077 ;; ParaView plugins
1078 ;;
1079 ;; Enable those that are disabled by default.
1080 ;; Commented means the dependencies are missing from Guix
1081 ;; (or are otherwise described).
1082 ;;"-DPARAVIEW_PLUGIN_ENABLE_AdiosReaderPixie=ON"
1083 ;;"-DPARAVIEW_PLUGIN_ENABLE_AdiosReaderStaging=ON"
1084 "-DPARAVIEW_PLUGIN_ENABLE_CAVEInteraction=ON"
1085 ;;"-DPARAVIEW_PLUGIN_ENABLE_CDIReader=ON"
1086 "-DPARAVIEW_PLUGIN_ENABLE_GeographicalMap=ON"
1087 "-DPARAVIEW_PLUGIN_ENABLE_GmshIO=ON"
1088 "-DPARAVIEW_PLUGIN_ENABLE_InSituExodus=ON"
1089 ;;"-DPARAVIEW_PLUGIN_ENABLE_LookingGlass=ON"
1090 "-DPARAVIEW_PLUGIN_ENABLE_NetCDFTimeAnnotationPlugin=ON"
1091 ;;"-DPARAVIEW_PLUGIN_ENABLE_ParFlow=ON" ; Build fails
1092 ;;"-DPARAVIEW_PLUGIN_ENABLE_PythonQtPlugin=ON"
1093 "-DPARAVIEW_PLUGIN_ENABLE_SpaceMouseInteractor=ON"
1094 ;;"-DPARAVIEW_PLUGIN_ENABLE_VDFReaderPlugin=ON"
1095 ;;"-DPARAVIEW_PLUGIN_ENABLE_XRInterface=ON" ; Build fails
1096 ;;"-DPARAVIEW_PLUGIN_ENABLE_zSpace=ON"
1097
1098 ;; VTK options
1099 "-DVTK_SMP_IMPLEMENTATION_TYPE=TBB"
1100 "-DVTKm_ENABLE_MPI=ON"
1101
1102 ;; External libraries for ParaView and VTK
1103 "-DVTK_MODULE_USE_EXTERNAL_ParaView_protobuf=ON"
1104 "-DVTK_MODULE_USE_EXTERNAL_VTK_cli11=ON"
1105 "-DVTK_MODULE_USE_EXTERNAL_VTK_doubleconversion=ON"
1106 "-DVTK_MODULE_USE_EXTERNAL_VTK_eigen=ON"
1107 "-DVTK_MODULE_USE_EXTERNAL_VTK_expat=ON"
1108 "-DVTK_MODULE_USE_EXTERNAL_VTK_fmt=ON"
1109 "-DVTK_MODULE_USE_EXTERNAL_VTK_freetype=ON"
1110 "-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=ON"
1111 "-DVTK_MODULE_USE_EXTERNAL_VTK_glew=ON"
1112 "-DVTK_MODULE_USE_EXTERNAL_VTK_hdf5=ON"
1113 "-DVTK_MODULE_USE_EXTERNAL_VTK_jpeg=ON"
1114 "-DVTK_MODULE_USE_EXTERNAL_VTK_jsoncpp=ON"
1115 "-DVTK_MODULE_USE_EXTERNAL_VTK_libproj=ON"
1116 "-DVTK_MODULE_USE_EXTERNAL_VTK_libxml2=ON"
1117 "-DVTK_MODULE_USE_EXTERNAL_VTK_lz4=ON"
1118 "-DVTK_MODULE_USE_EXTERNAL_VTK_lzma=ON"
1119 "-DVTK_MODULE_USE_EXTERNAL_VTK_mpi4py=ON"
1120 "-DVTK_MODULE_USE_EXTERNAL_VTK_netcdf=ON"
1121 "-DVTK_MODULE_USE_EXTERNAL_VTK_nlohmannjson=ON"
1122 "-DVTK_MODULE_USE_EXTERNAL_VTK_ogg=ON"
1123 ;;"-DVTK_MODULE_USE_EXTERNAL_VTK_pegtl=ON"
1124 "-DVTK_MODULE_USE_EXTERNAL_VTK_png=ON"
1125 "-DVTK_MODULE_USE_EXTERNAL_VTK_pugixml=ON"
1126 "-DVTK_MODULE_USE_EXTERNAL_VTK_sqlite=ON"
1127 "-DVTK_MODULE_USE_EXTERNAL_VTK_theora=ON"
1128 "-DVTK_MODULE_USE_EXTERNAL_VTK_tiff=ON"
1129 "-DVTK_MODULE_USE_EXTERNAL_VTK_utf8=ON"
1130 "-DVTK_MODULE_USE_EXTERNAL_VTK_zlib=ON"))
1131 #:phases
1132 #~(modify-phases %standard-phases
1133 (add-after 'set-paths 'hide-gfortran
1134 (lambda _
1135 (setenv "CPLUS_INCLUDE_PATH"
1136 (string-join
1137 (delete (string-append #$(this-package-native-input "gfortran")
1138 "/include/c++")
1139 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
1140 ":"))))
1141 (replace 'install-license-files
1142 (lambda _
1143 (let ((src (string-append #$output "/share/licenses/ParaView"))
1144 (dst (string-append #$output "/share/doc/"
1145 #$name "-" #$version "/licenses")))
1146 (copy-recursively src dst)
1147 (delete-file-recursively (dirname src))))))))
1148 (native-inputs
1149 (list gfortran
1150 ;; For the documentation
1151 doxygen
1152 graphviz
1153 perl
1154 python-sphinx))
1155 (inputs
1156 (list boost
1157 cli11
1158 curl
1159 double-conversion
1160 eigen
1161 expat
1162 ffmpeg
1163 fmt
1164 freetype
1165 gdal
1166 gl2ps
1167 glew
1168 gmsh
1169 hdf5
1170 nlohmann-json ;For ParFlow; build fails
1171 jsoncpp
1172 libjpeg-turbo
1173 libogg
1174 libpng
1175 libtheora
1176 libtiff
1177 libxcursor
1178 libxml2
1179 libxt
1180 lz4
1181 lzip
1182 mesa
1183 netcdf
1184 openmpi
1185 ;;openvdb ;For OpenVDB; dependency not found
1186 ;;openvr ;For XRInterface; build fails
1187 ;;pegtl ;For VTK; build fails
1188 proj
1189 protobuf
1190 pugixml
1191 python-cftime
1192 python-matplotlib
1193 python-mpi4py
1194 python-numpy
1195 python-wrapper
1196 qtbase-5
1197 qtdeclarative-5
1198 qtmultimedia-5
1199 qtsvg-5
1200 qttools-5
1201 qtwebchannel-5
1202 qtwebengine-5
1203 qtx11extras
1204 qtxmlpatterns
1205 sdl2
1206 sqlite
1207 tbb
1208 utfcpp
1209 zlib))
1210 (home-page "https://www.paraview.org/")
1211 (synopsis "VTK-based, parallel data analyzer and visualizer")
1212 (description "ParaView is a VTK-based, parallel data analyzer and
1213visualizer which allows exploring data interactively in 3D or
1214programmatically.")
1215 (license license:bsd-3)))
1216
1217(define-public vxl
1218 (package
1219 (name "vxl")
1220 (version "2.0.2")
1221 (source
1222 (origin
1223 (method git-fetch)
1224 (uri (git-reference
1225 (url "https://github.com/vxl/vxl")
1226 (commit (string-append "v" version))))
1227 (file-name (git-file-name name version))
1228 (sha256
1229 (base32 "0949hw57szq8943f1whwqaz591xjmb19kj803hcv74hdai2b0ycg"))
1230 (modules '((guix build utils)))
1231 ;; TODO: vxl includes an old version of dcmtk. It won't build with
1232 ;; version 3.6.x.
1233 (snippet
1234 '(begin
1235 (for-each delete-file-recursively
1236 '("v3p/bzlib/"
1237 "v3p/geotiff/"
1238 "v3p/jpeg/"
1239 "v3p/png/"
1240 "v3p/tiff/"
1241 "v3p/zlib/"))
1242 (substitute* "v3p/CMakeLists.txt"
1243 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
1244 ""))
1245 #t))))
1246 (build-system cmake-build-system)
1247 (inputs
1248 (list libgeotiff libtiff libjpeg-turbo libpng zlib))
1249 (home-page "https://github.com/vxl/vxl/")
1250 (synopsis "Collection of C++ libraries for computer vision")
1251 (description "VXL (the Vision-something-Libraries) is a collection of C++
1252libraries designed for computer vision research and implementation.")
1253 (license license:bsd-3)))
1254
1255(define-public vxl-1
1256 (package (inherit vxl)
1257 (name "vxl")
1258 (version "1.18.0")
1259 (source
1260 (origin
1261 (method git-fetch)
1262 (uri (git-reference
1263 (url "https://github.com/vxl/vxl")
1264 (commit (string-append "v" version))))
1265 (file-name (git-file-name name version))
1266 (sha256
1267 (base32 "1g4mr2cc58jwm0vasscbd4y5380wj3ahkvq121z4gs83fhavvxgz"))
1268 (modules '((guix build utils)))
1269 (snippet
1270 '(begin
1271 (for-each delete-file-recursively
1272 '("v3p/bzlib/"
1273 "v3p/geotiff/"
1274 "v3p/png/"
1275 "v3p/tiff/"
1276 "v3p/zlib/"))
1277 (substitute* "v3p/CMakeLists.txt"
1278 (("add_subdirectory\\((tiff|png|jpeg|zlib|bzlib|geotiff)\\)")
1279 ""))
1280 #t))))
1281 (arguments
1282 `(#:configure-flags
1283 ;; Needed for itk-snap
1284 (list "-DVNL_CONFIG_LEGACY_METHODS=ON")))))
1285
1286(define-public insight-toolkit
1287 (package
1288 (name "insight-toolkit")
1289 (version "5.0.0")
1290 (source
1291 (origin
1292 (method url-fetch)
1293 (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
1294 "releases/download/v" version "/InsightToolkit-"
1295 version ".tar.xz"))
1296 (sha256
1297 (base32 "0bs63mk4q8jmx38f031jy5w5n9yy5ng9x8ijwinvjyvas8cichqi"))))
1298 (build-system cmake-build-system)
1299 (arguments
1300 (list #:tests? #f ; tests require network access and external data
1301 #:configure-flags #~'("-DITK_USE_GPU=ON"
1302 "-DITK_USE_SYSTEM_LIBRARIES=ON"
1303 "-DITK_USE_SYSTEM_GOOGLETEST=ON"
1304 "-DITK_BUILD_SHARED=ON"
1305 ;; This prevents "GTest::GTest" from being added to the ITK_LIBRARIES
1306 ;; variable in the installed CMake files. This is necessary as other
1307 ;; packages using insight-toolkit could not be configured otherwise.
1308 "-DGTEST_ROOT=gtest"
1309 "-DCMAKE_CXX_STANDARD=17")
1310
1311 #:phases #~(modify-phases %standard-phases
1312 (add-after 'unpack 'do-not-tune
1313 (lambda _
1314 (substitute* "CMake/ITKSetStandardCompilerFlags.cmake"
1315 (("-mtune=native")
1316 "")))))))
1317 (inputs
1318 (list eigen
1319 expat
1320 fftw
1321 fftwf
1322 hdf5
1323 libjpeg-turbo
1324 libpng
1325 libtiff
1326 mesa-opencl
1327 perl
1328 python
1329 tbb
1330 vxl-1
1331 zlib))
1332 (native-inputs
1333 (list googletest pkg-config))
1334
1335 ;; The 'CMake/ITKSetStandardCompilerFlags.cmake' file normally sets
1336 ;; '-mtune=native -march=corei7', suggesting there's something to be
1337 ;; gained from CPU-specific optimizations.
1338 (properties '((tunable? . #t)))
1339
1340 (home-page "https://github.com/InsightSoftwareConsortium/ITK/")
1341 (synopsis "Scientific image processing, segmentation and registration")
1342 (description "The Insight Toolkit (ITK) is a toolkit for N-dimensional
1343scientific image processing, segmentation, and registration. Segmentation is
1344the process of identifying and classifying data found in a digitally sampled
1345representation. Typically the sampled representation is an image acquired
1346from such medical instrumentation as CT or MRI scanners. Registration is the
1347task of aligning or developing correspondences between data. For example, in
1348the medical environment, a CT scan may be aligned with a MRI scan in order to
1349combine the information contained in both.")
1350 (license license:asl2.0)))
1351
1352(define-public insight-toolkit-4
1353 (package (inherit insight-toolkit)
1354 (version "4.13.2")
1355 (source
1356 (origin
1357 (method url-fetch)
1358 (uri (string-append "https://github.com/InsightSoftwareConsortium/ITK/"
1359 "releases/download/v" version "/InsightToolkit-"
1360 version ".tar.xz"))
1361 (sha256
1362 (base32 "19cgfpd63gqrvc3m27m394gy2d7w79g5y6lvznb5qqr49lihbgns"))))
1363 (arguments
1364 (list #:tests? #f ; tests require network access and external data
1365 #:configure-flags #~'("-DITKV3_COMPATIBILITY=ON" ; needed for itk-snap
1366 "-DITK_USE_GPU=ON"
1367 "-DITK_USE_SYSTEM_LIBRARIES=ON"
1368 "-DITK_USE_SYSTEM_GOOGLETEST=ON"
1369 "-DITK_USE_SYSTEM_VXL=ON")))))
1370
1371(define-public insight-toolkit-4.12
1372 (package (inherit insight-toolkit-4)
1373 (version "4.12.2")
1374 (source
1375 (origin
1376 (method url-fetch)
1377 (uri (string-append "mirror://sourceforge/itk/itk/4.12/"
1378 "InsightToolkit-" version ".tar.xz"))
1379 (sha256
1380 (base32 "1qw9mxbh083siljygahl4gdfv91xvfd8hfl7ghwii19f60xrvn2w"))))))
1381
1382(define-public itk-snap
1383 (package
1384 (name "itk-snap")
1385 (version "3.8.0")
1386 (source
1387 (origin
1388 (method git-fetch)
1389 (uri (git-reference
1390 (url "https://git.code.sf.net/p/itk-snap/src")
1391 (commit (string-append "v" version))))
1392 (file-name (git-file-name name version))
1393 (sha256
1394 (base32 "15i5ixpryfrbf3vrrb5rici8fb585f25k0v1ljds16bp1f1msr4q"))
1395 (patches (search-patches "itk-snap-alt-glibc-compat.patch"))))
1396 (build-system cmake-build-system)
1397 (arguments
1398 `(#:configure-flags
1399 (list "-DSNAP_VERSION_GIT_SHA1=release"
1400 "-DSNAP_VERSION_GIT_BRANCH=release"
1401 "-DSNAP_VERSION_GIT_TIMESTAMP=0"
1402 "-DSNAP_PACKAGE_QT_PLUGINS=OFF"
1403 "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
1404 #:phases
1405 (modify-phases %standard-phases
1406 ;; During the installation phase all libraries provided by all
1407 ;; dependencies will be copied to the lib directory. That's insane,
1408 ;; so we disable this.
1409 (add-after 'unpack 'do-not-copy-dependencies
1410 (lambda _
1411 (substitute* "CMakeLists.txt"
1412 (("install_qt5_executable\
1413\\(\\$\\{SNAP_MAIN_INSTALL_DIR\\}/\\$\\{SNAP_EXE\\}\\)")
1414 ""))))
1415 (add-after 'unpack 'disable-gui-tests
1416 (lambda _
1417 ;; The GUI tests just time out.
1418 (substitute* "CMakeLists.txt"
1419 ((" (Workspace|DiffSpace|ProbeIntensity|RegionCompetition\
1420|RandomForest|RandomForestBailOut)")
1421 ""))))
1422 (add-after 'unpack 'make-reproducible
1423 (lambda _
1424 (substitute* "CMakeLists.txt"
1425 (("TODAY\\(SNAP_VERSION_COMPILE_DATE\\)")
1426 "SET(SNAP_VERSION_COMPILE_DATE \"(removed for reproducibility)\")"))))
1427 (add-after 'unpack 'prepare-submodules
1428 (lambda* (#:key inputs #:allow-other-keys)
1429 (rmdir "Submodules/c3d")
1430 (copy-recursively (assoc-ref inputs "c3d-src")
1431 "Submodules/c3d")
1432 (substitute* '("Submodules/c3d/adapters/BiasFieldCorrectionN4.cxx"
1433 "Submodules/c3d/adapters/ApplyMetric.cxx")
1434 (("vcl_") "std::"))
1435 (rmdir "Submodules/greedy")
1436 (symlink (assoc-ref inputs "greedy-src")
1437 "Submodules/greedy")))
1438 (add-after 'unpack 'fix-includes
1439 (lambda _
1440 (substitute* "GUI/Model/RegistrationModel.cxx"
1441 (("<vnl_symmetric_eigensystem.h>")
1442 "<vnl/algo/vnl_symmetric_eigensystem.h>"))))
1443 (add-before 'check 'prepare-tests
1444 (lambda _
1445 ;; Needed by at least one test.
1446 (setenv "HOME" "/tmp")))
1447 (add-after 'install 'wrap-executable
1448 (lambda* (#:key inputs outputs #:allow-other-keys)
1449 (let ((out (assoc-ref outputs "out")))
1450 (wrap-program (string-append out "/bin/itksnap")
1451 `("QT_PLUGIN_PATH" ":" prefix
1452 ,(map (lambda (label)
1453 (string-append (assoc-ref inputs label)
1454 "/lib/qt5/plugins"))
1455 '("qtbase" "qtdeclarative-5"))))))))))
1456 (inputs
1457 (list curl
1458 fftw
1459 fftwf
1460 glu
1461 hdf5
1462 mesa-opencl
1463 ;; This package does not build with either insight-toolkit 5.0.0
1464 ;; and not with 4.13. It really needs to be 4.12.
1465 insight-toolkit-4.12
1466 vtk-7
1467 qtbase-5
1468 qtdeclarative-5
1469 vxl-1
1470 zlib))
1471 (native-inputs
1472 `(("googletest" ,googletest)
1473 ("qttools-5" ,qttools-5)
1474 ("pkg-config" ,pkg-config)
1475 ("c3d-src"
1476 ,(let* ((commit "f521358db26e00002c911cc47bf463b043942ad3")
1477 (revision "1")
1478 (version (git-version "0" revision commit)))
1479 (origin
1480 (method git-fetch)
1481 (uri (git-reference
1482 (url "https://github.com/pyushkevich/c3d")
1483 (commit commit)))
1484 (file-name (git-file-name "c3d" version))
1485 (sha256
1486 (base32
1487 "0kyv3rxrxwr8c3sa9zv01lsnhk95b27gx1s870k3yi8qp52h7bx3")))))
1488 ;; We are using an arbitrary commit from 2017 because the latest
1489 ;; version breaks the build...
1490 ("greedy-src"
1491 ,(let* ((commit "97e340f7e8e66597599144947775e6039e79a0d3")
1492 (revision "1")
1493 (version (git-version "0" revision commit)))
1494 (origin
1495 (method git-fetch)
1496 (uri (git-reference
1497 (url "https://github.com/pyushkevich/greedy")
1498 (commit commit)))
1499 (file-name (git-file-name "greedy" version))
1500 (sha256
1501 (base32
1502 "0k5bc9za4jrc8z9dj08z1rkcp5xf0gnd1d2jmi1w9ny4vxh2q2ab")))))))
1503 (home-page "https://sourceforge.net/p/itk-snap/")
1504 (synopsis "Medical image segmentation")
1505 (description "ITK-SNAP is a tool for segmenting anatomical structures in
1506medical images. It provides an automatic active contour segmentation
1507pipeline, along with supporting a manual segmentation toolbox. ITK-SNAP has a
1508full-featured UI aimed at clinical researchers.")
1509 ;; This includes the submodules greedy and c3d.
1510 (license license:gpl3+)))
1511
1512(define-public metapixel
1513 ;; Follow stable branch.
1514 (let ((commit "98ee9daa093b6c334941242e63f90b1c2876eb4f"))
1515 (package
1516 (name "metapixel")
1517 (version (git-version "1.0.2" "1" commit))
1518 (source
1519 (origin
1520 (method git-fetch)
1521 (uri (git-reference
1522 (url "https://github.com/schani/metapixel")
1523 (commit commit)
1524 ;; TODO: Package rwimg and lispreader?
1525 (recursive? #t)))
1526 (file-name (git-file-name name version))
1527 (sha256
1528 (base32 "0r7n3a6bvcxkbpda4mwmrpicii09iql5z69nkjqygkwxw7ny3309"))))
1529 (build-system gnu-build-system)
1530 (inputs
1531 `(("giflib" ,giflib)
1532 ("libjpeg" ,libjpeg-turbo)
1533 ("libpng" ,libpng)
1534 ("perl" ,perl)))
1535 (native-inputs
1536 `(("pkg-config" ,pkg-config)
1537 ("docbook-xml" ,docbook-xml)
1538 ("docbook-xsl" ,docbook-xsl)
1539 ("xsltproc" ,libxslt)))
1540 (arguments
1541 `(#:tests? #f ; No tests.
1542 #:make-flags (list
1543 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1544 (string-append "MANPAGE_XSL="
1545 (assoc-ref %build-inputs "docbook-xsl")
1546 "/xml/xsl/docbook-xsl-*/manpages/docbook.xsl"))
1547 #:phases
1548 (modify-phases %standard-phases
1549 (delete 'configure)
1550 (add-before 'install 'make-local-docbook-xml
1551 (lambda* (#:key inputs #:allow-other-keys)
1552 (substitute* "metapixel.xml"
1553 (("http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd")
1554 (string-append (assoc-ref inputs "docbook-xml")
1555 "/xml/dtd/docbook/docbookx.dtd")))
1556 #t))
1557 (add-before 'install 'fix-directory-creation
1558 (lambda* (#:key outputs #:allow-other-keys)
1559 (mkdir-p (string-append (assoc-ref outputs "out") "/share/man/man1"))
1560 #t)))))
1561 (home-page "https://www.complang.tuwien.ac.at/schani/metapixel/")
1562 (synopsis "Photomosaics generator")
1563 (description "Metapixel is a program for generating photomosaics. It can
1564generate classical photomosaics, in which the source image is viewed as a
1565matrix of equally sized rectangles for each of which a matching image is
1566substituted, as well as collage-style photomosaics, in which rectangular parts
1567of the source image at arbitrary positions (i.e. not aligned to a matrix) are
1568substituted by matching images.")
1569 (license license:gpl2))))
1570
1571(define-public scantailor-advanced
1572 (let ((commit "3d1e74e6ace413733511086934a66f4e3f7a6027"))
1573 (package
1574 (name "scantailor-advanced")
1575 (version (string-append "1.0.16-" (string-take commit 7)))
1576 (source
1577 (origin
1578 (method git-fetch)
1579 (uri (git-reference
1580 (url "https://github.com/4lex4/scantailor-advanced")
1581 (commit commit)))
1582 (file-name (git-file-name name version))
1583 (sha256
1584 (base32
1585 "0kixwjb2x457dq7927hkh34c803p7yh1pmn6n61rk9shqrcg492h"))))
1586 (build-system qt-build-system)
1587 (native-inputs
1588 (list qttools-5))
1589 (inputs
1590 `(("boost" ,boost)
1591 ("libjpeg" ,libjpeg-turbo)
1592 ("libpng" ,libpng)
1593 ("libtiff" ,libtiff)
1594 ("qtbase" ,qtbase-5)
1595 ("qtsvg-5" ,qtsvg-5)
1596 ("zlib" ,zlib)))
1597 (arguments
1598 `(#:phases
1599 (modify-phases %standard-phases
1600 ;; Some tests require a display and fail with offscreen mode.
1601 (add-after 'unpack 'disable-failing-tests
1602 (lambda _
1603 (setenv "ARGS" "--exclude-regex \"imageproc_.*\"")
1604 #t)))))
1605 (home-page "https://github.com/4lex4/scantailor-advanced")
1606 (synopsis "Clean up scanned pages")
1607 (description "Scan Tailor is an interactive post-processing tool for
1608scanned pages. It performs operations such as page splitting, deskewing,
1609adding/removing borders, and others. You give it raw scans, and you get pages
1610ready to be printed or assembled into a PDF or DJVU file. Scanning, optical
1611character recognition, and assembling multi-page documents are out of scope of
1612this project.
1613
1614Scan Tailer Advanced is a fork of Scan Tailer that merges Scan Tailor Featured
1615and Scan Tailor Enhanced versions as well as including many more bug fixes.")
1616 (license license:gpl3+))))
1617
1618(define-public stiff
1619 (package
1620 (name "stiff")
1621 (version "2.4.0")
1622 (source
1623 (origin
1624 (method url-fetch)
1625 (uri (string-append "https://www.astromatic.net/download/stiff/stiff-"
1626 version ".tar.gz"))
1627 (sha256
1628 (base32 "14m92dskzw7bwsr64ha4p0mj3ndv13gwcbfic3qxrs3zq5353s7l"))))
1629 (build-system gnu-build-system)
1630 (inputs
1631 (list libtiff zlib libjpeg-turbo))
1632 (home-page "https://www.astromatic.net/software/stiff")
1633 (synopsis "Convert scientific FITS images to TIFF format")
1634 (description
1635 "STIFF is a program that converts scientific @acronym{FITS, Flexible Image
1636Transport System} images to the more popular TIFF format for illustration
1637purposes.")
1638 (license license:gpl3+)))
1639
1640(define-public python-imgviz
1641 (package
1642 (name "python-imgviz")
1643 (version "1.2.6")
1644 (source
1645 (origin
1646 ;; PyPi tarball lacks tests.
1647 (method git-fetch)
1648 (uri (git-reference
1649 (url "https://github.com/wkentaro/imgviz.git")
1650 (commit (string-append "v" version))))
1651 (file-name (git-file-name name version))
1652 (sha256
1653 (base32 "1bm0wdv5p26i8nl4kx3145cz553v401sgbpgc96sddzjfmfiydcw"))))
1654 (build-system python-build-system)
1655 (arguments
1656 `(#:phases
1657 (modify-phases %standard-phases
1658 (replace 'check
1659 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1660 (when tests?
1661 (add-installed-pythonpath inputs outputs)
1662 (invoke "pytest" "-v" "tests"))
1663 #t)))))
1664 (propagated-inputs
1665 (list python-matplotlib python-numpy python-pillow python-pyyaml))
1666 (native-inputs (list python-pytest))
1667 (home-page "http://github.com/wkentaro/imgviz")
1668 (synopsis "Image Visualization Tools")
1669 (description "Python library for object detection, semantic and instance
1670segmentation.")
1671 (license license:expat)))
1672
1673(define-public labelme
1674 (package
1675 (name "labelme")
1676 (version "4.5.13")
1677 (source
1678 (origin
1679 ;; PyPi tarball lacks tests.
1680 (method git-fetch)
1681 (uri (git-reference
1682 (url "https://github.com/wkentaro/labelme.git")
1683 (commit (string-append "v" version))))
1684 (file-name (git-file-name name version))
1685 (sha256
1686 (base32 "0cmi2xb4dgh7738l259rgwhn9l134f0vnaaqc2gflc5yr3lqhrv2"))))
1687 (build-system python-build-system)
1688 (arguments
1689 `(#:phases
1690 (modify-phases %standard-phases
1691 (add-after 'unpack 'loosen-requirements
1692 (lambda _
1693 ;; Don't require an outdated version of matplotlib.
1694 (substitute* "setup.py"
1695 (("matplotlib<3\\.3")
1696 "matplotlib"))))
1697 (add-before 'check 'start-xserver
1698 (lambda* (#:key inputs #:allow-other-keys)
1699 (let ((xorg-server (assoc-ref inputs "xorg-server")))
1700 ;; Options taken from CI workflow.
1701 (system (string-append xorg-server "/bin/Xvfb :99 -screen 0 "
1702 "1920x1200x24 -ac +extension GLX +render "
1703 "-noreset &"))
1704 (setenv "DISPLAY" ":99.0"))))
1705 (replace 'check
1706 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1707 (when tests?
1708 (add-installed-pythonpath inputs outputs)
1709 ;; Fails when invoking help2man for unknown reason.
1710 (delete-file "tests/docs_tests/man_tests/test_labelme_1.py")
1711 ;; One test hangs.
1712 (delete-file "tests/labelme_tests/widgets_tests/test_label_dialog.py")
1713 ;; Calls incompatible function signatures.
1714 (delete-file "tests/labelme_tests/widgets_tests/test_label_list_widget.py")
1715 (setenv "MPLBACKEND" "agg")
1716 (invoke "pytest" "-v" "tests" "-m" "not gpu")))))))
1717 (propagated-inputs
1718 (list python-imgviz
1719 python-matplotlib
1720 python-numpy
1721 python-pillow
1722 python-pyyaml
1723 python-qtpy
1724 python-termcolor))
1725 (native-inputs
1726 (list python-pytest python-pytest-qt xorg-server-for-tests))
1727 (home-page "https://github.com/wkentaro/labelme")
1728 (synopsis
1729 "Image Polygonal Annotation")
1730 (description
1731 "Image and video labeling tool supporting different shapes like
1732polygons, rectangles, circles, lines, points and VOC/COCO export.")
1733 (license license:gpl3+)))
1734
1735(define-public charls
1736 (package
1737 (name "charls")
1738 (version "2.3.4")
1739 (source (origin
1740 (method git-fetch)
1741 (uri (git-reference
1742 (url "https://github.com/team-charls/charls/")
1743 (commit (string-append version))))
1744 (file-name (git-file-name name version))
1745 (sha256
1746 (base32
1747 "0g3f1rfimk30rqmi7ic4i5vfphyqbbpsyyhwqq1iss9wjwaz2vs5"))))
1748 (build-system cmake-build-system)
1749 (arguments
1750 `(#:configure-flags '("-DCMAKE_BUILD_TYPE:STRING=Release"
1751 "-DBUILD_SHARED_LIBS=On")))
1752 (native-inputs (list git pkg-config))
1753 (home-page "https://github.com/team-charls/charls")
1754 (synopsis "Library for using JPEG-LS compliant images")
1755 (description
1756 "CharLS is a codec library that can be used to build applications that
1757can handle JPEG-LS compliant images. In the application you are writing you
1758can call the CharLS codec and pass it images (sometimes called raster bitmaps),
1759 to have them encoded to JPEG-LS, or JPEG-LS streams, which CharLS will decode
1760to images.")
1761 (license license:bsd-3)))
1762
1763(define-public libansilove
1764 (package
1765 (name "libansilove")
1766 (version "1.4.1")
1767 (source (origin
1768 (method git-fetch)
1769 (uri (git-reference
1770 (url "https://github.com/ansilove/libansilove")
1771 (commit (string-append version))))
1772 (file-name (git-file-name name version))
1773 (sha256
1774 (base32
1775 "169njlck4a2bmf1kmjas1w594hyda543ykdnwg7fwkviij39l9z6"))))
1776 (build-system cmake-build-system)
1777 (arguments
1778 (list #:tests? #f)) ; No tests included
1779 (native-inputs
1780 (list gd))
1781 (home-page "https://www.ansilove.org/")
1782 (synopsis "Library for converting ANSI, ASCII, and other formats to PNG")
1783 (description
1784 "libansilove is a library for converting artscene file types to PNG images,
1785including ANSI (.ANS) and many others. The library primarily serves to support
1786the ansilove tool.")
1787 (license license:bsd-2)))
1788
1789(define-public ansilove
1790 (package
1791 (name "ansilove")
1792 (version "4.2.0")
1793 (source (origin
1794 (method git-fetch)
1795 (uri (git-reference
1796 (url "https://github.com/ansilove/ansilove")
1797 (commit (string-append version))))
1798 (file-name (git-file-name name version))
1799 (sha256
1800 (base32
1801 "1h9r759krjl8wi68yxs1d46qfrx6v89a8vmmv3aqym8vn9x430kh"))))
1802 (build-system cmake-build-system)
1803 (native-inputs
1804 (list libansilove))
1805 (home-page "https://www.ansilove.org/")
1806 (synopsis "ANSI and ASCII art to PNG converter")
1807 (description
1808 "AnsiLove is an ANSI and ASCII art to PNG converter, allowing to convert
1809ANSI and artscene-related file formats into PNG images, supporting ANSI (.ANS),
1810PCBoard (.PCB), Binary (.BIN), Artworx (.ADF), iCE Draw (.IDF), Tundra (.TND)
1811and XBin (.XB) formats.")
1812 (license license:bsd-2)))