From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:49001) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hp6bc-0000nz-11 for guix-patches@gnu.org; Sun, 21 Jul 2019 03:50:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hp6ba-0001gf-Kt for guix-patches@gnu.org; Sun, 21 Jul 2019 03:50:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49296) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hp6ba-0001gW-Hp for guix-patches@gnu.org; Sun, 21 Jul 2019 03:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hp6ba-00066q-Di for guix-patches@gnu.org; Sun, 21 Jul 2019 03:50:02 -0400 Subject: [bug#36623] [PATCH] gnu: gdal: add python support Resent-Message-ID: References: <20190712213247.23250-1-arne_bab@web.de> <5E0BF317-99AC-43D9-9E30-1528A1A61DAA@lepiller.eu> <87pnmdr60f.fsf@web.de> <87blxsddjz.fsf@gnu.org> <87ims08wbo.fsf@web.de> <87pnm6b53u.fsf@gnu.org> <874l3it66f.fsf@web.de> <87tvbgkb6b.fsf@member.fsf.org> From: Arne Babenhauserheide In-reply-to: <87tvbgkb6b.fsf@member.fsf.org> Date: Sun, 21 Jul 2019 09:48:58 +0200 Message-ID: <8736izzv2t.fsf@web.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Cc: 36623@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E5=AE=8B=E6=96=87=E6=AD=A6 writes: > Arne Babenhauserheide writes: > >> Hello Ludo`, >> >> Ludovic Court=C3=A8s writes: >> >>>> validating RUNPATH of 6 binaries in "/gnu/store/q9sb0wv41ig429f1m1xspg= 22xm8pwpwh-gdal-2.2.4/lib"... >>>> /gnu/store/q9sb0wv41ig429f1m1xspg22xm8pwpwh-gdal-2.2.4/lib/python3.7/s= ite-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=E2=80=99m not familiar with Cython so I don=E2=80=99t know how this w= as handled >>> before. However, to me, it indicates that the resulting binaries are >>> unlikely to work. >>> >>> Namely, Python would dlopen =E2=80=9C_gdal.cython*.so=E2=80=9D, and tha= t would fail to >>> find =E2=80=98libgdal.so=E2=80=99. > >>> >>> Thoughts? >> >> Yes: It does work. But I don=E2=80=99t 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: =3D?UTF-8?q?=3DE5=3DAE=3D8B=3DE6=3D96=3D87=3DE6=3DAD=3DA6?=3D > Date: Sat, 20 Jul 2019 22:39:33 +0800 > Subject: [PATCH] gnu: Add python-gdal. > > For , thank to Arne Babenhauserh= eide > 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)))) >=20=20 > +(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 binding= s"))) > + > (define-public postgis > (package > (name "postgis") Wow, that looks pretty good! Thank you for fixing up my patch! Best wishes, Arne =2D-=20 Unpolitisch sein hei=C3=9Ft politisch sein ohne es zu merken --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE801qEjXQSQPNItXAE++NRSQDw+sFAl00GOwACgkQE++NRSQD w+skLg/+LR5Pj+CWslJ3ZyCDmHwxnsQrQLX96F5j2KL5kaVIH8QiCHPAZtWJbc/c 8ejIpeeoFMSzZaym9qFCEukId0FrgQLyxddUrmPvLT6vGqYtMZfEzr8R4+O4v4tk m+RsmX4JF7tduaZKwUOQdLSCdFGEmn6YLv7UfORwSVrimWre7STdj3mc2feppVdD tDnuuN3GyM+AwadBgjLhiGtWDFd+rYgNLI5OyFxMUplr/PtFDB9nILV99TMdD/SV xCjUt+ao4juDwqxgQgMxnvKaqJqcr6+/+ncOKzPlWHcI+HrQhHaidrKgIc0t3wuN 1zSbmUnyYhwZMZClh+I31xFw7/81SvOEERdBdWf0DAvETLwk35W5ffoZ6o3qHHuh NAn+1tn+EQ9uVK5WajLD/tzkRAl91hxLn2h08HhIk7oT4oEf8nZ/n6VIaQILZwuR N9FY8tTelWgr6ocPOyo/m7k0DyAvuaRGZLhlcyYPtGM8uC3ADZhpwrB/qeTnz6KA Y+NzOBAL1vuqnAUuZhStrcATC68n7Fc0w32nctp2+0bKBaj7fx9wY7CULY/UUPad PWEEXTLKfccZi1Efu66peM9XeX56GrjD4Ilxwvc0ToN/Odd2oV5frDTX84Ek2HWE +XDzbhXcZaYBj9yew/zKnBoqzw3ETeclTU+4BxD6N+qPps9XrbuIswQBAQgAHRYh BN0ovebZh1yrzkqLHdzPDbMLwQVIBQJdNBjsAAoJENzPDbMLwQVI03MEAItmxmJw sQ+f+/6kQAMPIzrFtvZ7o0tuL6saaMqWM2tbruGkxbCamRl7MMFC66RjoQrTwXJJ GMktV8H1ZcckTz33UnKfiVuZP58dsTHgTv9Q2wyEY5n6y7fmZWcNrdG/DddBHMYd xSpvKDasvU2zO1c+xb+3QUS/bKs35eftyJbK =fgKu -----END PGP SIGNATURE----- --=-=-=--