From 3ebcac8d8563d8e10fdcde86af8ca0568b32c18a Mon Sep 17 00:00:00 2001 From: Matthew Justin Bauer Date: Thu, 7 Jun 2018 10:53:02 -0400 Subject: [PATCH] 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 https://github.com/NixOS/nixpkgs/commit/3dee596ed1e373c296cf4d5a09b937b41f27fbe5#diff-261d74054a31954b7c6175e2e7e28356 for discussion --- .../darwin/apple-source-releases/libiconv/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix index 7ea9d51b4bf6..bb9e4fa755db 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix @@ -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