From 74c81a64f0a2d082edd948112493814bf5033a51 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Fri, 8 Jan 2021 04:20:00 +0000 Subject: [PATCH] gpgme: fix build on darwin --- pkgs/development/libraries/gpgme/default.nix | 4 ++- ...ix-clang-autoconf-undeclared-warning.patch | 36 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix index 067d62a11a27..6f1626a0abe5 100644 --- a/pkgs/development/libraries/gpgme/default.nix +++ b/pkgs/development/libraries/gpgme/default.nix @@ -34,7 +34,9 @@ stdenv.mkDerivation rec { sha256 = "00d4sxq63601lzdp2ha1i8fvybh7dzih4531jh8bx07fab3sw65g"; }) # Disable python tests on Darwin as they use gpg (see configureFlags below) - ] ++ lib.optional stdenv.isDarwin ./disable-python-tests.patch; + ] ++ lib.optional stdenv.isDarwin ./disable-python-tests.patch + # Fix _AC_UNDECLARED_WARNING for autoconf≥2.70. See https://lists.gnupg.org/pipermail/gnupg-devel/2020-November/034643.html + ++ lib.optional stdenv.cc.isClang ./fix-clang-autoconf-undeclared-warning.patch; outputs = [ "out" "dev" "info" ]; outputBin = "dev"; # gpgme-config; not so sure about gpgme-tool diff --git a/pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch b/pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch new file mode 100644 index 000000000000..2d08f982ce6f --- /dev/null +++ b/pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch @@ -0,0 +1,36 @@ +diff -Naur gpgme.old/configure.ac gpgme.new/configure.ac +--- gpgme.old/configure.ac 2020-11-12 04:19:50.000000000 -0500 ++++ gpgme.new/configure.ac 2021-01-08 03:04:38.000000000 -0500 +@@ -166,6 +166,16 @@ + mym4_minor mym4_micro) + AC_SUBST(VERSION_NUMBER) + ++# Try to find a thread-safe version of ttyname(). ++gnupg_REPLACE_TTYNAME_R ++if test "$ac_cv_func_ttyname_r" != yes; then ++ AC_MSG_WARN([ ++*** ++*** ttyname() is not thread-safe and ttyname_r() does not exist ++***]) ++fi ++ ++ + # We need to compile and run a program on the build machine. A + # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in + # the AC archive is broken for autoconf 2.57. Given that there is no +@@ -658,15 +668,6 @@ + + AC_FUNC_FSEEKO + +-# Try to find a thread-safe version of ttyname(). +-gnupg_REPLACE_TTYNAME_R +-if test "$ac_cv_func_ttyname_r" != yes; then +- AC_MSG_WARN([ +-*** +-*** ttyname() is not thread-safe and ttyname_r() does not exist +-***]) +-fi +- + # Try to find a thread-safe version of getenv(). + have_thread_safe_getenv=no + jm_GLIBC21