summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarkus Kowalewski <markus.kowalewski@gmail.com>2023-11-07 16:14:45 +0100
committerMarkus Kowalewski <markus.kowalewski@gmail.com>2023-11-07 16:14:45 +0100
commit57db378e4cf47f83afe118945fe25433dce78a7e (patch)
treebe1026c068618e6bce06210e2d24c1a2e268fe45
parent855695d8b5f47a412c5cfc5ccd759a98b4a2ce7c (diff)
downloadnixpkgs-57db378e4cf47f83afe118945fe25433dce78a7e.tar
nixpkgs-57db378e4cf47f83afe118945fe25433dce78a7e.tar.gz
nixpkgs-57db378e4cf47f83afe118945fe25433dce78a7e.tar.bz2
nixpkgs-57db378e4cf47f83afe118945fe25433dce78a7e.tar.lz
nixpkgs-57db378e4cf47f83afe118945fe25433dce78a7e.tar.xz
nixpkgs-57db378e4cf47f83afe118945fe25433dce78a7e.tar.zst
nixpkgs-57db378e4cf47f83afe118945fe25433dce78a7e.zip
netcdfcxx4: fix build, add patch for cmake
The fix in the patch is picked from upstream.
Can be removed with next release.
(Upstream commit does not apply; contains more changes)
-rw-r--r--pkgs/development/libraries/netcdf-cxx4/cmake-h5free.patch13
-rw-r--r--pkgs/development/libraries/netcdf-cxx4/default.nix5
2 files changed, 18 insertions, 0 deletions
diff --git a/pkgs/development/libraries/netcdf-cxx4/cmake-h5free.patch b/pkgs/development/libraries/netcdf-cxx4/cmake-h5free.patch
new file mode 100644
index 00000000000..7d1723c3ef9
--- /dev/null
+++ b/pkgs/development/libraries/netcdf-cxx4/cmake-h5free.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 60c699d..606b972 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -402,7 +402,7 @@ ELSE(MSVC)
+   FIND_PACKAGE(HDF5 COMPONENTS C HL REQUIRED)
+ ENDIF(MSVC)
+ 
+-CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HAVE_H5FREE_MEMORY)
++CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARIES} H5free_memory "" HAVE_H5FREE_MEMORY)
+ IF(NOT HAVE_H5FREE_MEMORY)
+   MESSAGE(STATUS "Plugin support requires libhdf5 with H5Free support. Your libhdf5 install does not provide H5Free.  Please install a newer version of libhdf5 if you require plugin compression support.")
+   SET(NC_HAS_DEF_VAR_FILTER "")
diff --git a/pkgs/development/libraries/netcdf-cxx4/default.nix b/pkgs/development/libraries/netcdf-cxx4/default.nix
index 5f0fade2566..f7ef563aab5 100644
--- a/pkgs/development/libraries/netcdf-cxx4/default.nix
+++ b/pkgs/development/libraries/netcdf-cxx4/default.nix
@@ -10,6 +10,11 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-GZ6n7dW3l8Kqrk2Xp2mxRTUWWQj0XEd2LDTG9EtrfhY=";
   };
 
+  patches = [
+    # This fix is included upstream, remove with next upgrade
+    ./cmake-h5free.patch
+  ];
+
   preConfigure = ''
     cmakeFlags+="-Dabs_top_srcdir=$(readlink -f ./)"
   '';