From c2cd42ed11a920f481bab5e9816d156d440dcb43 Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Mon, 7 Feb 2022 00:36:00 +0100 Subject: 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 @@ #: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 @@ quickly, especially on machines with more than one CPU core. This is primarily 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") -- cgit 1.4.1