diff --git a/pkgs/by-name/mi/mirth/package.nix b/pkgs/by-name/mi/mirth/package.nix index 759d556cd217..23036eac3194 100644 --- a/pkgs/by-name/mi/mirth/package.nix +++ b/pkgs/by-name/mi/mirth/package.nix @@ -34,6 +34,14 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeBinaryWrapper ]; postPatch = '' + ${lib.optionalString (with stdenv.buildPlatform; isAarch64 && isLinux) /* sh */ '' + # Bug report: https://todo.sr.ht/~typeswitch/mirth/16 + substituteInPlace bin/mirth0.c \ + --replace-fail "WRAP_I63(24LL);" "WRAP_I63(16LL);" + substituteInPlace lib/std/world.mth \ + --replace-fail "Linux -> 24u," "Linux -> running-arch Arch.ARM64 = if(16u, 24u)," + ''} + # Replace hard-coded GCC with stdenv’s C compiler. # NOTE: newer GCC requires optimization level ≥1 to use fortity. -O1 is # fast enough as a default for the compiler stages. @@ -51,7 +59,8 @@ stdenv.mkDerivation { "bin/mirth3" ]; - doCheck = true; + # st_mode substitution intentionally diverges from the pre-generated mirth0.c + doCheck = with stdenv.buildPlatform; !(isAarch64 && isLinux); installPhase = '' runHook preInstall