commit:     5fac28c428be08a81a1c08ab2967f2afee45bdd6
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  6 15:58:49 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Mon Sep  6 15:58:49 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5fac28c4

app-crypt/gpgme: [QA] revert e4f93d3d9d0608a84aaa8afcafc410a1b705e71a

* The revert was done without technical reason, over three weeks
  after the initial request, and the corresponding bug was not
  re-opened.

Bug: https://bugs.gentoo.org/803557
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../gpgme/files/gpgme-1.16.0-glibc-2.34.patch      | 33 ++++++++++++++++++++++
 app-crypt/gpgme/gpgme-1.16.0.ebuild                |  4 +++
 2 files changed, 37 insertions(+)

diff --git a/app-crypt/gpgme/files/gpgme-1.16.0-glibc-2.34.patch 
b/app-crypt/gpgme/files/gpgme-1.16.0-glibc-2.34.patch
new file mode 100644
index 00000000000..f328e4540ae
--- /dev/null
+++ b/app-crypt/gpgme/files/gpgme-1.16.0-glibc-2.34.patch
@@ -0,0 +1,33 @@
+https://bugs.gentoo.org/803557
+https://dev.gnupg.org/T5587
+
+From: Fabrice Fontaine <[email protected]>
+Date: Sun, 5 Sep 2021 00:05:00 +0200
+Subject: [PATCH] src/posix-io.c: fix build with glibc >= 2.34
+
+Fix the following build failure with glibc >= 2.34 raised because
+closefrom doesn't return an int but a void since its addition with
+https://github.com/bminor/glibc/commit/607449506f197cc9514408908f41f22537a47a8c
+
+```
+posix-io.c: In function '_gpgme_io_spawn':
+posix-io.c:577:23: error: void value not ignored as it ought to be
+  577 |             while ((i = closefrom (fd)) && errno == EINTR)
+      |                       ^
+```
+
+Fixes:
+ - 
http://autobuild.buildroot.org/results/b11094ddd35263071b7dd453a6590c5b684026ff
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+--- a/src/posix-io.c
++++ b/src/posix-io.c
+@@ -570,7 +570,7 @@ _gpgme_io_spawn (const char *path, char *const argv[], 
unsigned int flags,
+               if (fd_list[i].fd > fd)
+                 fd = fd_list[i].fd;
+             fd++;
+-#if defined(__sun) || defined(__FreeBSD__)
++#if defined(__sun) || defined(__FreeBSD__) || (defined (__GLIBC__) && 
__GLIBC__ == 2 && __GLIBC_MINOR__ >= 34)
+             closefrom (fd);
+             max_fds = fd;
+ #else /*!__sun */

diff --git a/app-crypt/gpgme/gpgme-1.16.0.ebuild 
b/app-crypt/gpgme/gpgme-1.16.0.ebuild
index ed9a1cc7e57..d8df58daf47 100644
--- a/app-crypt/gpgme/gpgme-1.16.0.ebuild
+++ b/app-crypt/gpgme/gpgme-1.16.0.ebuild
@@ -29,6 +29,10 @@ BDEPEND="python? ( dev-lang/swig )"
 
 REQUIRED_USE="qt5? ( cxx ) python? ( ${PYTHON_REQUIRED_USE} )"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-glibc-2.34.patch
+)
+
 do_python() {
        if use python; then
                pushd "lang/python" > /dev/null || die

Reply via email to