From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8DA3813835A for ; Fri, 16 Apr 2021 02:30:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86542E075F; Fri, 16 Apr 2021 02:30:06 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 56691E075F for ; Fri, 16 Apr 2021 02:30:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A043C340A35 for ; Fri, 16 Apr 2021 02:30:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E89DB66A for ; Fri, 16 Apr 2021 02:30:02 +0000 (UTC) From: "Sam James" 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" Message-ID: <1618540018.d8467da93d612f11b7daaa2644a0c52bf581c979.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/botan/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/botan/botan-2.18.0.ebuild X-VCS-Directories: dev-libs/botan/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: d8467da93d612f11b7daaa2644a0c52bf581c979 X-VCS-Branch: master Date: Fri, 16 Apr 2021 02:30:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d1c32c42-49f7-4cc6-9454-ee6154d9f256 X-Archives-Hash: f89d61af66f97934f3288856cc7f0010 commit: d8467da93d612f11b7daaa2644a0c52bf581c979 Author: Sam James gentoo org> AuthorDate: Fri Apr 16 01:56:01 2021 +0000 Commit: Sam James gentoo org> CommitDate: Fri Apr 16 02:26:58 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8467da9 dev-libs/botan: rework src_configure (including CPU_FLAGS_*) * Add support for CPU_FLAGS_* rather than automagic detection * Consoldiate arch-specific workarounds * Sort configure arguments * Simplify disable logic * Minor other style changes * Drop USE=libressl Closes: https://bugs.gentoo.org/724338 Signed-off-by: Sam James gentoo.org> dev-libs/botan/botan-2.18.0.ebuild | 105 ++++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 37 deletions(-) diff --git a/dev-libs/botan/botan-2.18.0.ebuild b/dev-libs/botan/botan-2.18.0.ebuild index 0fd5992235c..ab5000d8a85 100644 --- a/dev-libs/botan/botan-2.18.0.ebuild +++ b/dev-libs/botan/botan-2.18.0.ebuild @@ -4,11 +4,9 @@ EAPI=7 PYTHON_COMPAT=( python3_{7,8,9} ) - inherit python-r1 toolchain-funcs MY_P="Botan-${PV}" - DESCRIPTION="C++ crypto library" HOMEPAGE="https://botan.randombit.net/" SRC_URI="https://botan.randombit.net/releases/${MY_P}.tar.xz" @@ -17,15 +15,17 @@ S="${WORKDIR}/${MY_P}" LICENSE="BSD-2" SLOT="2/$(ver_cut 1-2)" # soname version KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~ppc-macos" -IUSE="bindist doc boost bzip2 libressl lzma python ssl static-libs sqlite zlib" -REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" +IUSE="bindist doc boost bzip2 lzma python ssl static-libs sqlite zlib" -BDEPEND=" - ${PYTHON_DEPS} - $(python_gen_any_dep ' - doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) - ') -" +CPU_USE=( + cpu_flags_arm_{aes,neon} + cpu_flags_ppc_altivec + cpu_flags_x86_{aes,avx2,popcnt,rdrand,sse2,ssse3,sse4_1,sse4_2} +) + +IUSE+=" ${CPU_USE[@]}" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" # NOTE: Boost is needed at runtime too for the CLI tool. DEPEND=" @@ -33,15 +33,17 @@ DEPEND=" bzip2? ( >=app-arch/bzip2-1.0.5:= ) lzma? ( app-arch/xz-utils:= ) python? ( ${PYTHON_DEPS} ) - ssl? ( - !libressl? ( dev-libs/openssl:0=[bindist=] ) - libressl? ( dev-libs/libressl:0= ) - ) + ssl? ( dev-libs/openssl:0=[bindist=] ) sqlite? ( dev-db/sqlite:3= ) zlib? ( >=sys-libs/zlib-1.2.3:= ) " - RDEPEND="${DEPEND}" +BDEPEND=" + ${PYTHON_DEPS} + $(python_gen_any_dep ' + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) + ') +" # NOTE: Considering patching Botan? # Please see upstream's guidance: @@ -54,25 +56,35 @@ python_check_deps() { } src_configure() { - local disable_modules=() - use boost || disable_modules+=( "boost" ) - use bindist && disable_modules+=( "ecdsa" ) - elog "Disabling module(s): ${disable_modules[@]}" + local disable_modules=( + $(usex boost '' 'boost') + $(usex bindist 'ecdsa' '') + ) - # Enable v9 instructions for sparc64 - local chostarch="${CHOST%%-*}" - if [[ "${PROFILE_ARCH}" = "sparc64" ]] ; then - chostarch="sparc32-v9" + if [[ -z "${DISABLE_MODULES}" ]] ; then + elog "Disabling module(s): ${disable_modules[@]}" fi + local chostarch="${CHOST%%-*}" + + # Arch specific wrangling + local myos= case ${CHOST} in - *-darwin*) myos=darwin ;; - *) myos=linux ;; - esac + *-darwin*) + myos=darwin + ;; + + *) + myos=linux + + if [[ ${CHOST} == *hppa* ]] ; then + chostarch=parisc + elif [[ ${PROFILE_ARCH} == "sparc64" ]] ; then + chostarch="sparc32-v9" + fi + ;; - case ${CHOST} in - hppa*) chostarch=parisc ;; esac local pythonvers=() @@ -84,31 +96,50 @@ src_configure() { python_foreach_impl _append fi - # Don't install Python bindings automatically - # (do it manually later in the right place) - # https://bugs.gentoo.org/723096 local myargs=( - $(use_enable static-libs static-library) + # Intrinsics + # TODO: x86 RDSEED (new CPU_FLAGS_X86?) + # TODO: POWER Crypto (new CPU_FLAGS_PPC?) + $(usex cpu_flags_arm_aes '' '--disable-armv8crypto') + $(usex cpu_flags_arm_neon '' '--disable-neon') + $(usex cpu_flags_ppc_altivec '' '--disable-altivec') + $(usex cpu_flags_x86_aes '' '--disable-aes-ni') + $(usex cpu_flags_x86_avx2 '' '--disable-avx2') + $(usex cpu_flags_x86_popcnt '' '--disable-bmi2') + $(usex cpu_flags_x86_rdrand '' '--disable-rdrand') + $(usex cpu_flags_x86_sse2 '' '--disable-sse2') + $(usex cpu_flags_x86_ssse3 '' '--disable-ssse3') + $(usex cpu_flags_x86_sse4_1 '' '--disable-sse4.1') + $(usex cpu_flags_x86_sse4_2 '' '--disable-sse4.2') + + $(usex hppa --without-stack-protector '') + $(use_with boost) $(use_with bzip2) $(use_with doc documentation) $(use_with doc sphinx) $(use_with lzma) - $(use_with sqlite sqlite3) + $(use_enable static-libs static-library) $(use_with ssl openssl) + $(use_with sqlite sqlite3) $(use_with zlib) - $(usex hppa --without-stack-protector '') + --cpu=${chostarch} - --disable-modules=$( IFS=","; echo "${disable_modules[*]}" ) --docdir=share/doc + --disable-modules=$( IFS=","; echo "${disable_modules[*]}" ) + --distribution-info="Gentoo ${PVR}" --libdir=$(get_libdir) + + # Don't install Python bindings automatically + # (do it manually later in the right place) + # https://bugs.gentoo.org/723096 + --no-install-python-module + --os=${myos} - --distribution-info="Gentoo ${PVR}" --prefix="${EPREFIX}/usr" --with-endian="$(tc-endian)" --with-python-version=$( IFS=","; echo "${pythonvers[*]}" ) --without-doxygen - --no-install-python-module ) tc-export CC CXX AR