pgpgme: Fix build with python on macOS

* Replace LD_LIBRARY_PATH with OS-specific name (e.g. DYLD_LIBRARY_PATH
  on macOS).
* Disable Python tests on macOS, because they use gpg, which fails due
  to a very long socket path (https://github.com/NixOS/nix/pull/1085).

The former should be fixed upstream. The latter is a Nix-specific issue,
but it can be worked-around upstream by making Python tests respect
--disable-gpg-test.
This commit is contained in:
Kirill Elagin 2020-04-15 13:13:27 +03:00 committed by Frederik Rietdijk
parent 6673a4988e
commit 5470d96645

View file

@ -49,6 +49,15 @@ stdenv.mkDerivation rec {
postPatch =''
substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file
''
# Apply only on Darwin to save rebuilds on Linux
+ lib.optionalString stdenv.isDarwin ''
sed -i "s/LD_LIBRARY_PATH/@shlibpath_var@/" lang/python/tests/Makefile.in
sed -i "s/ac_subst_vars='/ac_subst_vars='shlibpath_var\n/" configure
''
# Disable python tests on Darwin as they use gpg (see configureFlags below)
+ lib.optionalString stdenv.isDarwin ''
sed -i "s/SUBDIRS = \. tests/SUBDIRS = ./" lang/python/Makefile.in
'';
configureFlags = [