From 926bb4273e564ef15a4e55811f370ef3d331d311 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 1 Feb 2025 16:54:01 +0000 Subject: [PATCH] parted: backport upstream C23 fix Without the change the build against c23 compiler (like `gcc-15`) fails as: parted> parted.c: In function '_init_commands': parted> parted.c:2469:9: error: passing argument 2 of 'command_create' from incompatible pointer type [] parted> 2469 | do_version, parted> | ^~~~~~~~~~ parted> | | parted> | int (*)(void) --- pkgs/by-name/pa/parted/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/pa/parted/package.nix b/pkgs/by-name/pa/parted/package.nix index 4fc1615665e3..7f8a181303e4 100644 --- a/pkgs/by-name/pa/parted/package.nix +++ b/pkgs/by-name/pa/parted/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchurl, + fetchpatch, lvm2, libuuid, gettext, @@ -24,6 +25,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-O0Pb4zzKD5oYYB66tWt4UrEo7Bo986mzDM3l5zNZ5hI="; }; + patches = [ + # Fix the build against C23 compilers (like gcc-15): + (fetchpatch { + name = "c23.patch"; + url = "https://git.savannah.gnu.org/gitweb/?p=parted.git;a=patch;h=16343bda6ce0d41edf43f8dac368db3bbb63d271"; + hash = "sha256-8FgnwMrzMHPZNU+b/mRHCSu8sn6H7GhVLIhMUel40Hk="; + }) + ]; + outputs = [ "out" "dev"