Commit 1d168df1 authored by Dmitry Bogatov's avatar Dmitry Bogatov Committed by Yt
Browse files

pkgsStatic.libgpg-error: make tests pass

Correct config.h generated by ./configure to not attempt to use weak symbols
during static linking.
parent adfc0d8d
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -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