From 3d3114cfad2addd740aa30260cf300d2831e1a8a Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Mon, 7 Feb 2022 00:36:00 +0100 Subject: [PATCH v5 24/32] gnu: Add python-pyvips. * gnu/packages/python-science.scm (python-pyvips): New variable. --- gnu/packages/image-processing.scm | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm index 272f400f67..00c8db7f34 100644 --- a/gnu/packages/image-processing.scm +++ b/gnu/packages/image-processing.scm @@ -19,6 +19,7 @@ ;;; Copyright © 2021 Paul Garlick ;;; Copyright © 2021 Guillaume Le Vaillant ;;; Copyright © 2021 Ivan Gankevich +;;; Copyright © 2022 Vivien Kraus ;;; ;;; This file is part of GNU Guix. ;;; @@ -69,6 +70,7 @@ (define-module (gnu packages image-processing) #:use-module (gnu packages icu4c) #:use-module (gnu packages image) #:use-module (gnu packages imagemagick) + #:use-module (gnu packages libffi) #:use-module (gnu packages maths) #:use-module (gnu packages pdf) #:use-module (gnu packages perl) @@ -633,6 +635,52 @@ (define-public vips due to its architecture which automatically parallelises the image workflows.") (license license:lgpl2.1+))) +(define-public python-pyvips + (package + (name "python-pyvips") + (version "2.1.16") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pyvips" version)) + (sha256 + (base32 "1vc1k8adldwf5is5gj6ihg4gxa15ypkfr8h7d1w4dy0m980h6k35")))) + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'set-pkgconfigpath + (lambda* (#:key inputs #:allow-other-keys) + (let ((path + (list->search-path-as-string + (search-path-as-list + '("lib/pkgconfig" "share/pkgconfig") + (map cdr inputs)) + ":"))) + (substitute* "pyvips/pyvips_build.py" + (("import pkgconfig") + (format #f + "\ +import os +os.environ['PKG_CONFIG_PATH'] = '~a' +import pkgconfig" + path))))))))) + (propagated-inputs + (list python-cffi python-pkgconfig)) + (inputs (list vips expat glib libgsf fftw imagemagick orc lcms openexr + imath poppler cairo librsvg matio libwebp pango libtiff + libjpeg-turbo libexif)) + (native-inputs + (list python-cffi + python-pyperf + python-pytest + python-pytest-flake8 + python-pytest-runner)) + (home-page "https://github.com/libvips/pyvips") + (synopsis "Binding for the libvips image processing library using cffi.") + (description "This package provides python bindings to libvips.") + (license license:expat))) + (define-public gmic (package (name "gmic") -- 2.34.0