Files
simplex-chat/scripts/nix/android-iconv-overlay.nix
T
Moritz Angermann ef3a3b0b78 Provide static iconv for Android GHC boot libraries
Apply the API 26 dependency before planning every ghc914-sh Android project, including the auxiliary iserv projects and evalWith variants. Preserve the GNU headers and library paths in the plan and ghc-internal registration, and compile the static iconv archives with PIC for libsimplex.so.

Validated Nix parsing, duplicate module handling, the actual ARMv7 iserv plan arguments, and a real static/PIC libiconv build. The focused ghc-internal build remains pending.
2026-10-15 22:24:36 +09:00

17 lines
730 B
Nix

final: prev:
prev.lib.optionalAttrs prev.stdenv.hostPlatform.isAndroid {
# haskell.nix supplies static-only GNU libiconv on Android. Its objects
# also become part of libsimplex.so, so build the archive with PIC.
libiconv = prev.libiconv.overrideAttrs (old: {
configureFlags = old.configureFlags ++ [ "--with-pic" ];
});
haskell-nix = prev.haskell-nix // {
# iserv has its own boot-library projects, including evalWith variants.
# Add the paths before each plan, rather than only to the app's modules.
cabalProject' = projectModule: prev.haskell-nix.cabalProject' (
[ ./android-iconv-project.nix ]
++ (if builtins.isList projectModule then projectModule else [ projectModule ])
);
};
}