Skip to content

Commit

Permalink
hdf4: fix cross
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaSajt committed Oct 14, 2024
1 parent 4eaa50c commit a14a667
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkgs/tools/misc/hdf4/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,21 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "HDF4_ENABLE_SZIP_SUPPORT" szipSupport)
(lib.cmakeBool "HDF4_ENABLE_SZIP_ENCODING" szipSupport)
(lib.cmakeBool "HDF4_BUILD_JAVA" javaSupport)
(lib.cmakeBool "BUILD_TESTING" finalAttrs.doCheck)
(lib.cmakeFeature "JPEG_DIR" "${libjpeg}")
]
++ lib.optionals javaSupport [
(lib.cmakeFeature "JAVA_HOME" "${jdk}")
]
++ lib.optionals fortranSupport [
(lib.cmakeFeature "CMAKE_Fortran_FLAGS" "-fallow-argument-mismatch")
]
# using try_run would set these, but that requires a cross-compiling emulator to be available
# instead, we mark them as if the try_run calls returned a non-zero exit code
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
(lib.cmakeFeature "TEST_LFS_WORKS_RUN" "1")
(lib.cmakeFeature "H4_PRINTF_LL_TEST_RUN" "1")
(lib.cmakeFeature "H4_PRINTF_LL_TEST_RUN__TRYRUN_OUTPUT" "")
];

env = lib.optionalAttrs stdenv.cc.isClang {
Expand All @@ -110,7 +118,7 @@ stdenv.mkDerivation (finalAttrs: {
];
};

doCheck = true;
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;

excludedTests = lib.optionals stdenv.hostPlatform.isDarwin [
"MFHDF_TEST-hdftest"
Expand Down

0 comments on commit a14a667

Please sign in to comment.