summaryrefslogtreecommitdiff
path: root/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-11-08 21:24:43 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-11-08 21:24:43 +0000
commit4cf2f7cc6bbea59e8aec44b9508c759cf8bb4adf (patch)
tree839a94b536a4ef1c81281e42bf4be4a80483f24d /dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild
parent867ef65cd897014478ed65034b1ac3f139289a77 (diff)
gentoo auto-resync : 08:11:2022 - 21:24:43
Diffstat (limited to 'dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild')
-rw-r--r--dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild40
1 files changed, 37 insertions, 3 deletions
diff --git a/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild b/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild
index 2d7401c6a39f..5614f817ecb3 100644
--- a/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild
+++ b/dev-libs/libgcrypt/libgcrypt-1.10.1-r2.ebuild
@@ -4,7 +4,7 @@
EAPI=7
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/gnupg.asc
-inherit autotools flag-o-matic multilib-minimal toolchain-funcs verify-sig
+inherit autotools flag-o-matic linux-info multilib-minimal toolchain-funcs verify-sig
DESCRIPTION="General purpose crypto library based on the code used in GnuPG"
HOMEPAGE="https://www.gnupg.org/"
@@ -14,7 +14,7 @@ SRC_URI+=" verify-sig? ( mirror://gnupg/${PN}/${P}.tar.bz2.sig )"
LICENSE="LGPL-2.1 MIT"
SLOT="0/20" # subslot = soname major version
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"
-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"
+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"
# Build system only has --disable-arm-crypto-support right now
# If changing this, update src_configure logic too.
@@ -30,7 +30,13 @@ REQUIRED_USE="
cpu_flags_ppc_vsx2? ( cpu_flags_ppc_altivec )
"
-RDEPEND=">=dev-libs/libgpg-error-1.25[${MULTILIB_USEDEP}]"
+RDEPEND=">=dev-libs/libgpg-error-1.25[${MULTILIB_USEDEP}]
+ getentropy? (
+ kernel_linux? (
+ elibc_glibc? ( >=sys-libs/glibc-2.25 )
+ elibc_musl? ( >=sys-libs/musl-1.1.20 )
+ )
+ )"
DEPEND="${RDEPEND}"
BDEPEND="doc? ( virtual/texi2dvi )
verify-sig? ( sec-keys/openpgp-keys-gnupg )"
@@ -46,6 +52,27 @@ MULTILIB_CHOST_TOOLS=(
/usr/bin/libgcrypt-config
)
+pkg_pretend() {
+ if [[ ${MERGE_TYPE} == buildonly ]]; then
+ return
+ fi
+ if use kernel_linux && use getentropy; then
+ unset KV_FULL
+ get_running_version
+ if [[ -n ${KV_FULL} ]] && kernel_is -lt 3 17; then
+ eerror "The getentropy function requires the getrandom syscall."
+ eerror "This was introduced in Linux 3.17."
+ eerror "Your system is currently running Linux ${KV_FULL}."
+ eerror "Disable the 'getentropy' USE flag or upgrade your kernel."
+ die "Kernel is too old for getentropy"
+ fi
+ fi
+}
+
+pkg_setup() {
+ :
+}
+
src_prepare() {
default
eautoreconf
@@ -109,6 +136,13 @@ multilib_src_configure() {
GPG_ERROR_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpg-error-config"
)
+ if use kernel_linux; then
+ # --enable-random=getentropy requires getentropy/getrandom.
+ # --enable-random=linux enables legacy code that tries getrandom
+ # and falls back to reading /dev/random.
+ myeconfargs+=( --enable-random=$(usex getentropy getentropy linux) )
+ fi
+
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" \
$("${S}/configure" --help | grep -o -- '--without-.*-prefix')
}