Skip to content

Commit

Permalink
curl: fix ipv6 detection compile error in configure script
Browse files Browse the repository at this point in the history
  • Loading branch information
annalee committed Dec 30, 2023
1 parent d20560a commit 84563fc
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
46 changes: 46 additions & 0 deletions pkgs/tools/networking/curl/configure-ipv6-autodetect.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/configure b/configure
index 04d1de1..5de1b41 100755
--- a/configure
+++ b/configure
@@ -24949,15 +24949,12 @@ else $as_nop
# include <netinet/in6.h>
#endif
#endif
-#include <stdlib.h> /* for exit() */
-main()
+
+int main(void)
{
struct sockaddr_in6 s;
(void)s;
- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
- exit(1);
- else
- exit(0);
+ return socket(AF_INET6, SOCK_STREAM, 0) < 0;
}


diff --git a/configure.ac b/configure.ac
index 2d71c83..bd38dd9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1679,15 +1679,12 @@ AS_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
# include <netinet/in6.h>
#endif
#endif
-#include <stdlib.h> /* for exit() */
-main()
+
+int main(void)
{
struct sockaddr_in6 s;
(void)s;
- if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
- exit(1);
- else
- exit(0);
+ return socket(AF_INET6, SOCK_STREAM, 0) < 0;
}
]])
],
6 changes: 6 additions & 0 deletions pkgs/tools/networking/curl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-FsYqnErw9wPSi9pte783ukcFWtNBTXDexj4uYzbyqC0=";
};

patches = [
# fix ipv6 autodetect compile error in configure script
# remove once https://github.com/curl/curl/pull/12607 released (8.6.0)
./configure-ipv6-autodetect.diff
];

outputs = [ "bin" "dev" "out" "man" "devdoc" ];
separateDebugInfo = stdenv.isLinux;

Expand Down

0 comments on commit 84563fc

Please sign in to comment.