From ccfbc19630465aaa666588417d38b56a557a1bff Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Wed, 22 Mar 2023 09:41:32 +1100 Subject: [PATCH] rPackages.Rhdf5lib: fix build use nixpkgs provided hdf5 and libaec to resolve failing vendored code --- pkgs/development/r-modules/default.nix | 6 ++-- .../r-modules/patches/Rhdf5lib.patch | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/r-modules/patches/Rhdf5lib.patch diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix index 0966c96cbde13..8913591d645f1 100644 --- a/pkgs/development/r-modules/default.nix +++ b/pkgs/development/r-modules/default.nix @@ -389,7 +389,7 @@ let Rglpk = [ pkgs.glpk ]; RGtk2 = [ pkgs.gtk2.dev ]; rhdf5 = [ pkgs.zlib ]; - Rhdf5lib = with pkgs; [ zlib.dev hdf5.dev ]; + Rhdf5lib = with pkgs; [ zlib.dev ]; Rhpc = with pkgs; [ zlib bzip2.dev icu xz.dev mpi pcre.dev ]; Rhtslib = with pkgs; [ zlib.dev automake autoconf bzip2.dev xz.dev curl.dev ]; rjags = [ pkgs.jags ]; @@ -1320,7 +1320,9 @@ let }); Rhdf5lib = old.Rhdf5lib.overrideAttrs (attrs: { - propagatedBuildInputs = attrs.propagatedBuildInputs ++ [ pkgs.hdf5.dev ]; + propagatedBuildInputs = attrs.propagatedBuildInputs ++ [ pkgs.hdf5_1_10.dev pkgs.libaec ]; + patches = [ ./patches/Rhdf5lib.patch ]; + }); }); }; in diff --git a/pkgs/development/r-modules/patches/Rhdf5lib.patch b/pkgs/development/r-modules/patches/Rhdf5lib.patch new file mode 100644 index 0000000000000..424dea79d7ee4 --- /dev/null +++ b/pkgs/development/r-modules/patches/Rhdf5lib.patch @@ -0,0 +1,28 @@ +diff --git a/src/Makevars.in b/src/Makevars.in +index addb6a0..590784a 100644 +--- a/src/Makevars.in ++++ b/src/Makevars.in +@@ -18,7 +18,7 @@ USER_LIB_DIR = ${R_PACKAGE_DIR}/lib${R_ARCH}/ + + PKG_CPPFLAGS = -I${USER_INCLUDE_DIR} ${ZLIB_INCLUDE} + PKG_CFLAGS = ${ZLIB_LIB} +-PKG_LIBS = "${USER_LIB_DIR}libhdf5.a" @SZIP_LIB@ -lz ++PKG_LIBS = -lhdf5 -lsz + + + +@@ -26,12 +26,12 @@ all: $(SHLIB) + + $(SHLIB): Rhdf5lib.o + +-Rhdf5lib.o: copy-hdf5 @COPY_SZIP@ ++Rhdf5lib.o: + + copy-szip: copy-hdf5 + cp hdf5/libaec-1.0.4/build/szip/lib/libsz.a "${USER_LIB_DIR}" + cp hdf5/libaec-1.0.4/build/szip/lib/libaec.a "${USER_LIB_DIR}" +- ++ + #copy hdf5 library headers to package include + copy-hdf5: @BUILD_HDF5@ + mkdir -p "${USER_INCLUDE_DIR}"