about summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorDmitry Bogatov <serenity@kaction.cc>2022-11-11 19:29:48 -0500
committerYt <happysalada@proton.me>2023-01-02 11:19:17 -0500
commit1d168df13a12585bca57a198e3131e3172bd3d4b (patch)
tree861dacb760eca0aa0cc750f357fafacbc84079fd /pkgs/development/libraries
parentadfc0d8dba482ec0b642cfdb0e79fa81d1fb1632 (diff)
pkgsStatic.libgpg-error: make tests pass
Correct config.h generated by ./configure to not attempt to use weak symbols
during static linking.
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/libgpg-error/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix
index 4f687d41dd6ea..fcd7946a1351f 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 <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