dev-libs/libgcrypt: add 1.12.2

Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2026-04-15 22:14:06 +01:00
parent a35947ce07
commit cf68aa1dfd
2 changed files with 187 additions and 0 deletions
+2
View File
@@ -2,3 +2,5 @@ DIST libgcrypt-1.11.2.tar.bz2 4237802 BLAKE2B 8ad2dd84e8ec2bddb5c008c6823a6d72b8
DIST libgcrypt-1.11.2.tar.bz2.sig 147 BLAKE2B 5126fa06a9a67b2b71711f76ecbf9f3596f300f97256378961768a2f3c3927321da649eb0df4ddfb653e4503712b8b3c363c252bcb83ca53c7eea89a3ac8d4d4 SHA512 73b1d6d53e2f9061f06628a0fe983919f745c1c92930fd6a9871a0a3a589878efe68ec48b4e17e3fd3c1e098bc38c38cc8895246cee25463377a8bfa8590b164
DIST libgcrypt-1.12.1.tar.bz2 4441330 BLAKE2B 6656d9edc5c702b5b76aa2a7504ed9f224718dc0047494f51de63f98a52e334fab1ade05e4c0ec44f92c406292090cf02193ec3f1eb754e886f3a71f9bbe1435 SHA512 e4be1f9d32bb672663499a1203454b9c646b7f237d9acb64303b991798fe3f4c3366793b0564b94c6687885353f6e7fef6ae6e74a57ccb5eb5606e77c81b3738
DIST libgcrypt-1.12.1.tar.bz2.sig 147 BLAKE2B c18304651b08872c0a42c7c87ac40e32214b9b17e56fa2528975919c75ccb08ab05d9befaeddcee5b60d0015fe0677463cfdd6ae140d53ba8268c575a153d3e9 SHA512 9068d38fe4b55af181202982c3beb7345782c03fb48eb32c26fe34405e01669db751fd8e3f58c2d4173d6523069165ce93ce447a89f8d856280b5fd0cf8a7d1b
DIST libgcrypt-1.12.2.tar.bz2 4441855 BLAKE2B f52a10acdbf56a5adc927e22508a30d131a001e8f559d55c72d4ccfea4a514ef7983ab3f985af798c06a9c188639f21c54f1cc0ec6cba968172ddc6bd21ae0bd SHA512 dc1a4a6c00a0d84d90c8d71f4bd121b968c80df74137d6e8867f1f4cc014a539efb5238c1a1429d7cb95e493a40718fc19252edc592ffe0f43057b372896591c
DIST libgcrypt-1.12.2.tar.bz2.sig 147 BLAKE2B 74adf984bda98e413f5f31aa3b2a60043773b387758caf3ec5e603ddd358bffdd58ec021c5828d1e45f2747f1766f0d63380ed4a5938565b829851e048b6279d SHA512 5991d26f0d59d646ba29c491e6952f31c970fb80b7928f999095d9f7d1435026c9304614558415c06254a81650ce08376ea09f7d93c657dfdb7ef014e58dbf28
+185
View File
@@ -0,0 +1,185 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/gnupg.asc
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/"
SRC_URI="mirror://gnupg/${PN}/${P}.tar.bz2"
SRC_URI+=" verify-sig? ( mirror://gnupg/${PN}/${P}.tar.bz2.sig )"
LICENSE="LGPL-2.1+ GPL-2+ MIT"
SLOT="0/20" # subslot = soname major version
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
IUSE="+asm doc +getentropy static-libs"
IUSE+=" cpu_flags_arm_neon cpu_flags_arm_aes cpu_flags_arm_sha1 cpu_flags_arm_sha2 cpu_flags_arm_sve"
IUSE+=" cpu_flags_ppc_altivec cpu_flags_ppc_vsx2 cpu_flags_ppc_vsx3"
IUSE+=" cpu_flags_x86_aes cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_avx512f cpu_flags_x86_padlock cpu_flags_x86_sha cpu_flags_x86_sse4_1"
# Build system only has --disable-arm-crypto-support right now
# If changing this, update src_configure logic too.
# ARM CPUs seem to, right now, support all-or-nothing for crypto extensions,
# but this looks like it might change in future. This is just a safety check
# in case people somehow do have a CPU which only supports some. They must
# for now disable them all if that's the case.
REQUIRED_USE="
cpu_flags_arm_aes? ( cpu_flags_arm_sha1 cpu_flags_arm_sha2 )
cpu_flags_arm_sha1? ( cpu_flags_arm_aes cpu_flags_arm_sha2 )
cpu_flags_arm_sha2? ( cpu_flags_arm_aes cpu_flags_arm_sha1 )
cpu_flags_ppc_vsx3? ( cpu_flags_ppc_altivec cpu_flags_ppc_vsx2 )
cpu_flags_ppc_vsx2? ( cpu_flags_ppc_altivec )
"
RDEPEND="
>=dev-libs/libgpg-error-1.56[${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 )
"
PATCHES=(
"${FILESDIR}"/${PN}-1.12.0-multilib-syspath.patch
"${FILESDIR}"/${PN}-powerpc-darwin.patch
)
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
}
src_configure() {
# Temporary workaround for a build failure (known gcc issue):
# * https://bugs.gentoo.org/956605
# * https://gcc.gnu.org/PR110812
use riscv && filter-lto
# Temporary workaround for mfpmath=sse on x86 causing issues when -msse is
# stripped as it's not clear cut on how to handle in flag-o-matic we can at
# least solve it the ebuild see https://bugs.gentoo.org/959349
use x86 && filter-flags -mfpmath=sse
# Hardcodes the path to FGREP in libgcrypt-config
export ac_cv_path_SED="sed"
export ac_cv_path_EGREP="grep -E"
export ac_cv_path_EGREP_TRADITIONAL="grep -E"
export ac_cv_path_FGREP="grep -F"
export ac_cv_path_GREP="grep"
multilib-minimal_src_configure
}
multilib_src_configure() {
if [[ ${CHOST} == powerpc* ]] ; then
# ./configure does a lot of automagic, prevent that
# generic ppc32+ppc64 altivec
use cpu_flags_ppc_altivec || local -x gcry_cv_cc_ppc_altivec=no
use cpu_flags_ppc_altivec || local -x gcry_cv_cc_ppc_altivec_cflags=no
# power8 vector extension, aka arch 2.07 ISA, also checked below via ppc-crypto-support
use cpu_flags_ppc_vsx2 || local -x gcry_cv_gcc_inline_asm_ppc_altivec=no
# power9 vector extension, aka arch 3.00 ISA
use cpu_flags_ppc_vsx3 || local -x gcry_cv_gcc_inline_asm_ppc_arch_3_00=no
fi
append-ldflags $(test-flags-CCLD -Wl,--undefined-version)
local myeconfargs=(
CC_FOR_BUILD="$(tc-getBUILD_CC)"
--enable-noexecstack
$(use_enable cpu_flags_arm_neon neon-support)
# See REQUIRED_USE comment above
$(use_enable cpu_flags_arm_aes arm-crypto-support)
$(use_enable cpu_flags_arm_sve sve-support)
$(use_enable cpu_flags_ppc_vsx2 ppc-crypto-support)
$(use_enable cpu_flags_x86_aes aesni-support)
$(use_enable cpu_flags_x86_avx avx-support)
$(use_enable cpu_flags_x86_avx2 avx2-support)
$(use_enable cpu_flags_x86_avx512f avx512-support)
$(use_enable cpu_flags_x86_padlock padlock-support)
$(use_enable cpu_flags_x86_sha shaext-support)
$(use_enable cpu_flags_x86_sse4_1 sse41-support)
# required for sys-power/suspend[crypt], bug 751568
$(use_enable static-libs static)
# disabled due to various applications requiring privileges
# after libgcrypt drops them (bug #468616)
--without-capabilities
$(use asm || echo "--disable-asm")
GPG_ERROR_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpg-error-config"
GPGRT_CONFIG="${ESYSROOT}/usr/bin/${CHOST}-gpgrt-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')
}
multilib_src_compile() {
default
multilib_is_native_abi && use doc && VARTEXFONTS="${T}/fonts" emake -C doc gcrypt.pdf
}
multilib_src_test() {
# t-secmem and t-sexp need mlock which requires extra privileges; nspawn
# at least disallows that by default.
local -x GCRYPT_IN_ASAN_TEST=1
# Avoid running (very) expensive bench-slope test. On hppa, it
# takes at least 7 hours.
local -x GCRYPT_NO_BENCHMARKS=1
default
}
multilib_src_install() {
emake DESTDIR="${D}" install
multilib_is_native_abi && use doc && dodoc doc/gcrypt.pdf
}
multilib_src_install_all() {
default
find "${ED}" -type f -name '*.la' -delete || die
}