From 5470d96645194dfb65a1acfce317703da6da8aad Mon Sep 17 00:00:00 2001 From: Kirill Elagin Date: Wed, 15 Apr 2020 13:13:27 +0300 Subject: [PATCH] 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. --- pkgs/development/libraries/gpgme/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix index 6a31515be3f..a271b72c2e7 100644 --- a/pkgs/development/libraries/gpgme/default.nix +++ b/pkgs/development/libraries/gpgme/default.nix @@ -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 = [