diff options
author | Jake Forster <jakecameron.forster@gmail.com> | 2025-07-16 17:10:16 +0930 |
---|---|---|
committer | Andreas Enge <andreas@enge.fr> | 2025-08-02 19:38:50 +0200 |
commit | 62cd39ff0d884fb22e3cfbaafb08f56ea6d35ad7 (patch) | |
tree | 9c590278fc09cd1a527b7fe0167abedc62dd63df | |
parent | 73049ba95145231981a67d9d78252a0a007c5c2a (diff) |
gnu: Add cimg.
* gnu/packages/image-processing.scm (cimg): New variable.
Change-Id: I443dcc71864b237b6573360e27deb7a6adda8b49
Signed-off-by: Andreas Enge <andreas@enge.fr>
-rw-r--r-- | gnu/packages/image-processing.scm | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index 3b43038b05..6e42be1140 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -50,6 +50,7 @@ #:use-module (guix utils) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build-system copy) #:use-module (guix build-system qt) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) @@ -171,6 +172,58 @@ The tools in this software implement various reconstruction algorithms for Magnetic Resonance Imaging.") (license license:bsd-3))) +(define-public cimg + (package + (name "cimg") + (version "3.5.5") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/GreycLab/CImg") + (commit (string-append "v." version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "01myf3bjbc46f977r7lvr9g1hcnpfygcv2xnqvhrl2nj7955sm5x")))) + (build-system copy-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "examples" + ;; This is from upstream CI but parallelized. + (invoke "make" "-j" + (number->string (parallel-job-count)) "mlinux") + (invoke "./image2ascii") + (invoke "./generate_loop_macros") + ;; Build an example that requires an external library. + ;; Running it requires a display. + (invoke "make" "use_jpeg_buffer" + (string-append "CONF_CFLAGS=" + (string-join '("-Dcimg_display=0" + "-O3" + "-mtune=generic" + "-Dcimg_use_jpeg") + " ")) + "CONF_LIBS=-ljpeg")))))) + #:install-plan + #~'(("CImg.h" "include/") + ("plugins" "include/CImg/plugins")))) + (native-inputs (list libjpeg-turbo)) ;for 'check + (home-page "https://cimg.eu") + (synopsis "Small C++ image processing library") + (description + "The @acronym{CImg, Cool Image} Library is a small C++ toolkit for +image processing. It is made of a single header file @code{CImg.h} +that can be compiled using a minimal set of standard C++ and system +libraries. It includes a plugin mechanism to extend its functionality +with external tools and libraries.") + ;; Dual-licensed, either license applies. + (license (list license:cecill-c license:cecill)))) + (define-public dcmtk (package (name "dcmtk") |