Skip to content

Commit

Permalink
rPackages.Rhdf5lib: fix build
Browse files Browse the repository at this point in the history
use nixpkgs provided hdf5 and libaec to resolve failing vendored code
  • Loading branch information
jbedo committed Mar 21, 2023
1 parent a10887c commit ccfbc19
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkgs/development/r-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions pkgs/development/r-modules/patches/Rhdf5lib.patch
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit ccfbc19

Please sign in to comment.