summary refs log tree commit diff
path: root/pkgs/development/libraries/apr-util
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/apr-util')
-rw-r--r--pkgs/development/libraries/apr-util/clang-bdb.patch12
-rw-r--r--pkgs/development/libraries/apr-util/default.nix9
2 files changed, 18 insertions, 3 deletions
diff --git a/pkgs/development/libraries/apr-util/clang-bdb.patch b/pkgs/development/libraries/apr-util/clang-bdb.patch
new file mode 100644
index 00000000000..02e9c8378c6
--- /dev/null
+++ b/pkgs/development/libraries/apr-util/clang-bdb.patch
@@ -0,0 +1,12 @@
+diff -ur a/build/dbm.m4 b/build/dbm.m4
+--- a/build/dbm.m4	2013-11-23 13:00:53.000000000 -0500
++++ b/build/dbm.m4	2023-10-22 20:16:37.764571446 -0400
+@@ -235,7 +235,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <$apu_try_berkeley_db_header>
+-main ()
++int main ()
+ {
+   int major, minor, patch;
+ 
diff --git a/pkgs/development/libraries/apr-util/default.nix b/pkgs/development/libraries/apr-util/default.nix
index b44b410d30e..a1cbbc5e664 100644
--- a/pkgs/development/libraries/apr-util/default.nix
+++ b/pkgs/development/libraries/apr-util/default.nix
@@ -19,15 +19,18 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-pBB243EHRjJsOUUEKZStmk/KwM4Cd92P6gdv7DyXcrU=";
   };
 
-  patches = [ ./fix-libxcrypt-build.patch ]
-    ++ lib.optional stdenv.isFreeBSD ./include-static-dependencies.patch;
+  patches = [
+    ./fix-libxcrypt-build.patch
+    # Fix incorrect Berkeley DB detection with newer versions of clang due to implicit `int` on main errors.
+    ./clang-bdb.patch
+  ] ++ lib.optional stdenv.isFreeBSD ./include-static-dependencies.patch;
 
   NIX_CFLAGS_LINK = [ "-lcrypt" ];
 
   outputs = [ "out" "dev" ];
   outputBin = "dev";
 
-  nativeBuildInputs = [ makeWrapper ] ++ lib.optional stdenv.isFreeBSD autoreconfHook;
+  nativeBuildInputs = [ makeWrapper autoreconfHook ];
 
   configureFlags = [ "--with-apr=${apr.dev}" "--with-expat=${expat.dev}" ]
     ++ lib.optional (!stdenv.isCygwin) "--with-crypto"