guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

28/28: gnu: vigra: Build with Python 3.


From: guix-commits
Subject: 28/28: gnu: vigra: Build with Python 3.
Date: Wed, 8 Jan 2020 15:58:51 -0500 (EST)

mbakke pushed a commit to branch core-updates
in repository guix.

commit a82e6faa8b993d1f3b47a8bd22c4509f7cae7ec1
Author: Marius Bakke <address@hidden>
AuthorDate: Wed Jan 8 21:35:21 2020 +0100

    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/local.mk                                   |  1 +
 gnu/packages/image.scm                         | 14 +++++++++-----
 gnu/packages/patches/vigra-python-compat.patch | 18 ++++++++++++++++++
 3 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 2a60a8d..802884a 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1450,6 +1450,7 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/vboot-utils-fix-format-load-address.patch       \
   %D%/packages/patches/vboot-utils-fix-tests-show-contents.patch       \
   %D%/packages/patches/vboot-utils-skip-test-workbuf.patch     \
+  %D%/packages/patches/vigra-python-compat.patch               \
   %D%/packages/patches/vinagre-newer-freerdp.patch             \
   %D%/packages/patches/vinagre-newer-rdp-parameters.patch      \
   %D%/packages/patches/virglrenderer-CVE-2017-6386.patch       \
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index c70a605..298bff3 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -19,7 +19,7 @@
 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <address@hidden>
 ;;; Copyright © 2018 Fis Trivial <address@hidden>
 ;;; Copyright © 2018 Pierre Neidhardt <address@hidden>
-;;; Copyright © 2018, 2019 Marius Bakke <address@hidden>
+;;; Copyright © 2018, 2019, 2020 Marius Bakke <address@hidden>
 ;;; Copyright © 2018 Pierre-Antoine Rouby <address@hidden>
 ;;; Copyright © 2018 Alex Vong <address@hidden>
 ;;; Copyright © 2018 Rutger Helling <address@hidden>
@@ -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 0000000..63c6abb
--- /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
+ }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]