darwin.libiconv: use static library

This is necessary to get stuff into the Apple App Store for iOS. Apple does not really like using dynamic libraries in iOS. Also the libcharset thing is apparently a "private" symbol.

See https://github.com/reflex-frp/reflex-platform/pull/307 for more details.

See 3dee596ed1 (diff-261d74054a31954b7c6175e2e7e28356) for discussion
This commit is contained in:
Matthew Justin Bauer 2018-06-07 10:53:02 -04:00 committed by GitHub
parent eceff79fb6
commit 3ebcac8d85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
{ stdenv, appleDerivation, autoreconfHook }:
{ stdenv, appleDerivation, autoreconfHook, targetPlatform, enableStatic ? targetPlatform.isiOS }:
appleDerivation {
postUnpack = "sourceRoot=$sourceRoot/libiconv";
@ -7,7 +7,9 @@ appleDerivation {
sed -i 's/darwin\*/ios\*/g' configure libcharset/configure
'';
postInstall = ''
configureFlags = stdenv.lib.optionals enableStatic [ "--enable-static" "--disable-shared" ];
postInstall = stdenv.lib.optionalString (!enableStatic) ''
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