diff --git a/pkgs/tools/archivers/cpio/darwin-fix.patch b/pkgs/tools/archivers/cpio/darwin-fix.patch new file mode 100644 index 00000000000..0e8ff168c52 --- /dev/null +++ b/pkgs/tools/archivers/cpio/darwin-fix.patch @@ -0,0 +1,15 @@ +Fix Darwin builds. + +From . +See also . + +diff --git a/src/filetypes.h b/src/filetypes.h +index f80faab..81f0c32 100644 +--- a/src/filetypes.h ++++ b/src/filetypes.h +@@ -81,5 +81,3 @@ + #ifndef S_ISLNK + #define lstat stat + #endif +-int lstat (); +-int stat (); diff --git a/pkgs/tools/archivers/cpio/default.nix b/pkgs/tools/archivers/cpio/default.nix index 25777e84311..4fa99a0ea42 100644 --- a/pkgs/tools/archivers/cpio/default.nix +++ b/pkgs/tools/archivers/cpio/default.nix @@ -1,6 +1,6 @@ {stdenv, fetchurl}: -stdenv.mkDerivation { +stdenv.mkDerivation ({ name = "cpio-2.11"; src = fetchurl { @@ -34,3 +34,9 @@ stdenv.mkDerivation { platforms = stdenv.lib.platforms.all; }; } + +// + +(if stdenv.isLinux + then {} + else { patches = [ ./darwin-fix.patch ]; }))