From patchwork Sat Jul 13 21:14:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Dr. Arne Babenhauserheide" X-Patchwork-Id: 14636 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 C3FEC1721D; Sat, 13 Jul 2019 22:16:11 +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,FREEMAIL_FROM, T_DKIM_INVALID,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 F13331721A for ; Sat, 13 Jul 2019 22:16:09 +0100 (BST) Received: from localhost ([::1]:58030 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmPNH-0003BM-F6 for patchwork@mira.cbaines.net; Sat, 13 Jul 2019 17:16:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41761) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hmPNE-00039U-22 for guix-patches@gnu.org; Sat, 13 Jul 2019 17:16:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hmPNC-0000ss-4a for guix-patches@gnu.org; Sat, 13 Jul 2019 17:16:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hmPNB-0000sb-QC for guix-patches@gnu.org; Sat, 13 Jul 2019 17:16:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hmPNB-000774-Ix for guix-patches@gnu.org; Sat, 13 Jul 2019 17:16:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#36623] [PATCH] gnu: gdal: add python support Resent-From: Arne Babenhauserheide Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 13 Jul 2019 21:16:01 +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: Julien Lepiller Received: via spool by 36623-submit@debbugs.gnu.org id=B36623.156305251927287 (code B ref 36623); Sat, 13 Jul 2019 21:16:01 +0000 Received: (at 36623) by debbugs.gnu.org; 13 Jul 2019 21:15:19 +0000 Received: from localhost ([127.0.0.1]:43464 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmPMV-000762-7E for submit@debbugs.gnu.org; Sat, 13 Jul 2019 17:15:19 -0400 Received: from mout.web.de ([212.227.15.4]:53091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hmPMR-00075i-0E for 36623@debbugs.gnu.org; Sat, 13 Jul 2019 17:15:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1563052505; bh=UtTTy3DIRM8L6UfzGKfHOmbf/0K1GONHBA0hs9zpxaY=; h=X-UI-Sender-Class:References:From:To:Cc:Subject:In-reply-to:Date; b=UX7tdg5RQVlOu4noM/IDeojNl/JAONu4H2GdtFanf9RRD9z/ajKntzoGTb8l3Cv9j UBbGRAKr8ZUYnDXu6JP+aSDgF+V7Fd0RL9H89NJtjF6HO2hijvmFWxJ2vnfKVBCZMj OQgpDjv98SQoqUMdClF3rN3GqWwvTvZ8+xX2FUyE= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from fluss ([84.149.83.171]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0M1Wxd-1ibL160uev-00tUWR; Sat, 13 Jul 2019 23:15:05 +0200 References: <20190712213247.23250-1-arne_bab@web.de> <5E0BF317-99AC-43D9-9E30-1528A1A61DAA@lepiller.eu> User-agent: mu4e 1.2.0; emacs 26.2 From: Arne Babenhauserheide In-reply-to: <5E0BF317-99AC-43D9-9E30-1528A1A61DAA@lepiller.eu> Date: Sat, 13 Jul 2019 23:14:56 +0200 Message-ID: <87pnmdr60f.fsf@web.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:LaE9HCU9kI7XtU/sqF2uDfe5aIf+s8FNl/vBbZNcHC4pyhhPT5Y ZxPGRn0Y7TqGERZzbWo6De5uVte1RdSHemGkyt+2Os24TZyD5gWOCBUQNqTQPEC9ChLOuCc Ss7ibKxMMmIlHEgtEaJ/X4+d1PUSyKgTrbUiJl8UuBzeH5yx2X6u2Znjox6T1W7f5IBkRaX QfdSIEAGhPlvookQFQK9g== X-UI-Out-Filterresults: notjunk:1;V03:K0:BZCcTNmnOiM=:Ye02ShFOsY2AuuOv38UHmM zXyfkUtCcSaHYnBoOTBZhwSrnrZOumqKo5Tl7sAuaR1C2aE9GOEOS3gU4ajVz3aqU88SKFxFp 93scN/IRufyZzzXWiIpZ2jnt8qn3p3mjwFYTFdTBSKf5C7+UtJTg1NsTb0oVHaeyFbso/+Acd bmVtAo35EkafDT2vq4YwNB0L+cFb2p84weKGaQAogiOdUzrC8LSVQs+eYWFvEcZNyxwAiU6CG vR6rY/6EWH+VM5YKbe13Fbvk6Ero9QCc98S+PPmeQkm5t8fBE/d9mdJldGOCSSkY+2Y0Otgmw C78LpcQeAPwQwEyDrZGdAFEVeF0dNBGGUavzHw4LtNfPdTqNAUkgAbISbbpTIgcyr7xe5NWeS zwpA3BjmH4N3nUfpv6YS7lYNvzFRftIul52lwdbKHG2oNu8OaMweFz7Izkm7X6b93rKQgFd0q 77kV72Ko7jlhNoq2rdHYP/hfBnTuWTTLc35euMJ0DrIYHihIwN0+YJyUeVmXwveNafCn+W4py 5HKAAFgI5EVHul3vMHaXNdX7ZUh62fzAGK7E67+ytxLunA3VZUcTrXw8YvJLYC6LZrY7CpwYn ByOo3L1RfmgDqNY8WDOboicE8s3QIFxZH3mZRngThTXlUt90xDphiQRhlVtfwIl4/lxrKLKQV y/Q8= 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 Julien Lepiller writes: > Le 12 juillet 2019 23:32:47 GMT+02:00, Arne Babenhauserheide 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/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! Best wishes, Arne From 5f8b1dc1bb5ce7b061bcca10174f9330cf89696c Mon Sep 17 00:00:00 2001 From: Arne Babenhauserheide 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/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