Files
simplex-chat/scripts/nix/android-iserv-project.nix
T
Moritz Angermann 11b7f33921 Seed SplitMix on Android below API 28
Use Bionic arc4random_buf for the older Android API route and retain the existing getentropy initializer from API 28. Register the real function address in the ARM32 interpreter so loaded SplitMix objects can resolve it.

Both ABI controls verify API26 compilation and linking against the actual NDK headers and providers, and API35 object equality. Final source checks use native LLVM21; exact final NDK18 and production package-tar validation remain for CI after local VM startup failures.
2026-10-17 04:03:38 +09:00

29 lines
1007 B
Nix

{ config, lib, pkgs, ... }:
let
arm32 = pkgs.stdenv.hostPlatform.isAarch32;
arm64 = pkgs.stdenv.hostPlatform.isAarch64;
in
lib.mkIf (
pkgs.stdenv.hostPlatform.isAndroid
&& (arm32 || arm64)
&& config.compiler-nix-name == "ghc914-sh"
&& config.name == "iserv-proxy"
) {
# Patch before Cabal planning: v2 hashes must describe the same source it
# later packages. Keep symbol registration consistent with the target ABI
# and Android API level.
src = lib.mkForce (pkgs.pkgsBuildBuild.applyPatches {
name = "android-${if arm32 then "arm32" else "arm64"}-iserv-proxy-source";
src = pkgs.haskell-nix.sources.iserv-proxy;
patches = if arm32 then [
./android-iserv-static-libc.patch
# The API26 project declares GNU libiconv for ghc-internal. Its real
# definitions need explicit registration in the static interpreter.
./android-iserv-gnu-iconv.patch
./android-iserv-arm32-entropy.patch
] else [
./android-iserv-arm64-api.patch
];
});
}