all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#36623] [PATCH] gnu: gdal: add python support
@ 2019-07-12 21:32 Arne Babenhauserheide
  2019-07-13  8:15 ` Julien Lepiller
  0 siblings, 1 reply; 11+ messages in thread
From: Arne Babenhauserheide @ 2019-07-12 21:32 UTC (permalink / raw)
  To: 36623; +Cc: Arne Babenhauserheide

* gnu/packages/geo.scm (gdal): add python support
---
 gnu/packages/geo.scm | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 4cccd97643..3e2ec04b53 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -537,6 +537,8 @@ development.")
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f
+       ;; validating runpath does not work yet for Python, so skip this phase.
+       #:validate-runpath? #f
        #:configure-flags
        (let-syntax ((with (syntax-rules ()
                             ((_ option input)
@@ -544,6 +546,10 @@ development.")
                                             (assoc-ref %build-inputs input))))))
          (list
            ;; TODO: --with-pcidsk, --with-pcraster
+           ;; Add $libdir to the RUNPATH of all the executables.
+           (string-append "LDFLAGS=-Wl,-rpath=" %output "/apps/.libs")
+           (string-append "LD_RUN_PATH=" %output "/apps/.libs")
+           (string-append "LD_LIBRARY_PATH=" %output "/apps/.libs")
            (with "--with-freexl" "freexl")
            (with "--with-libjson-c" "json-c")
            (with "--with-png" "libpng")
@@ -553,13 +559,27 @@ development.")
            (with "--with-libtiff" "libtiff")
            (with "--with-geotiff" "libgeotiff")
            (with "--with-libz" "zlib")
-           "--with-pcre"))
+           "--with-pcre"
+           "--with-python"))
        #:phases
        (modify-phases %standard-phases
          (add-before 'build 'fix-path
            (lambda _
              (substitute* "frmts/mrf/mrf_band.cpp"
-               (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
+               (("\"../zlib/zlib.h\"") "<zlib.h>"))))
+         (add-after
+             'unpack 'patch-test-shebangs
+           (lambda _
+             (substitute* '("apps/GNUmakefile")
+               (("/bin/sh") (which "sh")))
+             #t))
+         (add-after
+             'unpack 'patch-test-shebangs
+           (lambda _
+             (substitute* '("GDALmake.opt.in")
+               (("LDFLAGS     = @LDFLAGS@") (string-append "LDFLAGS     = @LDFLAGS@ -Wl,-rpath=" %output "/apps -Wl,-rpath=" %output "/apps/.libs")))
+             #t)
+           ))))
     (inputs
      `(("freexl" ,freexl)
        ("geos" ,geos)
@@ -572,6 +592,11 @@ development.")
        ("libwebp" ,libwebp)
        ("pcre" ,pcre)
        ("zlib" ,zlib)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (propagated-inputs
+     `(("python" ,python)
+       ("python-setuptools" ,python-setuptools)))
     (home-page "http://www.gdal.org/")
     (synopsis "Raster and vector geospatial data format library")
     (description "GDAL is a translator library for raster and vector geospatial
--
2.22.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-12 21:32 [bug#36623] [PATCH] gnu: gdal: add python support Arne Babenhauserheide
@ 2019-07-13  8:15 ` Julien Lepiller
  2019-07-13 21:14   ` Arne Babenhauserheide
  0 siblings, 1 reply; 11+ messages in thread
From: Julien Lepiller @ 2019-07-13  8:15 UTC (permalink / raw)
  To: arne_bab

Le 12 juillet 2019 23:32:47 GMT+02:00, Arne Babenhauserheide <arne_bab@web.de> a écrit :
>* gnu/packages/geo.scm (gdal): add python support
>---
> gnu/packages/geo.scm | 29 +++++++++++++++++++++++++++--
> 1 file changed, 27 insertions(+), 2 deletions(-)
>
>diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
>index 4cccd97643..3e2ec04b53 100644
>--- a/gnu/packages/geo.scm
>+++ b/gnu/packages/geo.scm
>@@ -537,6 +537,8 @@ development.")
>     (build-system gnu-build-system)
>     (arguments
>      `(#:tests? #f
>+       ;; validating runpath does not work yet for Python, so skip
>this phase.
>+       #:validate-runpath? #f
>        #:configure-flags
>        (let-syntax ((with (syntax-rules ()
>                             ((_ option input)
>@@ -544,6 +546,10 @@ development.")
>                                   (assoc-ref %build-inputs input))))))
>          (list
>            ;; TODO: --with-pcidsk, --with-pcraster
>+           ;; Add $libdir to the RUNPATH of all the executables.
>+           (string-append "LDFLAGS=-Wl,-rpath=" %output "/apps/.libs")
>+           (string-append "LD_RUN_PATH=" %output "/apps/.libs")
>+           (string-append "LD_LIBRARY_PATH=" %output "/apps/.libs")
>            (with "--with-freexl" "freexl")
>            (with "--with-libjson-c" "json-c")
>            (with "--with-png" "libpng")
>@@ -553,13 +559,27 @@ development.")
>            (with "--with-libtiff" "libtiff")
>            (with "--with-geotiff" "libgeotiff")
>            (with "--with-libz" "zlib")
>-           "--with-pcre"))
>+           "--with-pcre"
>+           "--with-python"))
>        #:phases
>        (modify-phases %standard-phases
>          (add-before 'build 'fix-path
>            (lambda _
>              (substitute* "frmts/mrf/mrf_band.cpp"
>-               (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
>+               (("\"../zlib/zlib.h\"") "<zlib.h>"))))
>+         (add-after
>+             'unpack 'patch-test-shebangs
>+           (lambda _
>+             (substitute* '("apps/GNUmakefile")
>+               (("/bin/sh") (which "sh")))
>+             #t))
>+         (add-after
>+             'unpack 'patch-test-shebangs
>+           (lambda _
>+             (substitute* '("GDALmake.opt.in")
>+               (("LDFLAGS     = @LDFLAGS@") (string-append "LDFLAGS   
>= @LDFLAGS@ -Wl,-rpath=" %output "/apps -Wl,-rpath=" %output
>"/apps/.libs")))
>+             #t)
>+           ))))

Could you rename that phase to something like 'patch-rpath? Is it needed since you already pass it to the configure?

>     (inputs
>      `(("freexl" ,freexl)
>        ("geos" ,geos)
>@@ -572,6 +592,11 @@ development.")
>        ("libwebp" ,libwebp)
>        ("pcre" ,pcre)
>        ("zlib" ,zlib)))
>+    (native-inputs
>+     `(("pkg-config" ,pkg-config)))
>+    (propagated-inputs
>+     `(("python" ,python)
>+       ("python-setuptools" ,python-setuptools)))

Is setuptools really necessary at runtime? Can we patch gdal so to embed python's store path? I'd prefer not to propagate it.

>     (home-page "http://www.gdal.org/")
>     (synopsis "Raster and vector geospatial data format library")
>(description "GDAL is a translator library for raster and vector
>geospatial
>--
>2.22.0

Thank you!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-13  8:15 ` Julien Lepiller
@ 2019-07-13 21:14   ` Arne Babenhauserheide
  2019-07-17 12:57     ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Arne Babenhauserheide @ 2019-07-13 21:14 UTC (permalink / raw)
  To: Julien Lepiller; +Cc: 36623


[-- Attachment #1.1: Type: text/plain, Size: 3746 bytes --]


Julien Lepiller <julien@lepiller.eu> writes:

> Le 12 juillet 2019 23:32:47 GMT+02:00, Arne Babenhauserheide <arne_bab@web.de> a écrit :
>>* gnu/packages/geo.scm (gdal): add python support
>>---
>> gnu/packages/geo.scm | 29 +++++++++++++++++++++++++++--
>> 1 file changed, 27 insertions(+), 2 deletions(-)
>>
>>diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
>>index 4cccd97643..3e2ec04b53 100644
>>--- a/gnu/packages/geo.scm
>>+++ b/gnu/packages/geo.scm
>>@@ -537,6 +537,8 @@ development.")
>>     (build-system gnu-build-system)
>>     (arguments
>>      `(#:tests? #f
>>+       ;; validating runpath does not work yet for Python, so skip
>>this phase.
>>+       #:validate-runpath? #f
>>        #:configure-flags
>>        (let-syntax ((with (syntax-rules ()
>>                             ((_ option input)
>>@@ -544,6 +546,10 @@ development.")
>>                                   (assoc-ref %build-inputs input))))))
>>          (list
>>            ;; TODO: --with-pcidsk, --with-pcraster
>>+           ;; Add $libdir to the RUNPATH of all the executables.
>>+           (string-append "LDFLAGS=-Wl,-rpath=" %output "/apps/.libs")
>>+           (string-append "LD_RUN_PATH=" %output "/apps/.libs")
>>+           (string-append "LD_LIBRARY_PATH=" %output "/apps/.libs")
>>            (with "--with-freexl" "freexl")
>>            (with "--with-libjson-c" "json-c")
>>            (with "--with-png" "libpng")
>>@@ -553,13 +559,27 @@ development.")
>>            (with "--with-libtiff" "libtiff")
>>            (with "--with-geotiff" "libgeotiff")
>>            (with "--with-libz" "zlib")
>>-           "--with-pcre"))
>>+           "--with-pcre"
>>+           "--with-python"))
>>        #:phases
>>        (modify-phases %standard-phases
>>          (add-before 'build 'fix-path
>>            (lambda _
>>              (substitute* "frmts/mrf/mrf_band.cpp"
>>-               (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
>>+               (("\"../zlib/zlib.h\"") "<zlib.h>"))))
>>+         (add-after
>>+             'unpack 'patch-test-shebangs
>>+           (lambda _
>>+             (substitute* '("apps/GNUmakefile")
>>+               (("/bin/sh") (which "sh")))
>>+             #t))
>>+         (add-after
>>+             'unpack 'patch-test-shebangs
>>+           (lambda _
>>+             (substitute* '("GDALmake.opt.in")
>>+               (("LDFLAGS     = @LDFLAGS@") (string-append "LDFLAGS   
>>= @LDFLAGS@ -Wl,-rpath=" %output "/apps -Wl,-rpath=" %output
>>"/apps/.libs")))
>>+             #t)
>>+           ))))
>
> Could you rename that phase to something like 'patch-rpath? Is it needed since you already pass it to the configure?

Renamed, see the new patch :-)

I did not get this to work without it.

>>     (inputs
>>      `(("freexl" ,freexl)
>>        ("geos" ,geos)
>>@@ -572,6 +592,11 @@ development.")
>>        ("libwebp" ,libwebp)
>>        ("pcre" ,pcre)
>>        ("zlib" ,zlib)))
>>+    (native-inputs
>>+     `(("pkg-config" ,pkg-config)))
>>+    (propagated-inputs
>>+     `(("python" ,python)
>>+       ("python-setuptools" ,python-setuptools)))
>
> Is setuptools really necessary at runtime? Can we patch gdal so to embed python's store path? I'd prefer not to propagate it.

I’m not really sure why it is, but I did not get it working
without. Activating Python-support was harder than I thought (but I need
it working for a project on a deadline).

>>     (home-page "http://www.gdal.org/")
>>     (synopsis "Raster and vector geospatial data format library")
>>(description "GDAL is a translator library for raster and vector
>>geospatial
>>--
>>2.22.0
>
> Thank you!

Thank you for reviewing!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-gdal-add-python-support.patch --]
[-- Type: text/x-patch, Size: 3101 bytes --]

From 5f8b1dc1bb5ce7b061bcca10174f9330cf89696c Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab@web.de>
Date: Sat, 11 May 2019 15:16:22 +0200
Subject: [PATCH] gnu: gdal: add python support

* gnu/packages/geo.scm (gdal): add python support
---
 gnu/packages/geo.scm | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 4cccd97643..a6942d2a45 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -537,6 +537,8 @@ development.")
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f
+       ;; validating runpath does not work yet for Python, so skip this phase.
+       #:validate-runpath? #f
        #:configure-flags
        (let-syntax ((with (syntax-rules ()
                             ((_ option input)
@@ -544,6 +546,10 @@ development.")
                                             (assoc-ref %build-inputs input))))))
          (list
            ;; TODO: --with-pcidsk, --with-pcraster
+           ;; Add $libdir to the RUNPATH of all the executables.
+           (string-append "LDFLAGS=-Wl,-rpath=" %output "/apps/.libs")
+           (string-append "LD_RUN_PATH=" %output "/apps/.libs")
+           (string-append "LD_LIBRARY_PATH=" %output "/apps/.libs")
            (with "--with-freexl" "freexl")
            (with "--with-libjson-c" "json-c")
            (with "--with-png" "libpng")
@@ -553,13 +559,27 @@ development.")
            (with "--with-libtiff" "libtiff")
            (with "--with-geotiff" "libgeotiff")
            (with "--with-libz" "zlib")
-           "--with-pcre"))
+           "--with-pcre"
+           "--with-python"))
        #:phases
        (modify-phases %standard-phases
          (add-before 'build 'fix-path
            (lambda _
              (substitute* "frmts/mrf/mrf_band.cpp"
-               (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
+               (("\"../zlib/zlib.h\"") "<zlib.h>"))))
+         (add-after
+             'unpack 'patch-test-shebangs
+           (lambda _
+             (substitute* '("apps/GNUmakefile")
+               (("/bin/sh") (which "sh")))
+             #t))
+         (add-after
+             'unpack 'patch-rpath
+           (lambda _
+             (substitute* '("GDALmake.opt.in")
+               (("LDFLAGS     = @LDFLAGS@") (string-append "LDFLAGS     = @LDFLAGS@ -Wl,-rpath=" %output "/apps -Wl,-rpath=" %output "/apps/.libs")))
+             #t)
+           ))))
     (inputs
      `(("freexl" ,freexl)
        ("geos" ,geos)
@@ -572,6 +592,11 @@ development.")
        ("libwebp" ,libwebp)
        ("pcre" ,pcre)
        ("zlib" ,zlib)))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (propagated-inputs
+     `(("python" ,python)
+       ("python-setuptools" ,python-setuptools)))
     (home-page "http://www.gdal.org/")
     (synopsis "Raster and vector geospatial data format library")
     (description "GDAL is a translator library for raster and vector geospatial
-- 
2.22.0


[-- Attachment #1.3: Type: text/plain, Size: 87 bytes --]


Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-13 21:14   ` Arne Babenhauserheide
@ 2019-07-17 12:57     ` Ludovic Courtès
  2019-07-17 16:22       ` Arne Babenhauserheide
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2019-07-17 12:57 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: 36623

Hello!

Complementing Julien’s feedback…

Arne Babenhauserheide <arne_bab@web.de> skribis:

> From 5f8b1dc1bb5ce7b061bcca10174f9330cf89696c Mon Sep 17 00:00:00 2001
> From: Arne Babenhauserheide <arne_bab@web.de>
> Date: Sat, 11 May 2019 15:16:22 +0200
> Subject: [PATCH] gnu: gdal: add python support
>
> * gnu/packages/geo.scm (gdal): add python support
> ---
>  gnu/packages/geo.scm | 29 +++++++++++++++++++++++++++--
>  1 file changed, 27 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
> index 4cccd97643..a6942d2a45 100644
> --- a/gnu/packages/geo.scm
> +++ b/gnu/packages/geo.scm
> @@ -537,6 +537,8 @@ development.")
>      (build-system gnu-build-system)
>      (arguments
>       `(#:tests? #f
> +       ;; validating runpath does not work yet for Python, so skip this phase.
> +       #:validate-runpath? #f

What happens when you let the ‘validate-runpath’ phase run?

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-17 12:57     ` Ludovic Courtès
@ 2019-07-17 16:22       ` Arne Babenhauserheide
  2019-07-19 12:07         ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Arne Babenhauserheide @ 2019-07-17 16:22 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 36623

[-- Attachment #1: Type: text/plain, Size: 4709 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

> Hello!
>
> Complementing Julien’s feedback…
>
> Arne Babenhauserheide <arne_bab@web.de> skribis:
>
>> From 5f8b1dc1bb5ce7b061bcca10174f9330cf89696c Mon Sep 17 00:00:00 2001
>> From: Arne Babenhauserheide <arne_bab@web.de>
>> Date: Sat, 11 May 2019 15:16:22 +0200
>> Subject: [PATCH] gnu: gdal: add python support
>>
>> * gnu/packages/geo.scm (gdal): add python support
>> ---
>>  gnu/packages/geo.scm | 29 +++++++++++++++++++++++++++--
>>  1 file changed, 27 insertions(+), 2 deletions(-)
>>
>> diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
>> index 4cccd97643..a6942d2a45 100644
>> --- a/gnu/packages/geo.scm
>> +++ b/gnu/packages/geo.scm
>> @@ -537,6 +537,8 @@ development.")
>>      (build-system gnu-build-system)
>>      (arguments
>>       `(#:tests? #f
>> +       ;; validating runpath does not work yet for Python, so skip this phase.
>> +       #:validate-runpath? #f
>
> What happens when you let the ‘validate-runpath’ phase run?

\ 'validate-runpath' phasebuilder for `/gnu/store/ykfnx8m38ndnggdqsv1fbgf3ycry5f88-gdal-2.2.4.drv' failed with exit code 1
build of /gnu/store/ykfnx8m38ndnggdqsv1fbgf3ycry5f88-gdal-2.2.4.drv failed
View build log at '/var/log/guix/drvs/yk/fnx8m38ndnggdqsv1fbgf3ycry5f88-gdal-2.2.4.drv.bz2'.

…
starting phase `validate-runpath'
validating RUNPATH of 6 binaries in "/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib"...
/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-x86_64-linux-gnu.so: error: depends on 'libgdal.so.20', which cannot be found in RUNPATH ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib" "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_gdalconst.cpython-37m-x86_64-linux-gnu.so: error: depends on 'libgdal.so.20', which cannot be found in RUNPATH ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib" "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_gnm.cpython-37m-x86_64-linux-gnu.so: error: depends on 'libgdal.so.20', which cannot be found in RUNPATH ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib" "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_ogr.cpython-37m-x86_64-linux-gnu.so: error: depends on 'libgdal.so.20', which cannot be found in RUNPATH ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib" "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_osr.cpython-37m-x86_64-linux-gnu.so: error: depends on 'libgdal.so.20', which cannot be found in RUNPATH ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib" "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
validating RUNPATH of 24 binaries in "/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/bin"...
Backtrace:
           5 (primitive-load "/gnu/store/kzsb94cspp48r9l26y8gv9zy6la…")
In ice-9/eval.scm:
   191:35  4 (_ _)
In srfi/srfi-1.scm:
   863:16  3 (every1 #<procedure 817960 at /gnu/store/gfprsx2m62cvq…> …)
In /gnu/store/gfprsx2m62cvqbh7ysc9ay9slhijvmal-module-import/guix/build/gnu-build-system.scm:
   799:28  2 (_ _)
   558:10  1 (validate-runpath #:validate-runpath? _ # _ #:outputs _)
In unknown file:
           0 (scm-error misc-error #f "~A" ("RUNPATH validation fa…") …)

ERROR: In procedure scm-error:
RUNPATH validation failed

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-17 16:22       ` Arne Babenhauserheide
@ 2019-07-19 12:07         ` Ludovic Courtès
  2019-07-19 15:06           ` Arne Babenhauserheide
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2019-07-19 12:07 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: 36623

Hello,

Arne Babenhauserheide <arne_bab@web.de> skribis:

> validating RUNPATH of 6 binaries in "/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib"...
> /gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-x86_64-linux-gnu.so: error: depends on 'libgdal.so.20', which cannot be found in RUNPATH ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib" "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")

I’m not familiar with Cython so I don’t know how this was handled
before.  However, to me, it indicates that the resulting binaries are
unlikely to work.

Namely, Python would dlopen “_gdal.cython*.so”, and that would fail to
find ‘libgdal.so’.

Thoughts?

Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-19 12:07         ` Ludovic Courtès
@ 2019-07-19 15:06           ` Arne Babenhauserheide
  2019-07-20 14:55             ` 宋文武
  0 siblings, 1 reply; 11+ messages in thread
From: Arne Babenhauserheide @ 2019-07-19 15:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 36623

[-- Attachment #1: Type: text/plain, Size: 1322 bytes --]


Hello Ludo`,

Ludovic Courtès <ludo@gnu.org> writes:

>> validating RUNPATH of 6 binaries in "/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib"...
>> /gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-x86_64-linux-gnu.so: error: depends on 'libgdal.so.20', which cannot be found in RUNPATH ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib" "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib" "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
>
> I’m not familiar with Cython so I don’t know how this was handled
> before.  However, to me, it indicates that the resulting binaries are
> unlikely to work.
>
> Namely, Python would dlopen “_gdal.cython*.so”, and that would fail to
> find ‘libgdal.so’.
>
> Thoughts?

Yes: It does work. But I don’t know why.

Cython runs at compile-time to generate c-code that acts as interface
for Python. Given the paths in here, this needs gdal already installed
in the runpath where it seems to be missing during validation.

How can we fix that?

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-19 15:06           ` Arne Babenhauserheide
@ 2019-07-20 14:55             ` 宋文武
  2019-07-21  7:48               ` Arne Babenhauserheide
  0 siblings, 1 reply; 11+ messages in thread
From: 宋文武 @ 2019-07-20 14:55 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: 36623

[-- Attachment #1: Type: text/plain, Size: 1742 bytes --]

Arne Babenhauserheide <arne_bab@web.de> writes:

> Hello Ludo`,
>
> Ludovic Courtès <ludo@gnu.org> writes:
>
>>> validating RUNPATH of 6 binaries in "/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib"...
>>> /gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-x86_64-linux-gnu.so:
>>> error: depends on 'libgdal.so.20', which cannot be found in RUNPATH
>>> ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib"
>>> "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib"
>>> "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib"
>>> "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
>>
>> I’m not familiar with Cython so I don’t know how this was handled
>> before.  However, to me, it indicates that the resulting binaries are
>> unlikely to work.
>>
>> Namely, Python would dlopen “_gdal.cython*.so”, and that would fail to
>> find ‘libgdal.so’.

>>
>> Thoughts?
>
> Yes: It does work. But I don’t know why.

This is because the _gdal.cython*.so don't have rpath to the "lib"
directory, where libgdal.so will going.

>
> Cython runs at compile-time to generate c-code that acts as interface
> for Python. Given the paths in here, this needs gdal already installed
> in the runpath where it seems to be missing during validation.
>
> How can we fix that?

I think cython (which compile .py files to .c files) is not here..  It
has python C libraries generated by swig.
>
> Best wishes,
> Arne

In the end the python bindings for gdal can be build seperated (which
handle the missing rpath to libgdal nicely), and I prefer this way:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-python-gdal.patch --]
[-- Type: text/x-patch, Size: 1392 bytes --]

From 09254f646b948a5603b2b3dcb99a7f2f6ad0c8de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
Date: Sat, 20 Jul 2019 22:39:33 +0800
Subject: [PATCH] gnu: Add python-gdal.

For <https://issues.guix.gnu.org/issue/36623>, thank to Arne Babenhauserheide
for the original patch.

* gnu/packages/geo.scm (python-gdal): New package.
---
 gnu/packages/geo.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index e4b6a262c7..8005c46129 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -604,6 +604,25 @@ utilities for data translation and processing.")
                ;; frmts/mrf/libLERC
                license:asl2.0))))
 
+(define-public python-gdal
+  (package (inherit gdal)
+    (name "python-gdal")
+    (build-system python-build-system)
+    (arguments
+     '(#:tests? #f                      ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'chdir
+           (lambda _
+             (chdir "swig/python")
+             #t)))))
+    (native-inputs '())
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)))
+    (inputs
+     `(("gdal" ,gdal)))
+    (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
+
 (define-public postgis
   (package
     (name "postgis")
-- 
2.19.2


[-- Attachment #3: Type: text/plain, Size: 218 bytes --]


I test it with "~/src/guix/pre-inst-env guix environment --ad-hoc python
python-gdal", and in it I can run "python3 swig/python/samples/rel.py"
etc.

Does it work for you, Arne?  If so, I'll push my patch, thank you!

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-20 14:55             ` 宋文武
@ 2019-07-21  7:48               ` Arne Babenhauserheide
  2019-07-21 13:07                 ` bug#36623: " 宋文武
  2019-07-22 10:23                 ` [bug#36623] " Ludovic Courtès
  0 siblings, 2 replies; 11+ messages in thread
From: Arne Babenhauserheide @ 2019-07-21  7:48 UTC (permalink / raw)
  To: 宋文武; +Cc: 36623

[-- Attachment #1: Type: text/plain, Size: 3504 bytes --]


宋文武 <iyzsong@member.fsf.org> writes:

> Arne Babenhauserheide <arne_bab@web.de> writes:
>
>> Hello Ludo`,
>>
>> Ludovic Courtès <ludo@gnu.org> writes:
>>
>>>> validating RUNPATH of 6 binaries in "/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib"...
>>>> /gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-x86_64-linux-gnu.so:
>>>> error: depends on 'libgdal.so.20', which cannot be found in RUNPATH
>>>> ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib"
>>>> "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib"
>>>> "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib"
>>>> "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
>>>
>>> I’m not familiar with Cython so I don’t know how this was handled
>>> before.  However, to me, it indicates that the resulting binaries are
>>> unlikely to work.
>>>
>>> Namely, Python would dlopen “_gdal.cython*.so”, and that would fail to
>>> find ‘libgdal.so’.
>
>>>
>>> Thoughts?
>>
>> Yes: It does work. But I don’t know why.
>
> This is because the _gdal.cython*.so don't have rpath to the "lib"
> directory, where libgdal.so will going.
>
>>
>> Cython runs at compile-time to generate c-code that acts as interface
>> for Python. Given the paths in here, this needs gdal already installed
>> in the runpath where it seems to be missing during validation.
>>
>> How can we fix that?
>
> I think cython (which compile .py files to .c files) is not here..  It
> has python C libraries generated by swig.
>>
>> Best wishes,
>> Arne
>
> In the end the python bindings for gdal can be build seperated (which
> handle the missing rpath to libgdal nicely), and I prefer this way:
>
> From 09254f646b948a5603b2b3dcb99a7f2f6ad0c8de Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
> Date: Sat, 20 Jul 2019 22:39:33 +0800
> Subject: [PATCH] gnu: Add python-gdal.
>
> For <https://issues.guix.gnu.org/issue/36623>, thank to Arne Babenhauserheide
> for the original patch.
>
> * gnu/packages/geo.scm (python-gdal): New package.
> ---
>  gnu/packages/geo.scm | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>
> diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
> index e4b6a262c7..8005c46129 100644
> --- a/gnu/packages/geo.scm
> +++ b/gnu/packages/geo.scm
> @@ -604,6 +604,25 @@ utilities for data translation and processing.")
>                 ;; frmts/mrf/libLERC
>                 license:asl2.0))))
>  
> +(define-public python-gdal
> +  (package (inherit gdal)
> +    (name "python-gdal")
> +    (build-system python-build-system)
> +    (arguments
> +     '(#:tests? #f                      ; no tests
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-before 'build 'chdir
> +           (lambda _
> +             (chdir "swig/python")
> +             #t)))))
> +    (native-inputs '())
> +    (propagated-inputs
> +     `(("python-numpy" ,python-numpy)))
> +    (inputs
> +     `(("gdal" ,gdal)))
> +    (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
> +
>  (define-public postgis
>    (package
>      (name "postgis")

Wow, that looks pretty good!

Thank you for fixing up my patch!

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1076 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#36623: [PATCH] gnu: gdal: add python support
  2019-07-21  7:48               ` Arne Babenhauserheide
@ 2019-07-21 13:07                 ` 宋文武
  2019-07-22 10:23                 ` [bug#36623] " Ludovic Courtès
  1 sibling, 0 replies; 11+ messages in thread
From: 宋文武 @ 2019-07-21 13:07 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: 36623-done

Arne Babenhauserheide <arne_bab@web.de> writes:

> 宋文武 <iyzsong@member.fsf.org> writes:
>
>> Arne Babenhauserheide <arne_bab@web.de> writes:
>>
>>> Hello Ludo`,
>>>
>>> Ludovic Courtès <ludo@gnu.org> writes:
>>>
>>>>> validating RUNPATH of 6 binaries in "/gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib"...
>>>>> /gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-x86_64-linux-gnu.so:
>>>>> error: depends on 'libgdal.so.20', which cannot be found in RUNPATH
>>>>> ("/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib"
>>>>> "/gnu/store/h90vnqw0nwd0hhm1l5dgxsdrigddfmq4-glibc-2.28/lib"
>>>>> "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib"
>>>>> "/gnu/store/4sqps8dczv3g7rwbdibfz6rf5jlk7w90-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..")
>>>>
>>>> I’m not familiar with Cython so I don’t know how this was handled
>>>> before.  However, to me, it indicates that the resulting binaries are
>>>> unlikely to work.
>>>>
>>>> Namely, Python would dlopen “_gdal.cython*.so”, and that would fail to
>>>> find ‘libgdal.so’.
>>
>>>>
>>>> Thoughts?
>>>
>>> Yes: It does work. But I don’t know why.
>>
>> This is because the _gdal.cython*.so don't have rpath to the "lib"
>> directory, where libgdal.so will going.
>>
>>>
>>> Cython runs at compile-time to generate c-code that acts as interface
>>> for Python. Given the paths in here, this needs gdal already installed
>>> in the runpath where it seems to be missing during validation.
>>>
>>> How can we fix that?
>>
>> I think cython (which compile .py files to .c files) is not here..  It
>> has python C libraries generated by swig.
>>>
>>> Best wishes,
>>> Arne
>>
>> In the end the python bindings for gdal can be build seperated (which
>> handle the missing rpath to libgdal nicely), and I prefer this way:
>>
>> From 09254f646b948a5603b2b3dcb99a7f2f6ad0c8de Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
>> Date: Sat, 20 Jul 2019 22:39:33 +0800
>> Subject: [PATCH] gnu: Add python-gdal.
>>
>> For <https://issues.guix.gnu.org/issue/36623>, thank to Arne Babenhauserheide
>> for the original patch.
>>
>> * gnu/packages/geo.scm (python-gdal): New package.
>> ---
>>  gnu/packages/geo.scm | 19 +++++++++++++++++++
>>  1 file changed, 19 insertions(+)
>>
>> diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
>> index e4b6a262c7..8005c46129 100644
>> --- a/gnu/packages/geo.scm
>> +++ b/gnu/packages/geo.scm
>> @@ -604,6 +604,25 @@ utilities for data translation and processing.")
>>                 ;; frmts/mrf/libLERC
>>                 license:asl2.0))))
>>  
>> +(define-public python-gdal
>> +  (package (inherit gdal)
>> +    (name "python-gdal")
>> +    (build-system python-build-system)
>> +    (arguments
>> +     '(#:tests? #f                      ; no tests
>> +       #:phases
>> +       (modify-phases %standard-phases
>> +         (add-before 'build 'chdir
>> +           (lambda _
>> +             (chdir "swig/python")
>> +             #t)))))
>> +    (native-inputs '())
>> +    (propagated-inputs
>> +     `(("python-numpy" ,python-numpy)))
>> +    (inputs
>> +     `(("gdal" ,gdal)))
>> +    (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
>> +
>>  (define-public postgis
>>    (package
>>      (name "postgis")
>
> Wow, that looks pretty good!
>
> Thank you for fixing up my patch!
>

Sure, pushed!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [bug#36623] [PATCH] gnu: gdal: add python support
  2019-07-21  7:48               ` Arne Babenhauserheide
  2019-07-21 13:07                 ` bug#36623: " 宋文武
@ 2019-07-22 10:23                 ` Ludovic Courtès
  1 sibling, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2019-07-22 10:23 UTC (permalink / raw)
  To: Arne Babenhauserheide; +Cc: 宋文武, 36623

Hello,

Arne Babenhauserheide <arne_bab@web.de> skribis:

> 宋文武 <iyzsong@member.fsf.org> writes:

[...]

>> From 09254f646b948a5603b2b3dcb99a7f2f6ad0c8de Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <iyzsong@member.fsf.org>
>> Date: Sat, 20 Jul 2019 22:39:33 +0800
>> Subject: [PATCH] gnu: Add python-gdal.
>>
>> For <https://issues.guix.gnu.org/issue/36623>, thank to Arne Babenhauserheide
>> for the original patch.
>>
>> * gnu/packages/geo.scm (python-gdal): New package.

[...]

> Wow, that looks pretty good!
>
> Thank you for fixing up my patch!

Great that it works.  Please push and close this issue, 宋文武!

Thanks to both of you,
Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-07-22 10:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-12 21:32 [bug#36623] [PATCH] gnu: gdal: add python support Arne Babenhauserheide
2019-07-13  8:15 ` Julien Lepiller
2019-07-13 21:14   ` Arne Babenhauserheide
2019-07-17 12:57     ` Ludovic Courtès
2019-07-17 16:22       ` Arne Babenhauserheide
2019-07-19 12:07         ` Ludovic Courtès
2019-07-19 15:06           ` Arne Babenhauserheide
2019-07-20 14:55             ` 宋文武
2019-07-21  7:48               ` Arne Babenhauserheide
2019-07-21 13:07                 ` bug#36623: " 宋文武
2019-07-22 10:23                 ` [bug#36623] " Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.