From 1d168df13a12585bca57a198e3131e3172bd3d4b Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Fri, 11 Nov 2022 19:29:48 -0500 Subject: [PATCH] pkgsStatic.libgpg-error: make tests pass Correct config.h generated by ./configure to not attempt to use weak symbols during static linking. --- pkgs/development/libraries/libgpg-error/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix index 4f687d41dd6e..fcd7946a1351 100644 --- a/pkgs/development/libraries/libgpg-error/default.nix +++ b/pkgs/development/libraries/libgpg-error/default.nix @@ -37,13 +37,21 @@ in stdenv.mkDerivation (rec { nativeBuildInputs = [ gettext ]; postConfigure = - lib.optionalString stdenv.isSunOS # For some reason, /bin/sh on OpenIndiana leads to this at the end of the # `config.status' run: # ./config.status[1401]: shift: (null): bad number # (See .) # Thus, re-run it with Bash. - "${stdenv.shell} config.status"; + lib.optionalString stdenv.isSunOS '' + ${stdenv.shell} config.status + '' + # ./configure errorneous decides to use weak symbols on pkgsStatic, + # which, together with other defines results in locking functions in + # src/posix-lock.c to be no-op, causing tests/t-lock.c to fail. + + lib.optionalString stdenv.hostPlatform.isStatic '' + sed '/USE_POSIX_THREADS_WEAK/ d' config.h + echo '#undef USE_POSIX_THREADS_WEAK' >> config.h + ''; doCheck = true; # not cross