Merge pull request #108533 from purcell/hdf4-darwin-libtirpc

[hdf4] Fix build on Darwin, which blocked gdal, postgis and more
This commit is contained in:
Mario Rodas 2021-01-07 22:35:06 -05:00 committed by GitHub
commit ba410c2647
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,7 +8,8 @@
, zlib
, szip ? null
}:
let uselibtirpc = stdenv.isLinux;
in
stdenv.mkDerivation rec {
pname = "hdf";
version = "4.2.15";
@ -49,12 +50,13 @@ stdenv.mkDerivation rec {
buildInputs = [
libjpeg
libtirpc
szip
zlib
] ++ stdenv.lib.optionals uselibtirpc [
libtirpc
];
preConfigure = ''
preConfigure = stdenv.lib.optionalString uselibtirpc ''
# Make tirpc discovery work with CMAKE_PREFIX_PATH
substituteInPlace config/cmake/FindXDR.cmake \
--replace 'find_path(XDR_INCLUDE_DIR NAMES rpc/types.h PATHS "/usr/include" "/usr/include/tirpc")' \