darwin.libiconv: Start to fix for cross

I think I need postPatch for `autoreconfHook`, it's better anyways, and
I'm pairing this with another mass-rebuild so its essentially free.
This commit is contained in:
John Ericson 2018-04-30 23:42:44 -04:00
parent 4b3cc9ed87
commit 62fd669ab7

View File

@ -1,14 +1,14 @@
{ stdenv, appleDerivation }:
{ stdenv, appleDerivation, autoreconfHook }:
appleDerivation {
preConfigure = "cd libiconv";
postUnpack = "sourceRoot=$sourceRoot/libiconv";
postInstall = ''
mv $out/lib/libiconv.dylib $out/lib/libiconv-nocharset.dylib
install_name_tool -id $out/lib/libiconv-nocharset.dylib $out/lib/libiconv-nocharset.dylib
${stdenv.cc.bintools.targetPrefix}install_name_tool -id $out/lib/libiconv-nocharset.dylib $out/lib/libiconv-nocharset.dylib
# re-export one useless symbol; ld will reject a dylib that only reexports other dylibs
echo 'void dont_use_this(){}' | clang -dynamiclib -x c - -current_version 2.4.0 \
echo 'void dont_use_this(){}' | ${stdenv.cc.bintools.targetPrefix}clang -dynamiclib -x c - -current_version 2.4.0 \
-compatibility_version 7.0.0 -current_version 7.0.0 -o $out/lib/libiconv.dylib \
-Wl,-reexport_library -Wl,$out/lib/libiconv-nocharset.dylib \
-Wl,-reexport_library -Wl,$out/lib/libcharset.dylib