From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1505121-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 3D57515ACB3
	for <garchives@archives.gentoo.org>; Fri,  7 Apr 2023 10:07:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 77323E0919;
	Fri,  7 Apr 2023 10:07:03 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 50AE8E0919
	for <gentoo-commits@lists.gentoo.org>; Fri,  7 Apr 2023 10:07:03 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 574D734106A
	for <gentoo-commits@lists.gentoo.org>; Fri,  7 Apr 2023 10:07:02 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id C7CC98E6
	for <gentoo-commits@lists.gentoo.org>; Fri,  7 Apr 2023 10:07:00 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1680859563.a02a436dd3e9bf2410a4528fecb2970777b3f82b.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libgcrypt/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-libs/libgcrypt/Manifest dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild
X-VCS-Directories: dev-libs/libgcrypt/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: a02a436dd3e9bf2410a4528fecb2970777b3f82b
X-VCS-Branch: master
Date: Fri,  7 Apr 2023 10:07:00 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 50b8af65-c245-4420-b7e1-977379602899
X-Archives-Hash: 0d077aeccf58f5d5e90927d40f2c26d3

commit:     a02a436dd3e9bf2410a4528fecb2970777b3f82b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr  7 09:26:03 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr  7 09:26:03 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a02a436d

dev-libs/libgcrypt: add 1.10.2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/libgcrypt/Manifest                |   2 +
 dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild | 170 +++++++++++++++++++++++++++++
 2 files changed, 172 insertions(+)

diff --git a/dev-libs/libgcrypt/Manifest b/dev-libs/libgcrypt/Manifest
index ebf21a881b4d..b32b0bd85345 100644
--- a/dev-libs/libgcrypt/Manifest
+++ b/dev-libs/libgcrypt/Manifest
@@ -1,4 +1,6 @@
 DIST libgcrypt-1.10.1.tar.bz2 3778457 BLAKE2B 46f30459891183b6d9ec18f1c7907fee0ad156c7dd75044f3db2b4d1c19dc6f30b2dfa6f85bc82adc9243aaba913e40fb6faf77d2226ca5a33897220d032437a SHA512 e5ca7966624fff16c3013795836a2c4377f0193dbb4ac5ad2b79654b1fa8992e17d83816569a402212dc8367a7980d4141f5d6ac282bae6b9f02186365b61f13
 DIST libgcrypt-1.10.1.tar.bz2.sig 119 BLAKE2B 5261d7dbfd5d82b2d3fa2ebf864a9ef0c7c978dd66a71c078df7bbb3b63f5d85180e5f909f43a49712fc16c45f7aabaa6bc30ed82a39ffc9a5d483ea6a94d162 SHA512 b156ae05079776698bc95ba5a9e48e95de8f716aa1760ef4b2e7cb8518ccec660337fc7823f865bde870461800d472fd8e458d03a7095b6bb614f6dd96f796d8
+DIST libgcrypt-1.10.2.tar.bz2 3795164 BLAKE2B c86b29648664aae3fb694b20ad258828d2cecbb09db2b83df00fbdebd5d74228c92015c50f659c250cb0768ccaef7949294d9b7cdcd47e1387b7dce81d35da19 SHA512 3a850baddfe8ffe8b3e96dc54af3fbb9e1dab204db1f06b9b90b8fbbfb7fb7276260cd1e61ba4dde5a662a2385385007478834e62e95f785d2e3d32652adb29e
+DIST libgcrypt-1.10.2.tar.bz2.sig 119 BLAKE2B 3753134a1ed1fd2bfd2c64f175c3745db02791359646b3f0229c80ce4ccedbb147ee889a6b8c4fe4bf7e9067d804ee18a8411cd347026cd1656ad1d4d5686bec SHA512 9350444a0bcfa49217815a831f2286ccea470311673257bd809eb5dedbe97d2a5543b0bc7fb752312df69adeb7ac5f064e433f2545a8bf3e494027986cd8020c
 DIST libgcrypt-1.9.4.tar.bz2 3239704 BLAKE2B b8244bc12a68955797b0c2b474ac5c95df1014231f7180a2ffa113e3aacedc98eed60ee1e4b30b032a5fcd6a04855ae07142c223906d5db9c28328a71e014f33 SHA512 d0e117ac73c94d70e9521ee1e6328691498cc8328f8c4e21338096908f5c04c7b838966eb63d59494565f4e19f506c07dab4f4d922150d75610d9f7b57abbf60
 DIST libgcrypt-1.9.4.tar.bz2.sig 119 BLAKE2B 4012c22259a9fd56f9da6c87d60077cea0dbfef85d4d4ad1ff6a2375ddefafc4cd03ee9083d18e080c14c95887b495062af886732a9593bcf1b8f187d21073fe SHA512 4aee16449b4b50dac62bd80217e769f32f43fb7cd994402b7d9cffbb1934b2771041c8c0c41a63ced9c8d9408025f9c5608ffc7f00e5e9a9b92a07cb5118a98a

diff --git a/dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild b/dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild
new file mode 100644
index 000000000000..3bc1ef525b06
--- /dev/null
+++ b/dev-libs/libgcrypt/libgcrypt-1.10.2.ebuild
@@ -0,0 +1,170 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/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 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 +getentropy static-libs"
+
+# 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.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 )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-multilib-syspath.patch
+	"${FILESDIR}"/${PN}-powerpc-darwin.patch
+	"${FILESDIR}"/${PN}-1.9.4-no-fgrep-libgcrypt-config.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
+}
+
+multilib_src_configure() {
+	if [[ ${CHOST} == *86*-solaris* ]] ; then
+		# ASM code uses GNU ELF syntax, divide in particular, we need to
+		# allow this via ASFLAGS, since we don't have a flag-o-matic
+		# function for that, we'll have to abuse cflags for this
+		append-cflags -Wa,--divide
+	fi
+
+	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
+
+	# Workaround for GCC < 11.3 bug
+	# https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commitdiff;h=0b399721ce9709ae25f9d2050360c5ab2115ae29
+	# https://dev.gnupg.org/T5581
+	# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102124
+	if use arm64 && tc-is-gcc && (($(gcc-major-version) == 11)) &&
+		(($(gcc-minor-version) <= 2)) && (($(gcc-micro-version) == 0)) ; then
+		append-flags -fno-tree-loop-vectorize
+	fi
+
+	# ideally we want !tc-ld-is-bfd for best future-proofing, but it needs
+	# https://github.com/gentoo/gentoo/pull/28355
+	# mold needs this too but right now tc-ld-is-mold is also not available
+	if tc-ld-is-lld; then
+		append-ldflags -Wl,--undefined-version
+	fi
+
+	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_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_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
+
+		# http://trac.videolan.org/vlc/ticket/620
+		$([[ ${CHOST} == *86*-darwin* ]] && echo "--disable-asm")
+		# causes bus-errors on sparc64-solaris
+		$([[ ${CHOST} == sparcv9-*-solaris* ]] && echo "--disable-asm")
+
+		$(use asm || echo "--disable-asm")
+
+		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')
+}
+
+multilib_src_compile() {
+	default
+	multilib_is_native_abi && use doc && VARTEXFONTS="${T}/fonts" emake -C doc gcrypt.pdf
+}
+
+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
+}