summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2021-04-17 21:40:03 +0200
committerLars-Dominik Braun <lars@6xq.net>2021-04-18 08:36:30 +0200
commit94db80b6d1e4dbb0bfd55e27d6e7fb2cb34d90cc (patch)
tree8a21f94911fdbe28b19f62ebd95d5609a3ccc930 /gnu
parent84feaca4888c9916e1a97bb81e5d157673488b70 (diff)
gnu: Add python-imagecodecs.
* gnu/packages/python-xyz.scm (python-imagecodecs): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-xyz.scm82
1 files changed, 82 insertions, 0 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5a4220541ee..b341d7cd75a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -6082,6 +6082,88 @@ a general image processing tool.")
6082 (description "This package is a fork of Pillow which adds support for SIMD 6082 (description "This package is a fork of Pillow which adds support for SIMD
6083parallelism."))) 6083parallelism.")))
6084 6084
6085(define-public python-imagecodecs
6086 (package
6087 (name "python-imagecodecs")
6088 (version "2021.3.31")
6089 (source
6090 (origin
6091 (method url-fetch)
6092 (uri (pypi-uri "imagecodecs" version))
6093 (sha256
6094 (base32
6095 "0q7pslb6wd56vbcq2mdxwsiha32mxjr7mgqqfbq5w42q601p9pi0"))
6096 (modules '((guix build utils)))
6097 (snippet
6098 '(begin
6099 ;; Unbundle 3rd party modules.
6100 (delete-file-recursively "3rdparty")
6101 ;; Delete pre-generated Cython files.
6102 (for-each delete-file (find-files "imagecodecs" "_.*\\.c$"))
6103 #t))))
6104 (build-system python-build-system)
6105 (arguments
6106 `(#:tests? #f ; Tests are disabled, because dependencies are missing.
6107 #:phases
6108 (modify-phases %standard-phases
6109 (add-after 'unpack 'create-configuration
6110 (lambda* (#:key inputs #:allow-other-keys)
6111 ;; By default everything is enabled. We can selectively disable
6112 ;; extensions (and thus dependencies) by deleting them from the
6113 ;; EXTENSIONS dictionary. This is upstream’s preferred way.
6114 (call-with-output-file "imagecodecs_distributor_setup.py"
6115 (lambda (port)
6116 (format port "\
6117def customize_build(EXTENSIONS, OPTIONS):
6118 del EXTENSIONS['aec']
6119 del EXTENSIONS['avif']
6120 del EXTENSIONS['bitshuffle']
6121 del EXTENSIONS['deflate']
6122 del EXTENSIONS['jpeg2k']
6123 del EXTENSIONS['jpeg12']
6124 del EXTENSIONS['jpegls']
6125 del EXTENSIONS['jpegxl']
6126 del EXTENSIONS['jpegxr']
6127 del EXTENSIONS['lerc']
6128 del EXTENSIONS['ljpeg']
6129 del EXTENSIONS['lzf']
6130 del EXTENSIONS['zfp']
6131 del EXTENSIONS['zopfli']
6132 OPTIONS['cythonize']
6133")))
6134 #t)))))
6135 (inputs
6136 `(("c-blosc" ,c-blosc)
6137 ("giflib" ,giflib)
6138 ("google-brotli" ,google-brotli)
6139 ("libjpeg-turbo" ,libjpeg-turbo)
6140 ("libpng" ,libpng)
6141 ("libtiff" ,libtiff)
6142 ("libwebp" ,libwebp)
6143 ("lz4" ,lz4)
6144 ("snappy" ,snappy)
6145 ("xz" ,xz)
6146 ("zlib" ,zlib)
6147 ("zstd" ,zstd "lib")))
6148 (propagated-inputs
6149 `(("python-numpy" ,python-numpy)))
6150 (native-inputs
6151 ;; For building.
6152 `(("python-cython" ,python-cython)
6153 ;; For testing. Incomplete.
6154 ;("python-numcodecs" ,python-numcodecs)
6155 ;("python-zarr" ,python-zarr)
6156 ;("python-pytest" ,python-pytest)
6157 ))
6158 (home-page "https://www.lfd.uci.edu/~gohlke/")
6159 (synopsis
6160 "Image transformation, compression, and decompression codecs")
6161 (description
6162 "Imagecodecs is a Python library that provides block-oriented, in-memory
6163buffer transformation, compression, and decompression functions for use in the
6164tifffile, czifile, and other scientific image input/output modules.")
6165 (license license:bsd-3)))
6166
6085(define-public python-roifile 6167(define-public python-roifile
6086 (package 6168 (package
6087 (name "python-roifile") 6169 (name "python-roifile")