Skip to content

Commit

Permalink
Merge #235121: unzip: fix configure script when using clang 16
Browse files Browse the repository at this point in the history
...into staging
  • Loading branch information
vcunat committed Jun 11, 2023
2 parents 2ec150f + 1364837 commit 0d6c7b6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkgs/tools/archivers/unzip/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ stdenv.mkDerivation rec {
];
sha256 = "sha256-on79jElQ+z2ULWAq14RpluAqr9d6itHiZwDkKubBzTc=";
})
# Clang 16 makes implicit declarations an error by default for C99 and newer, causing the
# configure script to fail to detect errno and the directory libraries on Darwin.
./implicit-declarations-fix.patch
] ++ lib.optional enableNLS
(fetchurl {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/app-arch/unzip/files/unzip-6.0-natspec.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d";
name = "unzip-6.0-natspec.patch";
sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1";
});


nativeBuildInputs = [ bzip2 ];
buildInputs = [ bzip2 ] ++ lib.optional enableNLS libnatspec;

Expand Down
21 changes: 21 additions & 0 deletions pkgs/tools/archivers/unzip/implicit-declarations-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- a/unix/configure 2009-04-16 15:25:12.000000000 -0400
+++ b/unix/configure 2023-05-30 15:18:33.670321348 -0400
@@ -408,7 +408,7 @@
echo Check for errno declaration
cat > conftest.c << _EOF_
#include <errno.h>
-main()
+int main()
{
errno = 0;
return 0;
@@ -419,6 +419,8 @@

echo Check for directory libraries
cat > conftest.c << _EOF_
+#include <sys/types.h>
+#include <dirent.h>
int main() { return closedir(opendir(".")); }
_EOF_


0 comments on commit 0d6c7b6

Please sign in to comment.