commit:     89dc47953394cbd86d303b939a7c77e1905a2af8
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 25 14:49:09 2023 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Apr 25 14:50:14 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=89dc4795

dev-libs/libgcrypt-1.10.2: fix compilation on Darwin, #904083

Add patch as suggested on upstream bug to fix compilation on non-Linux.

Closes: https://bugs.gentoo.org/904083
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 .../libgcrypt/files/libgcrypt-1.10.2-darwin.patch    | 20 ++++++++++++++++++++
 dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild           |  1 +
 2 files changed, 21 insertions(+)

diff --git a/dev-libs/libgcrypt/files/libgcrypt-1.10.2-darwin.patch 
b/dev-libs/libgcrypt/files/libgcrypt-1.10.2-darwin.patch
new file mode 100644
index 000000000000..6153f1840b97
--- /dev/null
+++ b/dev-libs/libgcrypt/files/libgcrypt-1.10.2-darwin.patch
@@ -0,0 +1,20 @@
+https://dev.gnupg.org/T6442
+
+Patch as suggested by Werned in https://dev.gnupg.org/T6442#169396
+
+--- a/random/rndgetentropy.c
++++ b/random/rndgetentropy.c
+@@ -94,8 +94,13 @@
+                * and might not be applicable on other FIPS modules not running
+                * RHEL kernel.
+                */
++#ifdef GRND_RANDOM
+               nbytes = length < 32 ? length : 32;
+               ret = getrandom (buffer, nbytes, GRND_RANDOM);
++#else
++              ret = -1;
++              gpg_err_set_errno (ENOSYS);
++#endif
+             }
+           else
+             {

diff --git a/dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild 
b/dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild
index 3bc1ef525b06..41cdeeafe307 100644
--- a/dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild
+++ b/dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild
@@ -45,6 +45,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-multilib-syspath.patch
        "${FILESDIR}"/${PN}-powerpc-darwin.patch
        "${FILESDIR}"/${PN}-1.9.4-no-fgrep-libgcrypt-config.patch
+       "${FILESDIR}"/${P}-darwin.patch  # upstream T6442
 )
 
 MULTILIB_CHOST_TOOLS=(

Reply via email to