diff options
Diffstat (limited to 'pkgs/tools/misc/hdf4/default.nix')
-rw-r--r-- | pkgs/tools/misc/hdf4/default.nix | 17 |
1 files changed, 13 insertions, 4 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" |