pkgsStatic.libgpg-error: make tests pass

Correct config.h generated by ./configure to not attempt to use weak symbols
during static linking.
This commit is contained in:
Dmitry Bogatov 2022-11-11 19:29:48 -05:00 committed by Yt
parent adfc0d8dba
commit 1d168df13a

View file

@ -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 <https://hydra.nixos.org/build/2931046/nixlog/1/raw>.)
# 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