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.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 5FDF1158090 for ; Wed, 11 May 2022 01:20:22 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A1315E096C; Wed, 11 May 2022 01:20:21 +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 9AD28E096C for ; Wed, 11 May 2022 01:20:20 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 BF91D3415E1 for ; Wed, 11 May 2022 01:20:19 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3B3A82F9 for ; Wed, 11 May 2022 01:20:18 +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: <1652231995.19f1abf39264849e318e821adf4c825acc7421f0.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libtomcrypt/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild X-VCS-Directories: dev-libs/libtomcrypt/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 19f1abf39264849e318e821adf4c825acc7421f0 X-VCS-Branch: master Date: Wed, 11 May 2022 01:20:18 +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: 6451abed-7f48-489d-abac-fc3dceea1c6c X-Archives-Hash: 4a5e174298fa6934b6eb710ddd875a05 commit: 19f1abf39264849e318e821adf4c825acc7421f0 Author: Sam James gentoo org> AuthorDate: Wed May 11 01:19:55 2022 +0000 Commit: Sam James gentoo org> CommitDate: Wed May 11 01:19:55 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19f1abf3 dev-libs/libtomcrypt: fix EPREFIX usage Closes: https://bugs.gentoo.org/843632 Thanks-to: François-Xavier Carton gmail.com> Signed-off-by: Sam James gentoo.org> dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild | 114 ++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild b/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild new file mode 100644 index 000000000000..8fa4c04203ff --- /dev/null +++ b/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild @@ -0,0 +1,114 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit toolchain-funcs + +DESCRIPTION="LibTomCrypt is a comprehensive, modular and portable cryptographic toolkit" +HOMEPAGE="https://www.libtom.net/LibTomCrypt/ https://github.com/libtom/libtomcrypt" +SRC_URI=" + https://github.com/libtom/${PN}/releases/download/v${PV}/crypt-${PV}.tar.xz + -> ${P}.tar.xz" + +LICENSE="|| ( WTFPL-2 public-domain )" +# Current SONAME is 1 +# Please bump when the ABI changes upstream +# Helpful site: +# https://abi-laboratory.pro/index.php?view=timeline&l=libtomcrypt +SLOT="0/1" +KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~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="+gmp +libtommath tomsfastmath" + +# Enforce at least one math provider +# bug #772935 +REQUIRED_USE="|| ( gmp libtommath tomsfastmath )" + +BDEPEND=" + sys-devel/libtool + virtual/pkgconfig +" +DEPEND=" + gmp? ( dev-libs/gmp:= ) + libtommath? ( dev-libs/libtommath:= ) + tomsfastmath? ( dev-libs/tomsfastmath:= ) +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-slibtool.patch +) + +mymake() { + # Standard boilerplate + # Upstream use homebrewed makefiles + # Best to use same args for all, for consistency, + # in case behaviour changes (v possible). + local enabled_features=() + local extra_libs=() + + # Build support as appropriate for consumers (MPI) + if use gmp; then + enabled_features+=( -DGMP_DESC=1 ) + extra_libs+=( -lgmp ) + fi + if use libtommath; then + enabled_features+=( -DLTM_DESC=1 ) + extra_libs+=( -ltommath ) + fi + if use tomsfastmath; then + enabled_features+=( -DTFM_DESC=1 ) + extra_libs+=( -ltfm ) + fi + + # For the test and example binaries, we have to choose + # which MPI we want to use. + # For now (see src_test), arbitrarily choose: + # gmp > libtommath > tomsfastmath > none + if use gmp ; then + enabled_features+=( -DUSE_GMP=1 ) + elif use libtommath ; then + enabled_features+=( -DUSE_LTM=1 ) + elif use tomsfastmath ; then + enabled_features+=( -DUSE_TFM=1 ) + fi + + # IGNORE_SPEED=1 is needed to respect CFLAGS + EXTRALIBS="${extra_libs[*]}" emake \ + CFLAGS="${CFLAGS} ${enabled_features[*]}" \ + CC="$(tc-getCC)" \ + AR="$(tc-getAR)" \ + RANLIB="$(tc-getRANLIB)" \ + LIBPATH="${EPREFIX}/usr/$(get_libdir)" \ + INCPATH="${EPREFIX}/usr/include" \ + IGNORE_SPEED=1 \ + PREFIX="${EPREFIX}/usr" \ + "${@}" +} + +src_compile() { + # Replace hard-coded libdir=${exec_prefix}/lib. + sed -i -e "/libdir=/s:/lib:/$(get_libdir):" libtomcrypt.pc.in || die + + mymake -f makefile.shared library +} + +src_test() { + # libtomcrypt can build with several MPI providers + # but the tests can only be built with one at a time. + # When the next release (> 1.18.2) containing + # 1) https://github.com/libtom/libtomcrypt/commit/a65cfb8dbe4 + # 2) https://github.com/libtom/libtomcrypt/commit/fdc6cd20137 + # is made, we can run tests for each provider. + mymake test + ./test || die "Running tests failed" +} + +src_install() { + mymake -f makefile.shared \ + DATAPATH="${EPREFIX}/usr/share/doc/${PF}" \ + DESTDIR="${D}" \ + install install_docs + + find "${ED}" '(' -name '*.la' -o -name '*.a' ')' -delete || die +}