diff mbox series

[bug#60039] Update GDAL and NetCDF and include lz4 and openjpeg support

Message ID 86mt7rp4c5.fsf@burningswell.com
State New
Headers show
Series [bug#60039] Update GDAL and NetCDF and include lz4 and openjpeg support | expand

Commit Message

Roman Scherer Dec. 13, 2022, 6 p.m. UTC
Hello Guix,

this patch series updates the GDAL, Netcdf and libtiff packages. It also
adds support for lz4 and openjpeg to GDAL.

Could you please review it?

Thanks, Roman.

Comments

Guillaume Le Vaillant Dec. 20, 2022, 5:07 p.m. UTC | #1
Roman Scherer <roman.scherer@burningswell.com> skribis:

> Hello Guix,
>
> this patch series updates the GDAL, Netcdf and libtiff packages. It also
> adds support for lz4 and openjpeg to GDAL.
>
> Could you please review it?
>
> Thanks, Roman.
>
> [2. text/x-diff; 0001-gnu-gdal-Update-to-3.6.0.patch]...

Hi,

Instead of this patch 1, I pushed the patch from issue 60159 that updates
gdal to 3.6.1.


> [3. text/x-diff; 0002-gnu-gdal-Add-support-for-lz4-and-openjpeg.patch]...

Patch 2 pushed as 3c6f7b53cea7ea5dc8176fec02271bc3770d7fc1.


> [4. text/x-diff; 0003-gnu-libtiff-Update-to-4.4.0.patch]...

As libtiff as over 9000 dependents, it has to be updated on the
core-updates branch instead of master (see [1]). However, libtiff is
already at version 4.4.0 on core-updates, so patch 3 is not necessary
and libtiff 4.4.0 will end up in master when core-updates gets merged.

[1] https://guix.gnu.org/manual/devel/en/guix.html#Submitting-Patches


> [5. text/x-diff; 0004-gnu-netcdf-Update-to-4.9.0.patch]...

When adding or removing a patch file to "gnu/packages/patches/...", the
'dist_patch_DATA' variable in "gnu/packages/local.mk" has to be updated
to track the necessary patch files.
Moreover, as this patch fixes only one line, it is also possible to add
a custom phase with a '(substitute* ...)' form in the 'arguments' field
instead of adding a patch file.
Could you send an updated patch 4?
Thanks.

Also, many tests are disabled in 'configure-flags'. Are they not working
at all?
diff mbox series

Patch

From 4ab999dfcab8b999d6256e328667a07aa7cb5e76 Mon Sep 17 00:00:00 2001
From: r0man <roman@burningswell.com>
Date: Sat, 10 Dec 2022 12:18:20 +0100
Subject: [PATCH 4/4] gnu: netcdf: Update to 4.9.0.

* gnu/packages/maths.scm (netcdf): Update to 4.9.0.
* gnu/packages/patches/netcdf-4.9.0-fix-cmake-typo.patch
---
 gnu/packages/maths.scm                        | 46 +++++++++++++------
 .../patches/netcdf-4.9.0-fix-cmake-typo.patch | 23 ++++++++++
 2 files changed, 55 insertions(+), 14 deletions(-)
 create mode 100644 gnu/packages/patches/netcdf-4.9.0-fix-cmake-typo.patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index aee050735e..057e9651c2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1850,16 +1850,16 @@  (define-public itpp
 (define-public netcdf
   (package
     (name "netcdf")
-    (version "4.7.4")
+    (version "4.9.0")
     (source
      (origin
        (method url-fetch)
        (uri (string-append
-             "https://www.unidata.ucar.edu/downloads/netcdf/ftp/"
-             "netcdf-c-" version ".tar.gz"))
+             "https://downloads.unidata.ucar.edu/netcdf-c/" version
+             "/netcdf-c-" version ".tar.gz"))
        (sha256
         (base32
-         "1a2fpp15a2rl1m50gcvvzd9y6bavl6vjf9zzf63sz5gdmq06yiqf"))
+         "0j8b814mjdqvqanzmrxpq8hn33n22cdzb3gf9vhya24wnwi615ac"))
        (modules '((guix build utils)))
        (snippet
         ;; Make sure this variable is defined only once.  Failing to do so
@@ -1867,20 +1867,35 @@  (define-public netcdf
         ;; multiple-definition link error with GCC 10.
         '(substitute* "ncdump/ocprint.c"
            (("^int ocdebug") "static int ocdebug")))
-       (patches (search-patches "netcdf-date-time.patch"))))
-    (build-system gnu-build-system)
+       (patches (search-patches "netcdf-date-time.patch"
+                                "netcdf-4.9.0-fix-cmake-typo.patch"))))
+    (build-system cmake-build-system)
     (native-inputs
-     (list m4 doxygen graphviz))
+     (list m4 doxygen graphviz unzip))
     (inputs
      `(("hdf4" ,hdf4-alt)
-       ("hdf5" ,hdf5)
+       ("hdf5" ,hdf5-1.12)
        ("curl" ,curl)
        ("zlib" ,zlib)
-       ("libjpeg" ,libjpeg-turbo)))
+       ("libjpeg" ,libjpeg-turbo)
+       ("libxml2" ,libxml2)))
     (arguments
-     `(#:configure-flags '("--enable-doxygen" "--enable-dot" "--enable-hdf4")
-
-       #:phases (modify-phases %standard-phases
+     `(#:configure-flags
+       '("-DENABLE_BYTERANGE=ON"
+         "-DENABLE_CDF5=ON"
+         "-DENABLE_DAP_LONG_TESTS=OFF"
+         "-DENABLE_DAP_REMOTE_TESTS=OFF"
+         "-DENABLE_EXAMPLE_TESTS=OFF"
+         "-DENABLE_EXTRA_TESTS=OFF"
+         "-DENABLE_FILTER_TESTING=OFF"
+         "-DENABLE_LARGE_FILE_TESTS=OFF"
+         "-DENABLE_UNIT_TESTS=OFF"
+         "-DSOURCE_DATE_EPOCH=0")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'disable-nc-byterange-test
+           (lambda _
+             (invoke "sed" "-i" "/test_byterange/d" "nc_test/CMakeLists.txt")))
          (add-before 'configure 'fix-source-date
            (lambda _
              ;; As we ${SOURCE_DATE_EPOCH} evaluates to "1" in the build
@@ -1900,8 +1915,11 @@  (define-public netcdf
              (substitute* "libnetcdf.settings"
                (("(/gnu/store/)([0-9A-Za-z]*)" all prefix hash)
                 (string-append prefix (string-take hash 10) "...")))
-             #t)))
-
+             #t))
+         (add-before 'check 'fix-test-rcmerge
+           (lambda _
+             ;; Set HOME, to fix the test-rcmerge.
+             (setenv "HOME" "/tmp"))))
        #:parallel-tests? #f))           ;various race conditions
     (home-page "https://www.unidata.ucar.edu/software/netcdf/")
     (synopsis "Library for scientific data")
diff --git a/gnu/packages/patches/netcdf-4.9.0-fix-cmake-typo.patch b/gnu/packages/patches/netcdf-4.9.0-fix-cmake-typo.patch
new file mode 100644
index 0000000000..b9c0ed5c10
--- /dev/null
+++ b/gnu/packages/patches/netcdf-4.9.0-fix-cmake-typo.patch
@@ -0,0 +1,23 @@ 
+From 80a6611cfca98a5979c5ac69cba56a49af8c1e48 Mon Sep 17 00:00:00 2001
+From: Yuriy Chernyshov <thegeorg@yandex-team.com>
+Date: Sun, 19 Jun 2022 19:29:20 +0300
+Subject: [PATCH] Fix typo in CMakeLists.txt
+
+At the time generated dynamic library is named `libnetcdf.so.19}` which looks like a typo.
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7bf8641bec..18366d24ad 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -39,5 +39,5 @@ SET(NC_VERSION ${netCDF_VERSION})
+ SET(PACKAGE_VERSION ${VERSION})
+
+ # These values should match those in configure.ac
+-SET(netCDF_LIB_VERSION 19})
++SET(netCDF_LIB_VERSION 19)
+ SET(netCDF_SO_VERSION 19)
+
+ # Version of the dispatch table. This must match the value in
-- 
2.38.1