nix: strip ios library (#6503)

* strip ios like in android

* remove strip-unneeded in mac

* strip only simplex-chat libs

* flake.nix: strip only local symbols in MacOS library

* flake.nix: make libs writable

* flake.nix: better strip placement

* reduce framework size by exporting only public API symbols
This commit is contained in:
sh
2026-04-13 13:40:27 +00:00
committed by GitHub
parent 673f5e374b
commit 577b30e72f
3 changed files with 15 additions and 0 deletions

View File

@@ -2319,6 +2319,9 @@
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
EXPORTED_SYMBOLS_FILE = "$(PROJECT_DIR)/SimpleXChat/exported_symbols.txt";
STRIP_INSTALLED_PRODUCT = YES;
STRIP_STYLE = "non-global";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";

View File

@@ -0,0 +1,11 @@
# Swift mangled symbols (Swift 5+ ABI stable prefix)
_$s*
# ObjC class/metaclass symbols (for NSObject subclasses)
_OBJC_CLASS_$_*
_OBJC_METACLASS_$_*
# C API (SimpleX.h bridging header)
_chat_*
_haskell_init*
_hs_init*

View File

@@ -93,6 +93,7 @@
for pkg in $out/_pkg/*.a; do
chmod +w $pkg
${mac2ios.packages.${system}.mac2ios}/bin/mac2ios $pkg
[[ "$pkg" == *simplex-chat* ]] && ${pkgs.stdenv.cc.targetPrefix}strip -x $pkg
chmod -w $pkg
done