[PATCH] gnu: gdal: Update to 3.10.2 and fix rpaths.

  • Done
  • quality assurance status badge
Details
3 participants
  • Lars Bilke
  • Ricardo Wurmus
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Lars Bilke
Severity
normal

Debbugs page

Lars Bilke wrote 1 weeks ago
(address . guix-patches@gnu.org)(name . Lars Bilke)(address . lars.bilke@ufz.de)
fffb140b1a12f443b6766cd5dbdd22e4cdfc77b8.1741072961.git.lars.bilke@ufz.de
* gnu/packages/geo.scm (gdal): Update to 3.10.2.
* gnu/packages/geo.scm (gdal): Add fix-rpath phase from https://issues.guix.gnu.org/68606

Change-Id: I973e04af737d757329adfbfa37d255386143a21c
---
gnu/packages/geo.scm | 124 ++++++++++++++++++++++++-------------------
1 file changed, 68 insertions(+), 56 deletions(-)

Toggle diff (145 lines)
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 251ef5ced9..943de4586f 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -1408,68 +1408,80 @@ (define-public pdal
(define-public gdal
(package
(name "gdal")
- (version "3.6.1")
- (source (origin
- (method url-fetch)
- (uri (string-append
- "http://download.osgeo.org/gdal/" version "/gdal-"
- version ".tar.gz"))
- (sha256
- (base32
- "1qckwnygszxkkq40bf87s3m1sab6jj9jyakdvskh0qf7dq8zjarf"))
- (modules '((guix build utils)))
- (snippet
- `(begin
+ (version "3.10.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "http://download.osgeo.org/gdal/" version "/gdal-"
+ version ".tar.gz"))
+ (sha256
+ (base32 "1nmh92vbcrp9qnld98vkxsvaw0mrska06kxxbn7n6kgbh6mhlwfa"))
+ (modules '((guix build utils)))
+ (snippet `(begin
;; TODO: frmts contains a lot more bundled code.
(for-each delete-file-recursively
- ;; bundled code
- '("frmts/png/libpng"
- "frmts/gif/giflib"
- "frmts/jpeg/libjpeg"
- "frmts/jpeg/libjpeg12"
- "frmts/gtiff/libtiff"
- "frmts/gtiff/libgeotiff"
- "frmts/zlib"
- "ogr/ogrsf_frmts/geojson/libjson"))))))
+ ;; bundled code
+ '("frmts/png/libpng" "frmts/gif/giflib"
+ "frmts/jpeg/libjpeg"
+ "frmts/jpeg/libjpeg12"
+ "frmts/gtiff/libtiff"
+ "frmts/gtiff/libgeotiff"
+ "ogr/ogrsf_frmts/geojson/libjson"))))))
(build-system cmake-build-system)
(arguments
- `(#:tests? #f
- #:configure-flags
- (list "-DGDAL_USE_INTERNAL_LIBS=WHEN_NO_EXTERNAL"
- "-DGDAL_USE_JPEG12_INTERNAL=OFF")))
- (inputs
- (list curl
- expat
- freexl
- geos
- giflib
- json-c
- libgeotiff
- libjpeg-turbo
- libjxl
- libpng
- libtiff
- libwebp
- lz4
- netcdf
- openssl
- openjpeg
- pcre2
- postgresql ; libpq
- proj
- qhull
- sqlite
- swig
- zlib
- zstd))
- (native-inputs
- (list pkg-config
- python))
- (propagated-inputs
- (list python-numpy))
+ (list
+ #:tests? #f
+ #:configure-flags
+ #~(list "-DGDAL_USE_INTERNAL_LIBS=WHEN_NO_EXTERNAL"
+ "-DGDAL_USE_JPEG12_INTERNAL=OFF")
+ #:modules '((guix build cmake-build-system)
+ (guix build utils)
+ (ice-9 rdelim)
+ (ice-9 popen))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'install 'fix-rpath
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
+ (for-each (lambda (file)
+ (let* ((pipe (open-pipe* OPEN_READ "patchelf"
+ "--print-rpath" file))
+ (line (read-line pipe)))
+ (and (zero? (close-pipe pipe))
+ (invoke "patchelf" "--set-rpath"
+ (string-append libdir ":" line)
+ file))))
+ (find-files libdir ".*\\.so$"))))))))
+ (inputs (list curl
+ expat
+ freexl
+ geos
+ giflib
+ json-c
+ libgeotiff
+ libjpeg-turbo
+ libjxl
+ libpng
+ libtiff
+ libwebp
+ lz4
+ netcdf
+ openssl
+ openjpeg
+ pcre2
+ postgresql ;libpq
+ proj
+ qhull
+ sqlite
+ swig
+ zlib
+ zstd))
+ (native-inputs (list patchelf pkg-config python))
+ (propagated-inputs (list python-numpy))
(home-page "https://gdal.org/")
(synopsis "Raster and vector geospatial data format library")
- (description "GDAL is a translator library for raster and vector geospatial
+ (description
+ "GDAL is a translator library for raster and vector geospatial
data formats. As a library, it presents a single raster abstract data model
and single vector abstract data model to the calling application for all
supported formats. It also comes with a variety of useful command line

base-commit: f203028ef869945b3d44f0f2f7b16d61d064190c
--
2.46.1
Sharlatan Hellseher wrote 1 weeks ago
(address . 76736@debbugs.gnu.org)(name . Lars Bilke)(address . lars.bilke@ufz.de)
87o6yf1b6b.fsf@gmail.com
Hi Lars,

Thank you for the patch!

Gdal is currently fails to build on master but after this patch is applied
I could build it.

There are some review points if you can cover to make it ready for apply.

- I see you keep "frmts/zlib" in snippet, may you describe the reason
please?

- Please organize your commit message with more details in style like,
look for example in currently applied commits:
Toggle snippet (4 lines)
* <path> (<package-name>): <short summury of changes>.
[field] <sub-field>: Describe change

e.g.
Toggle snippet (5 lines)
* gnu/packages/geo.scm (gdal): Update to 3.10.2. Use G-Expressions.
[source]: Snippet, do not remove "frmts/zlib" (why?)
[arguments] <phases>: Add 'fix-rpath.

- You may preserve the [inputs], [native-inputs] and [propagated-inputs]
indentations.

- You may simplify this:
Toggle snippet (2 lines)
+ (let ((libdir (string-append (assoc-ref outputs "out") "/lib")))
to this
Toggle snippet (3 lines)
+ (let ((libdir (string-append #$output "/lib")))

Looking forward for v2!

---
Oleg
-----BEGIN PGP SIGNATURE-----

iQJKBAEBCgA0FiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmfIsiwWHHNoYXJsYXRh
bnVzQGdtYWlsLmNvbQAKCRB21ye/9izStcvMEADLtd+5khnIQQynxbF+YCsKWi1s
CR6Tpk4mkfrpLN1reA4dvs0yAhdGu+wSaX+uOZ6hfPq7qRcvoIeVB3FGZ/cVCRKl
RsRgWpK9tfRc1XHfXYewhhbdIjaPVI2Q97AUmVkiVLMypj8j1+YK4jxWYG4TSHDC
748dCfdVKvBt5WTkme/GkpEPyGHnODicqG1J65DtsgB0GxfdSIBUyk0w7zZFRDAi
rrWYgqWXjTiS7INa/PCE+1u/q/g51NrnQFIFPrPNrsTEYktyXAnsB9GlLAukg/nC
GIcgnIBQ8xRg7q8ohfZyH32ACAjs3g/WOR4rqfsX3uPW9onqOk7/N3d3gzRf6rKX
1JMhH+WiYZjIsChW9uGEDqVOrxyGoFXtSYcJyW7ELsb+IB3mKcxmfJiUUTQuwal9
b7BpsCx6wXn3sAtsBt28CC9ejJh88U6/AdGOZCsoIusiosPen9Hvuv7epbEUAGWT
bxupzlloaukpwe8BrEHucZKDWMxHeuXZlwUj9x0JZQNEba6vYoIB8lUqLNFNVjdk
RX3wI/g2+5+Zc0wmE7vSuReBLrOQg5vCXHy/S7LSf6c69ozGmzyQHMLB98oDQ5vL
iGm+D8zuZY1wblRrUwQ2tZfJwQsKhoFK2oFw/IkhxLyLJqyZk1pzM6IJNabcYPzg
W/9ADvbEq6RYdq291g==
=eZ+o
-----END PGP SIGNATURE-----

Sharlatan Hellseher wrote 6 days ago
(address . 76736@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
8734fqw7w3.fsf@gmail.com
Hi,

It looks like Ricardo has pushed update alread in
f2229c2afdb32ddba46bce6f37aba812af39eec5 commit.

CC him, if we need to act on this issue as it's updating to 3.10.2.

Toggle snippet (9 lines)
gnu: gdal: Update to 3.8.2.HEAD master
* gnu/packages/geo.scm (gdal): Update to 3.8.2.
[source]: Adjust snippet to retain infback9.
[arguments]: Add phase 'swap-files to install files with modified RPATH.
[inputs]: Add shapelib.

Change-Id: Ia2b13a2da5e951d9d5a70f81b3aa0f099556929b

--
Oleg
-----BEGIN PGP SIGNATURE-----

iQJKBAEBCgA0FiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmfJsQwWHHNoYXJsYXRh
bnVzQGdtYWlsLmNvbQAKCRB21ye/9izStWfgD/497i9V8Rq90rct4Hje2NowIJD8
BbILOk8q+1ZhJuTENzX0qPhpT7RkCTG/2CsnbYvXbc1FtNwW+ScIa13+IqNwowx3
gzy4KD507hTlyHGTkegu3+Tzk717pYXrBio3jPgzo4rg4X+2WVAubM4tKSp20a8X
8n1mvIryTq9Ra+mdtuo8/AetP40YVS7qNMJh5O1kjr+lAE+0RqgYJoMtor5/Wm3G
/sW/QbggpUiw8NZjUFQAuVWJBnpVtHinzsR9cevI31SFC4RgKNZtJYnLLpR00pxX
jXbv6jULPXto4/rkU8lhyJihlTm5MlrwO4kfmpXTzcphsVovSOctCaiYSYnGMCoM
1FYK+wtmMyOZB9I+NnCE54/Z0chsKYmPX621H1wJ91bKqlWDWVueb2DytEMZyWFa
yclrLSrDl6i69yVt9dUH//KOt7YCZzYaPFf7KZjCtBFa/mkrBcyfjq4x8QnxNHjM
lL7+tNTAv1fzWs5KfWM7PX8XTHSYEE0raVzQaRfkr5GT2w6beVgCMvCo/aDIjcS/
56lS8zVCSB4Mg4yEmg8z3U81TZ5xmpfUlbOFMwZfbmALoTte+vrEZS5IqOhokzao
zehn/KH79+N3+DtSxJ8UYTcGTaDMgsRNy0OfAU0Up6n4dlJ8+a9oi8ELHNEvP2UE
sFP37e0jngBtmrYBUQ==
=o1Ik
-----END PGP SIGNATURE-----

Ricardo Wurmus wrote 6 days ago
(address . 76736@debbugs.gnu.org)
87frjq2omo.fsf@elephly.net
Sharlatan Hellseher <sharlatanus@gmail.com> writes:

Toggle quote (3 lines)
> It looks like Ricardo has pushed update alread in
> f2229c2afdb32ddba46bce6f37aba812af39eec5 commit.

Oh, I'm sorry I missed this.

I only updated to 3.8.2 because I didn't want to risk breaking too
many
dependents. My goal was to fix python-geopandas ASAP when I
attempted
to fix this at the same time as Lars sent the patch.

The 'fix-rpath phase is unnecessary, because gdal's build system
already
takes care of building files with the correct RPATH --- they just
don't
get installed for unknown reasons.

Lars, ff the dependents of gdal build fine after the upgrade to
3.10.2
I'd be happy to push an edited version of this patch.

--
Ricardo
Lars Bilke wrote 5 days ago
(name . Ricardo Wurmus)(address . rekado@elephly.net)
4BF7495D-08E1-43C9-833C-CB047260D4B4@ufz.de
Hi Ricardo,

ah thanks for 3.8.2 patch! That's all I need (I also wanted python-geopandas), so this issue can be closed (I do not know how to do that).

Thanks!
Lars

On 6 Mar 2025, at 15:57, Ricardo Wurmus wrote:

Toggle quote (20 lines)
> Sharlatan Hellseher <sharlatanus@gmail.com> writes:
>
>> It looks like Ricardo has pushed update alread in
>> f2229c2afdb32ddba46bce6f37aba812af39eec5 commit.
>
> Oh, I'm sorry I missed this.
>
> I only updated to 3.8.2 because I didn't want to risk breaking too many
> dependents. My goal was to fix python-geopandas ASAP when I attempted
> to fix this at the same time as Lars sent the patch.
>
> The 'fix-rpath phase is unnecessary, because gdal's build system already
> takes care of building files with the correct RPATH --- they just don't
> get installed for unknown reasons.
>
> Lars, ff the dependents of gdal build fine after the upgrade to 3.10.2
> I'd be happy to push an edited version of this patch.
>
> --
> Ricardo
Sharlatan Hellseher wrote 5 days ago
[PATCH] gnu: gdal: Update to 3.10.2 and fix rpaths.
(address . 76736-done@debbugs.gnu.org)
87msdwtvin.fsf@gmail.com
Hi,

I've checked issues for the same reason python-geopandas was broken for
me.

Closing as no longer required.

--
Oleg
-----BEGIN PGP SIGNATURE-----

iQJKBAEBCgA0FiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmfLXDAWHHNoYXJsYXRh
bnVzQGdtYWlsLmNvbQAKCRB21ye/9izStYDxEACrx+usuWHUYuDXCVScbsQ08poh
1+ISafiUdQbQnSVxzGjKTt7Lnzeg9VvUgKQxtU4XvVb3dEgsM7E+UetbQoJ4GCpC
8eXb5Ep4jwsYxQNCIFyZxqBjbSPzOLrwBi7jWKMuj7GXYyce6FgKdnZAzLZsrI1K
O+waTmuI9AZnTl2OcJuTHYQXz1JOsRiP0K4G6wXGgB2KvOiQfckwkMmW7Hf1vVGp
rS62r7ulvfZpyCnLkNNXAAodjxV2YLD4dESzYzp43Rew8e3eELiEgVWacTBAz5QC
hY2CaiVvF+mwf5Y4/2J3KmmW6u/eMo5a0n7xMueu9zRzRLYJzo1M3E8on3OdhKnO
FwLNen6OkZE8ach+mPeO9zoFrrYoUnkT3ez9mks96cWJhtIGVN75GPOEQeG72Ily
xiyz6pae1NZzTc0sAs8pUH5/QJ3yOsr6vbm2iQnERO6FNIw2rK+VcTgdl5HQ6PtQ
ZgS6amC29nfJTTUnpj003BjOtpzzEfQ9s83bVKaC3rGiVNFOkNONqZZNvVrD8piA
MVweCOU7ttQQmHVsWIpPVJ11Wh6MnV9Gkkwj1m7CcsIDwcdVQKwqmA8uiRfafdVI
4rKS22WJ6lpJUgMLnf3yltnzzXQ9OqfcdRTCA106joqZHTOnVEkXRVhMjvS5lWVJ
XYvFp17HASkdOu8KKQ==
=JHsD
-----END PGP SIGNATURE-----

Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 76736@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 76736
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help