about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/archivers/cpio/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/archivers/cpio/default.nix')
-rw-r--r--nixpkgs/pkgs/tools/archivers/cpio/default.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/archivers/cpio/default.nix b/nixpkgs/pkgs/tools/archivers/cpio/default.nix
index 1b766fed1492..4116a0b3e4ca 100644
--- a/nixpkgs/pkgs/tools/archivers/cpio/default.nix
+++ b/nixpkgs/pkgs/tools/archivers/cpio/default.nix
@@ -1,6 +1,8 @@
 { lib
 , stdenv
 , fetchurl
+, fetchpatch
+, autoreconfHook
 
 # for passthru.tests
 , git
@@ -18,6 +20,17 @@ stdenv.mkDerivation rec {
     sha256 = "/NwV1g9yZ6b8fvzWudt7bIlmxPL7u5ZMJNQTNv0/LBI=";
   };
 
+  patches = [
+    # Pull upstream fix for clang-16 and gcc-14.
+    (fetchpatch {
+      name = "major-decl.patch";
+      url = "https://git.savannah.gnu.org/cgit/cpio.git/patch/?id=8179be21e664cedb2e9d238cc2f6d04965e97275";
+      hash = "sha256-k5Xiv3xuPU8kPT6D9B6p+V8SK55ybFgrIIPDgHuorpM=";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
   separateDebugInfo = true;
 
   preConfigure = lib.optionalString stdenv.isCygwin ''