hdf4: enable fortran and netcdf support

hdf4: fortran disabled by default


hdf4: fix formatting


hdf4: optional netcdf support


hdf4: disable fortran by default
This commit is contained in:
Phillip Seeber 2023-05-10 11:45:34 +02:00
parent 9cc20733c0
commit 4a33d3980c

View file

@ -12,6 +12,9 @@
, szip
, javaSupport ? false
, jdk
, fortranSupport ? false
, gfortran
, netcdfSupport ? false
}:
stdenv.mkDerivation rec {
pname = "hdf";
@ -50,7 +53,7 @@ stdenv.mkDerivation rec {
cmake
] ++ lib.optionals stdenv.isDarwin [
fixDarwinDylibNames
];
] ++ lib.optional fortranSupport gfortran;
buildInputs = [
libjpeg
@ -75,9 +78,8 @@ stdenv.mkDerivation rec {
"-DHDF4_BUILD_UTILS=ON"
"-DHDF4_BUILD_WITH_INSTALL_NAME=OFF"
"-DHDF4_ENABLE_JPEG_LIB_SUPPORT=ON"
"-DHDF4_ENABLE_NETCDF=OFF"
"-DHDF4_ENABLE_NETCDF=${if netcdfSupport then "ON" else "OFF"}"
"-DHDF4_ENABLE_Z_LIB_SUPPORT=ON"
"-DHDF4_BUILD_FORTRAN=OFF"
"-DJPEG_DIR=${libjpeg}"
] ++ lib.optionals javaSupport [
"-DHDF4_BUILD_JAVA=ON"
@ -85,7 +87,13 @@ stdenv.mkDerivation rec {
] ++ lib.optionals szipSupport [
"-DHDF4_ENABLE_SZIP_ENCODING=ON"
"-DHDF4_ENABLE_SZIP_SUPPORT=ON"
];
] ++ (if fortranSupport
then [
"-DHDF4_BUILD_FORTRAN=ON"
"-DCMAKE_Fortran_FLAGS=-fallow-argument-mismatch"
]
else [ "-DHDF4_BUILD_FORTRAN=OFF" ]
);
doCheck = true;