diff options
-rw-r--r-- | pkgs/tools/misc/hdf4/default.nix | 17 | ||||
-rw-r--r-- | pkgs/tools/misc/hdf5/default.nix | 8 |
2 files changed, 19 insertions, 6 deletions
diff --git a/pkgs/tools/misc/hdf4/default.nix b/pkgs/tools/misc/hdf4/default.nix index d127bc25c3c69..5373c64d647c3 100644 --- a/pkgs/tools/misc/hdf4/default.nix +++ b/pkgs/tools/misc/hdf4/default.nix @@ -4,11 +4,15 @@ , fixDarwinDylibNames , cmake , libjpeg +, uselibtirpc ? stdenv.isLinux , libtirpc , zlib , szip ? null +, javaSupport ? false +, jdk }: -let uselibtirpc = stdenv.isLinux; +let + javabase = "${jdk}/jre/lib/${jdk.architecture}"; in stdenv.mkDerivation rec { pname = "hdf"; @@ -52,9 +56,9 @@ stdenv.mkDerivation rec { libjpeg szip zlib - ] ++ lib.optionals uselibtirpc [ - libtirpc - ]; + ] + ++ lib.optional javaSupport jdk + ++ lib.optional uselibtirpc libtirpc; preConfigure = lib.optionalString uselibtirpc '' # Make tirpc discovery work with CMAKE_PREFIX_PATH @@ -75,6 +79,11 @@ stdenv.mkDerivation rec { "-DHDF4_ENABLE_Z_LIB_SUPPORT=ON" "-DHDF4_BUILD_FORTRAN=OFF" "-DJPEG_DIR=${libjpeg}" + ] ++ lib.optionals javaSupport [ + "-DHDF4_BUILD_JAVA=ON" + "-DJAVA_HOME=${jdk}" + "-DJAVA_AWT_LIBRARY=${javabase}/libawt.so" + "-DJAVA_JVM_LIBRARY=${javabase}/server/libjvm.so" ] ++ lib.optionals (szip != null) [ "-DHDF4_ENABLE_SZIP_ENCODING=ON" "-DHDF4_ENABLE_SZIP_SUPPORT=ON" diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index c6fd5cde599b4..e97a6dbdd1897 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -8,6 +8,8 @@ , mpiSupport ? false , mpi , enableShared ? !stdenv.hostPlatform.isStatic +, javaSupport ? false +, jdk }: # cpp and mpi options are mutually exclusive @@ -35,7 +37,8 @@ stdenv.mkDerivation rec { buildInputs = [] ++ optional (gfortran != null) gfortran - ++ optional (szip != null) szip; + ++ optional (szip != null) szip + ++ optional javaSupport jdk; propagatedBuildInputs = [] ++ optional (zlib != null) zlib @@ -46,7 +49,8 @@ stdenv.mkDerivation rec { ++ optional (gfortran != null) "--enable-fortran" ++ optional (szip != null) "--with-szlib=${szip}" ++ optionals mpiSupport ["--enable-parallel" "CC=${mpi}/bin/mpicc"] - ++ optional enableShared "--enable-shared"; + ++ optional enableShared "--enable-shared" + ++ optional javaSupport "--enable-java"; patches = [ ./bin-mv.patch |