lol

Merge pull request #324471 from paparodeo/db-configure-fixes

db4: fix pthread configure detection

authored by

Emily and committed by
GitHub
2c5b5ebf f8a6105a

+27 -10
+23 -3
pkgs/development/libraries/db/clang-4.8.patch
··· 153 153 diff -ur a/dist/aclocal/mutex.m4 b/dist/aclocal/mutex.m4 154 154 --- a/dist/aclocal/mutex.m4 1969-12-31 19:00:01.000000000 -0500 155 155 +++ b/dist/aclocal/mutex.m4 2023-06-05 19:14:47.214158196 -0400 156 - @@ -4,6 +4,7 @@ 156 + @@ -3,7 +3,9 @@ 157 + # POSIX pthreads tests: inter-process safe and intra-process only. 157 158 AC_DEFUN(AM_PTHREADS_SHARED, [ 158 159 AC_TRY_RUN([ 160 + +#include <stdlib.h> 159 161 #include <pthread.h> 160 162 +int 161 163 main() { 162 164 pthread_cond_t cond; 163 165 pthread_mutex_t mutex; 164 - @@ -46,6 +47,7 @@ 166 + @@ -24,6 +26,7 @@ main() { 167 + pthread_mutexattr_destroy(&mutexattr)); 168 + }], [db_cv_mutex="$1"],, 169 + AC_TRY_LINK([ 170 + +#include <stdlib.h> 171 + #include <pthread.h>],[ 172 + pthread_cond_t cond; 173 + pthread_mutex_t mutex; 174 + @@ -45,7 +48,9 @@ AC_TRY_LINK([ 175 + ], [db_cv_mutex="$1"]))]) 165 176 AC_DEFUN(AM_PTHREADS_PRIVATE, [ 166 177 AC_TRY_RUN([ 178 + +#include <stdlib.h> 167 179 #include <pthread.h> 168 180 +int 169 181 main() { 170 182 pthread_cond_t cond; 171 183 pthread_mutex_t mutex; 184 + @@ -64,6 +69,7 @@ main() { 185 + pthread_mutexattr_destroy(&mutexattr)); 186 + }], [db_cv_mutex="$1"],, 187 + AC_TRY_LINK([ 188 + +#include <stdlib.h> 189 + #include <pthread.h>],[ 190 + pthread_cond_t cond; 191 + pthread_mutex_t mutex; 172 192 diff -ur a/dist/aclocal/sequence.m4 b/dist/aclocal/sequence.m4 173 193 --- a/dist/aclocal/sequence.m4 1969-12-31 19:00:01.000000000 -0500 174 194 +++ b/dist/aclocal/sequence.m4 2023-06-05 19:14:02.007869956 -0400 ··· 183 203 $db_cv_seq_type l; 184 204 unsigned $db_cv_seq_type u; 185 205 @@ -59,7 +62,9 @@ 186 - return (1); 206 + return (1); 187 207 return (0); 188 208 }],, [db_cv_build_sequence="no"], 189 209 - AC_TRY_LINK(,[
+2 -4
pkgs/development/libraries/db/db-4.8.nix
··· 1 - { lib, stdenv, fetchurl, autoreconfHook, targetPlatform, ... } @ args: 1 + { lib, stdenv, fetchurl, autoreconfHook, ... } @ args: 2 2 3 - import ./generic.nix (builtins.removeAttrs args ["targetPlatform"] // { 3 + import ./generic.nix (args // { 4 4 version = "4.8.30"; 5 5 sha256 = "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"; 6 6 extraPatches = [ ··· 8 8 ./CVE-2017-10140-4.8-cwd-db_config.patch 9 9 ./darwin-mutexes-4.8.patch 10 10 ]; 11 - 12 - drvArgs.configureFlags = lib.optional (targetPlatform.useLLVM or false) "--with-mutex=POSIX/pthreads"; 13 11 14 12 drvArgs.hardeningDisable = [ "format" ]; 15 13 drvArgs.doCheck = false;
+2 -3
pkgs/development/libraries/db/generic.nix
··· 67 67 (if compat185 then "--enable-compat185" else "--disable-compat185") 68 68 ] 69 69 ++ lib.optional dbmSupport "--enable-dbm" 70 - ++ lib.optional stdenv.isFreeBSD "--with-pic" 71 - ++ (drvArgs.configureFlags or []); 70 + ++ lib.optional stdenv.isFreeBSD "--with-pic"; 72 71 73 72 preConfigure = '' 74 73 cd build_unix ··· 93 92 license = license; 94 93 platforms = platforms.unix; 95 94 }; 96 - } // builtins.removeAttrs drvArgs [ "configureFlags" ]) 95 + } // drvArgs)