From 8ce135bef9a6ab2b340447ba7c20bc7deddcf9aa Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:39:14 +0300 Subject: [PATCH 1/7] ecwolf: fix build with gcc-14 --- pkgs/by-name/ec/ecwolf/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/ec/ecwolf/package.nix b/pkgs/by-name/ec/ecwolf/package.nix index e1b571f52e743..76d679f8a80da 100644 --- a/pkgs/by-name/ec/ecwolf/package.nix +++ b/pkgs/by-name/ec/ecwolf/package.nix @@ -15,6 +15,7 @@ writers, python3Packages, nix-update, + fetchpatch, }: stdenv.mkDerivation rec { @@ -28,6 +29,15 @@ stdenv.mkDerivation rec { sha256 = "V2pSP8i20zB50WtUMujzij+ISSupdQQ/oCYYrOaTU1g="; }; + patches = [ + # Fixes build with gcc >= 14. Shouldn't be needed for ecwolf versions > 1.4.1. + (fetchpatch { + name = "tmemory.h-const-correctness.patch"; + url = "https://bitbucket.org/ecwolf/ecwolf/commits/400aaf96a36a14ab8eab18a670ba6439046f3bb0/raw"; + hash = "sha256-2YwHEctBPyprs0DVsazimGEgmiCba24zh2dFfw9tOnU="; + }) + ]; + nativeBuildInputs = [ cmake pkg-config From 81ec266e5915c82fcde7d7f9aadf3ca072a0a0c3 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:40:11 +0300 Subject: [PATCH 2/7] ecwolf: don't use pname in fetchFromBitbucket This is discouraged. See https://github.com/NixOS/nixpkgs/issues/277994. --- pkgs/by-name/ec/ecwolf/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ec/ecwolf/package.nix b/pkgs/by-name/ec/ecwolf/package.nix index 76d679f8a80da..6faeba5aa5c01 100644 --- a/pkgs/by-name/ec/ecwolf/package.nix +++ b/pkgs/by-name/ec/ecwolf/package.nix @@ -23,8 +23,8 @@ stdenv.mkDerivation rec { version = "1.4.1"; src = fetchFromBitbucket { - owner = pname; - repo = pname; + owner = "ecwolf"; + repo = "ecwolf"; rev = version; sha256 = "V2pSP8i20zB50WtUMujzij+ISSupdQQ/oCYYrOaTU1g="; }; From 45484b9a5c829ca8cd69c91b98131c46dc5360d7 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:46:33 +0300 Subject: [PATCH 3/7] ecwolf: use finalAttrs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change, the ecwolf package used a recursive attribute set. In general, it’s recommended that you avoid using recursive attribute sets [1]. This change makes it so that the ecwolf package uses finalAttrs instead of a recursive attribute set. As an added bonus, this also means that ecwolf.src.rev will automatically get updated if someone calls ecwolf.overrideAttrs and overrides ecwolf.version. [1]: Co-authored-by: Jason Yundt --- pkgs/by-name/ec/ecwolf/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ec/ecwolf/package.nix b/pkgs/by-name/ec/ecwolf/package.nix index 6faeba5aa5c01..68b8b503a0448 100644 --- a/pkgs/by-name/ec/ecwolf/package.nix +++ b/pkgs/by-name/ec/ecwolf/package.nix @@ -18,14 +18,14 @@ fetchpatch, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "ecwolf"; version = "1.4.1"; src = fetchFromBitbucket { owner = "ecwolf"; repo = "ecwolf"; - rev = version; + rev = finalAttrs.version; sha256 = "V2pSP8i20zB50WtUMujzij+ISSupdQQ/oCYYrOaTU1g="; }; @@ -115,4 +115,4 @@ stdenv.mkDerivation rec { ]; platforms = platforms.all; }; -} +}) From 32c483ca576a96b7e7a607491b806f0e81a233a1 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Thu, 26 Dec 2024 10:05:24 -0500 Subject: [PATCH 4/7] ecwolf: make sure that a tag is fetched MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change, ecwolf.src.rev was set to the name of a tag. This is generally not recommended. It’s better to set rev to "refs/tags/" [1]. [1]: --- pkgs/by-name/ec/ecwolf/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ec/ecwolf/package.nix b/pkgs/by-name/ec/ecwolf/package.nix index 68b8b503a0448..dee16bc3d3b06 100644 --- a/pkgs/by-name/ec/ecwolf/package.nix +++ b/pkgs/by-name/ec/ecwolf/package.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromBitbucket { owner = "ecwolf"; repo = "ecwolf"; - rev = finalAttrs.version; + rev = "refs/tags/${finalAttrs.version}"; sha256 = "V2pSP8i20zB50WtUMujzij+ISSupdQQ/oCYYrOaTU1g="; }; From d1d588d4021675478d21054b2cbbc14871bcd389 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 25 Dec 2024 22:48:56 +0300 Subject: [PATCH 5/7] ecwolf: sha256 -> hash It looks like sha256 will eventually be deprecated in favor of hash: . --- pkgs/by-name/ec/ecwolf/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/ec/ecwolf/package.nix b/pkgs/by-name/ec/ecwolf/package.nix index dee16bc3d3b06..f8c3a8fe638a1 100644 --- a/pkgs/by-name/ec/ecwolf/package.nix +++ b/pkgs/by-name/ec/ecwolf/package.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "ecwolf"; repo = "ecwolf"; rev = "refs/tags/${finalAttrs.version}"; - sha256 = "V2pSP8i20zB50WtUMujzij+ISSupdQQ/oCYYrOaTU1g="; + hash = "sha256-V2pSP8i20zB50WtUMujzij+ISSupdQQ/oCYYrOaTU1g="; }; patches = [ From 4915c2ec6ff1dcaf042995e4d6345fe720fc8612 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 25 Dec 2024 23:02:12 +0300 Subject: [PATCH 6/7] lzwolf: fix build with gcc-14 --- pkgs/games/lzwolf/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/games/lzwolf/default.nix b/pkgs/games/lzwolf/default.nix index 9bfba6f916011..2d68ed1d5462b 100644 --- a/pkgs/games/lzwolf/default.nix +++ b/pkgs/games/lzwolf/default.nix @@ -36,6 +36,12 @@ stdenv.mkDerivation rec { url = "https://bitbucket.org/soturi/lzwolf/commits/41f212026dff4f089d1c0921cb49ab1a2b81e0d6/raw"; hash = "sha256-EgSdDaZovD7DyZ0BkuX8ZdsrX7J7v8/D6y5P1NWGJew="; }) + # Fixes build with gcc >= 14. Picked patch from the original ecwolf repo. + (fetchpatch { + name = "tmemory.h-const-correctness.patch"; + url = "https://bitbucket.org/ecwolf/ecwolf/commits/400aaf96a36a14ab8eab18a670ba6439046f3bb0/raw"; + hash = "sha256-2YwHEctBPyprs0DVsazimGEgmiCba24zh2dFfw9tOnU="; + }) ]; postPatch = '' From 83378e0387a5a0e3f6e29746ea5d0d2875c0f55f Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Wed, 25 Dec 2024 23:04:58 +0300 Subject: [PATCH 7/7] lzwolf: sha256 -> hash It looks like sha256 will eventually be deprecated in favor of hash: . --- pkgs/games/lzwolf/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/games/lzwolf/default.nix b/pkgs/games/lzwolf/default.nix index 2d68ed1d5462b..44551efd384a4 100644 --- a/pkgs/games/lzwolf/default.nix +++ b/pkgs/games/lzwolf/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { owner = "linuxwolf6"; repo = "lzwolf"; rev = "a24190604296e16941c601b57afe4350462fc659"; - sha256 = "sha256-CtBdvk6LXb/ll92Fxig/M4t4QNj8dNFJYd8F99b47kQ="; + hash = "sha256-CtBdvk6LXb/ll92Fxig/M4t4QNj8dNFJYd8F99b47kQ="; }; patches = [