From ae48e54926c99897a562fa1096aba7c87b9aa83f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=B7=F0=90=91=91=F0=90=91=B4=F0=90=91=95=F0=90=91=91?= =?UTF-8?q?=F0=90=91=A9=F0=90=91=A4?= Date: Tue, 16 Jun 2026 22:59:26 +0700 Subject: [PATCH] mirth: patch up st_mode offset on aarch64-linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is out of my wheelhouse but mirrors the Darwin code. It’s either do this sort of ugly patch, or set a aarch64-linux to broken… Assisted-by: DeepSeek V4 Flash --- pkgs/by-name/mi/mirth/package.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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