From patchwork Sat Jul 20 14:55:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?5a6L5paH5q2m?= X-Patchwork-Id: 14727 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7D03A17256; Sat, 20 Jul 2019 16:08:07 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 23ABB17254 for ; Sat, 20 Jul 2019 16:08:07 +0100 (BST) Received: from localhost ([::1]:51544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoqxy-00047R-QA for patchwork@mira.cbaines.net; Sat, 20 Jul 2019 11:08:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37780) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoqxv-00046p-KH for guix-patches@gnu.org; Sat, 20 Jul 2019 11:08:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hoqxu-0002IH-Cv for guix-patches@gnu.org; Sat, 20 Jul 2019 11:08:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48943) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hoqxu-0002IB-9V for guix-patches@gnu.org; Sat, 20 Jul 2019 11:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hoqxu-00063B-3l for guix-patches@gnu.org; Sat, 20 Jul 2019 11:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36623] [PATCH] gnu: gdal: add python support Resent-From: iyzsong@member.fsf.org (=?utf-8?b?5a6L5paH5q2m?=) Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Jul 2019 15:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36623 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Arne Babenhauserheide Received: via spool by 36623-submit@debbugs.gnu.org id=B36623.156363522723176 (code B ref 36623); Sat, 20 Jul 2019 15:08:02 +0000 Received: (at 36623) by debbugs.gnu.org; 20 Jul 2019 15:07:07 +0000 Received: from localhost ([127.0.0.1]:57764 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hoqx1-00061j-0Q for submit@debbugs.gnu.org; Sat, 20 Jul 2019 11:07:07 -0400 Received: from rezeros.cc ([45.76.207.221]:47102) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hoqwy-00061U-EM for 36623@debbugs.gnu.org; Sat, 20 Jul 2019 11:07:05 -0400 Received: from localhost (2409:8a62:373:6d20:6cef:8816:1032:4c8f [IPv6:2409:8a62:373:6d20:6cef:8816:1032:4c8f]) by rezeros.cc (OpenSMTPD) with ESMTPSA id ed9879c6 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Sat, 20 Jul 2019 14:55:43 +0000 (UTC) Received: from gift (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 0ffd1d0e; Sat, 20 Jul 2019 14:55:40 +0000 (UTC) From: iyzsong@member.fsf.org (=?utf-8?b?5a6L5paH5q2m?=) 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> Date: Sat, 20 Jul 2019 22:55:40 +0800 In-Reply-To: <874l3it66f.fsf@web.de> (Arne Babenhauserheide's message of "Fri, 19 Jul 2019 17:06:32 +0200") Message-ID: <87tvbgkb6b.fsf@member.fsf.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 36623@debbugs.gnu.org Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Arne Babenhauserheide writes: > Hello Ludo`, > > Ludovic Courtès 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: 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! From 09254f646b948a5603b2b3dcb99a7f2f6ad0c8de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Date: Sat, 20 Jul 2019 22:39:33 +0800 Subject: [PATCH] gnu: Add python-gdal. For , 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