Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libgcrypt/
Date: Tue, 08 Nov 2022 17:05:50
Message-Id: 1667927079.8c19036cac71bf2b45459cc7d66b5985e2956c69.floppym@gentoo
1 commit: 8c19036cac71bf2b45459cc7d66b5985e2956c69
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 4 15:34:10 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 8 17:04:39 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c19036c
7
8 dev-libs/libgcrypt: add 'getentropy' USE flag
9
10 This allows for explicit control of the --enable-random configure
11 option.
12
13 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
14
15 dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild | 17 +++++++++++++++--
16 dev-libs/libgcrypt/metadata.xml | 1 +
17 2 files changed, 16 insertions(+), 2 deletions(-)
18
19 diff --git a/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild b/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild
20 index 2d7401c6a39f..844c21219fb8 100644
21 --- a/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild
22 +++ b/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild
23 @@ -14,7 +14,7 @@ SRC_URI+=" verify-sig? ( mirror://gnupg/${PN}/${P}.tar.bz2.sig )"
24 LICENSE="LGPL-2.1 MIT"
25 SLOT="0/20" # subslot = soname major version
26 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
27 -IUSE="+asm cpu_flags_arm_neon cpu_flags_arm_aes cpu_flags_arm_sha1 cpu_flags_arm_sha2 cpu_flags_ppc_altivec cpu_flags_ppc_vsx2 cpu_flags_ppc_vsx3 cpu_flags_x86_aes cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_padlock cpu_flags_x86_sha cpu_flags_x86_sse4_1 doc static-libs"
28 +IUSE="+asm cpu_flags_arm_neon cpu_flags_arm_aes cpu_flags_arm_sha1 cpu_flags_arm_sha2 cpu_flags_ppc_altivec cpu_flags_ppc_vsx2 cpu_flags_ppc_vsx3 cpu_flags_x86_aes cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_padlock cpu_flags_x86_sha cpu_flags_x86_sse4_1 doc +getentropy static-libs"
29
30 # Build system only has --disable-arm-crypto-support right now
31 # If changing this, update src_configure logic too.
32 @@ -30,7 +30,13 @@ REQUIRED_USE="
33 cpu_flags_ppc_vsx2? ( cpu_flags_ppc_altivec )
34 "
35
36 -RDEPEND=">=dev-libs/libgpg-error-1.25[${MULTILIB_USEDEP}]"
37 +RDEPEND=">=dev-libs/libgpg-error-1.25[${MULTILIB_USEDEP}]
38 + getentropy? (
39 + kernel_linux? (
40 + elibc_glibc? ( >=sys-libs/glibc-2.25 )
41 + elibc_musl? ( >=sys-libs/musl-1.1.20 )
42 + )
43 + )"
44 DEPEND="${RDEPEND}"
45 BDEPEND="doc? ( virtual/texi2dvi )
46 verify-sig? ( sec-keys/openpgp-keys-gnupg )"
47 @@ -109,6 +115,13 @@ multilib_src_configure() {
48 GPG_ERROR_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpg-error-config"
49 )
50
51 + if use kernel_linux; then
52 + # --enable-random=getentropy requires getentropy/getrandom.
53 + # --enable-random=linux enables legacy code that tries getrandom
54 + # and falls back to reading /dev/random.
55 + myeconfargs+=( --enable-random=$(usex getentropy getentropy linux) )
56 + fi
57 +
58 ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" \
59 $("${S}/configure" --help | grep -o -- '--without-.*-prefix')
60 }
61
62 diff --git a/dev-libs/libgcrypt/metadata.xml b/dev-libs/libgcrypt/metadata.xml
63 index 5ec9f7d1803a..6fc509a00bd7 100644
64 --- a/dev-libs/libgcrypt/metadata.xml
65 +++ b/dev-libs/libgcrypt/metadata.xml
66 @@ -14,5 +14,6 @@
67 </upstream>
68 <use>
69 <flag name="asm">Enable assembly for optimization</flag>
70 + <flag name="getentropy">Use getentropy function to obtain randomness from the kernel</flag>
71 </use>
72 </pkgmetadata>