From 82e0078428dbca9836a26cee9ed2aacfaea2bfcf Mon Sep 17 00:00:00 2001 From: whispers Date: Mon, 27 Jul 2026 17:54:43 -0400 Subject: [PATCH] hm: apply upstream patch for gcc 16 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 16 has better analysis of unused variables than previous versions. Since HM builds with -Werror by default, this causes a build failure, so we fetch the commit that fixed this issue upstream. We elected to take a patch instead of suppressing the error (with -Wno-error=…) since patches will be removed on the next update while flags often sit untouched and unnoticed long after they're necessary. --- pkgs/by-name/hm/hm/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/hm/hm/package.nix b/pkgs/by-name/hm/hm/package.nix index 600a07b375e5..ac584e7939ae 100644 --- a/pkgs/by-name/hm/hm/package.nix +++ b/pkgs/by-name/hm/hm/package.nix @@ -20,6 +20,18 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-zWBwrnCNKi2sIopdu2XQj/7IoTsJQzlcIFNNKM0glDQ="; }; + patches = [ + # GCC 16 has better analysis of unused variables than previous versions. + # Since HM builds with -Werror by default, this causes a build failure, so + # we fetch the commit that fixed this issue upstream until it makes it into + # a release. + (fetchpatch { + name = "gcc16-unused-variable.patch"; + url = "https://vcgit.hhi.fraunhofer.de/jvet/HM/-/commit/884d704b9d04ac1728b2c6049174e47eb04987d2.patch"; + hash = "sha256-UqZf7XFTEOpfE0Uyyrq+ydScR9GzMgR+JQVeZGFjc1c="; + }) + ]; + postPatch = '' substituteInPlace CMakeLists.txt \ --replace-fail "-msse4.1" ""