Merge pull request #46905 from obsidiansystems/zlib-ios

zlib: Fix iOS cross build
This commit is contained in:
John Ericson 2018-09-19 12:49:09 -04:00 committed by GitHub
commit aff090292c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,7 @@
, static ? false
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (rec {
name = "zlib-${version}";
version = "1.2.11";
@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
# what causes this difference.
+ stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
for file in $out/lib/*.so* $out/lib/*.dylib* ; do
install_name_tool -id "$file" $file
${stdenv.cc.bintools.targetPrefix}install_name_tool -id "$file" $file
done
''
# Non-typical naming confuses libtool which then refuses to use zlib's DLL
@ -78,4 +78,8 @@ stdenv.mkDerivation rec {
license = licenses.zlib;
platforms = platforms.all;
};
}
} // stdenv.lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
preConfigure = ''
export CHOST=${stdenv.hostPlatform.config}
'';
})