From a82e6faa8b993d1f3b47a8bd22c4509f7cae7ec1 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 8 Jan 2020 21:35:21 +0100 Subject: gnu: vigra: Build with Python 3. * gnu/packages/patches/vigra-python-compat.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/image.scm (vigra)[source](patches): New field. [inputs]: Change PYTHON-2 and PYTHON2-NUMPY to PYTHON and PYTHON-NUMPY. [native-inputs]: Change from PYTHON2-NOSE to PYTHON. [arguments]: Adjust #:configure-flags accordingly. --- gnu/packages/image.scm | 14 +++++++++----- gnu/packages/patches/vigra-python-compat.patch | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/vigra-python-compat.patch (limited to 'gnu/packages') diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm index c70a60584b..298bff3450 100644 --- a/gnu/packages/image.scm +++ b/gnu/packages/image.scm @@ -19,7 +19,7 @@ ;;; Copyright © 2018 Joshua Sierles, Nextjournal ;;; Copyright © 2018 Fis Trivial ;;; Copyright © 2018 Pierre Neidhardt -;;; Copyright © 2018, 2019 Marius Bakke +;;; Copyright © 2018, 2019, 2020 Marius Bakke ;;; Copyright © 2018 Pierre-Antoine Rouby ;;; Copyright © 2018 Alex Vong ;;; Copyright © 2018 Rutger Helling @@ -76,6 +76,7 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) #:use-module (guix build-system meson) @@ -1007,6 +1008,7 @@ graphics image formats like PNG, BMP, JPEG, TIFF and others.") (uri (string-append "https://github.com/ukoethe/vigra/releases/download/" "Version-" (string-join (string-split version #\.) "-") "/vigra-" version "-src.tar.gz")) + (patches (search-patches "vigra-python-compat.patch")) (sha256 (base32 "1bqs8vx5i1bzamvv563i24gx2xxdidqyxh9iaj46mbznhc84wmm5")))) (build-system cmake-build-system) @@ -1021,12 +1023,12 @@ graphics image formats like PNG, BMP, JPEG, TIFF and others.") ("libpng" ,libpng) ("libtiff" ,libtiff) ("openexr" ,openexr) - ("python" ,python-2) ; print syntax - ("python2-numpy" ,python2-numpy) + ("python" ,python) + ("python-numpy" ,python-numpy) ("zlib" ,zlib))) (native-inputs `(("doxygen" ,doxygen) - ("python2-nose" ,python2-nose) + ("python-nose" ,python-nose) ("sphinx" ,python-sphinx))) (arguments `(#:test-target "check" @@ -1046,7 +1048,9 @@ graphics image formats like PNG, BMP, JPEG, TIFF and others.") (list "-Wno-dev" ; suppress developer mode with lots of warnings (string-append "-DVIGRANUMPY_INSTALL_DIR=" (assoc-ref %outputs "out") - "/lib/python2.7/site-packages") + "/lib/python" + ,(version-major+minor (package-version python)) + "/site-packages") ;; OpenEXR is not enabled by default. "-DWITH_OPENEXR=1" ;; Fix rounding error on 32-bit machines diff --git a/gnu/packages/patches/vigra-python-compat.patch b/gnu/packages/patches/vigra-python-compat.patch new file mode 100644 index 0000000000..63c6abb326 --- /dev/null +++ b/gnu/packages/patches/vigra-python-compat.patch @@ -0,0 +1,18 @@ +Fix build with Boost + Python 3.7. + +Taken from upstream: +https://github.com/ukoethe/vigra/commit/a6fa62663c6a6b752ed0707e95f643e25867a0f9 + +diff --git a/vigranumpy/src/core/vigranumpycore.cxx b/vigranumpy/src/core/vigranumpycore.cxx +index ec38d3636..c81c6ae52 100644 +--- a/vigranumpy/src/core/vigranumpycore.cxx ++++ b/vigranumpy/src/core/vigranumpycore.cxx +@@ -61,7 +61,7 @@ UInt32 pychecksum(python::str const & s) + return checksum(data, size); + #else + Py_ssize_t size = 0; +- char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size); ++ const char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size); + return checksum(data, size); + #endif + } -- cgit v1.2.3