3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix
2018-05-02 15:35:46 -05:00

23 lines
896 B
Nix

{ stdenv, appleDerivation, autoreconfHook }:
appleDerivation {
postUnpack = "sourceRoot=$sourceRoot/libiconv";
postInstall = ''
mv $out/lib/libiconv.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(){}' | ${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
'';
setupHook = ../../../../development/libraries/libiconv/setup-hook.sh;
meta = {
platforms = stdenv.lib.platforms.darwin;
};
}