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 5B8F613835A for ; Sun, 20 Dec 2020 11:36:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A7ABAE0885; Sun, 20 Dec 2020 11:36:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 303BDE0885 for ; Sun, 20 Dec 2020 11:36:17 +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 01EE6340C19 for ; Sun, 20 Dec 2020 11:36:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 81C00D0 for ; Sun, 20 Dec 2020 11:36:13 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1608464146.d7dd158a3b2e1668ee547fcb0695d0039ac194bc.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libtomcrypt/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-libs/libtomcrypt/Manifest dev-libs/libtomcrypt/libtomcrypt-1.18.2.ebuild dev-libs/libtomcrypt/metadata.xml X-VCS-Directories: dev-libs/libtomcrypt/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: d7dd158a3b2e1668ee547fcb0695d0039ac194bc X-VCS-Branch: master Date: Sun, 20 Dec 2020 11:36:13 +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: 07a9b10e-dae9-4af1-a03b-9a28bb148545 X-Archives-Hash: c2410acd388ac3d2660a82e7a5f03e89 commit: d7dd158a3b2e1668ee547fcb0695d0039ac194bc Author: Sam James gentoo org> AuthorDate: Sun Dec 20 05:44:47 2020 +0000 Commit: Michał Górny gentoo org> CommitDate: Sun Dec 20 11:35:46 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d7dd158a dev-libs/libtomcrypt: new package "LibTomCrypt is a fairly comprehensive, modular and portable cryptographic toolkit" A number of packages bundle libtomcrypt at the moment. Finally add the package, so we can start unbundling. Original ebuild by Sam James with a few style updates by me. Closes: https://bugs.gentoo.org/723844 Signed-off-by: Sam James gentoo.org> Closes: https://github.com/gentoo/gentoo/pull/18734 Signed-off-by: Michał Górny gentoo.org> dev-libs/libtomcrypt/Manifest | 1 + dev-libs/libtomcrypt/libtomcrypt-1.18.2.ebuild | 102 +++++++++++++++++++++++++ dev-libs/libtomcrypt/metadata.xml | 19 +++++ 3 files changed, 122 insertions(+) diff --git a/dev-libs/libtomcrypt/Manifest b/dev-libs/libtomcrypt/Manifest new file mode 100644 index 00000000000..71ae48ee0d7 --- /dev/null +++ b/dev-libs/libtomcrypt/Manifest @@ -0,0 +1 @@ +DIST libtomcrypt-1.18.2.tar.xz 2638064 BLAKE2B fad67e9e2a2002425488db9987a853bda631d6638c2cb1052a1d0d1f393945e38037cc75c54cd3a4bf87bb2e13b1e868e81da054a84bbdb393519ddef5e27300 SHA512 f6117a12a42b07f8de4a8aedbccf6ff4ee94b4b81cb7263af99627c32eae646ca8ead7d3063737918db4aa118673001fcf2cfa8e4ca8b528fb00045fda7cc893 diff --git a/dev-libs/libtomcrypt/libtomcrypt-1.18.2.ebuild b/dev-libs/libtomcrypt/libtomcrypt-1.18.2.ebuild new file mode 100644 index 00000000000..9b87379612a --- /dev/null +++ b/dev-libs/libtomcrypt/libtomcrypt-1.18.2.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2020 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="~amd64 ~x86" +IUSE="+gmp +libtommath tomsfastmath" + +BDEPEND="virtual/pkgconfig" +DEPEND=" + gmp? ( dev-libs/gmp:= ) + libtommath? ( dev-libs/libtommath:= ) + tomsfastmath? ( dev-libs/tomsfastmath:= ) +" + +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) + use gmp && enabled_features+=( -DGMP_DESC=1 ) + use libtommath && enabled_features+=( -DLTM_DESC=1 ) + use tomsfastmath && enabled_features+=( -DTFM_DESC=1 ) + + # 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 ) + extra_libs=( -lgmp ) + elif use libtommath ; then + enabled_features+=( -DUSE_LTM=1 ) + extra_libs=( -ltommath ) + elif use tomsfastmath ; then + enabled_features+=( -DUSE_TFM=1 ) + extra_libs=( -ltfm ) + fi + + # If none of the above are being used, + # the tests don't need to link against any extra + # libraries. + + # We only need to do this strange logic for tests + # anyway because we're choosing what to build a binary with. + if [[ ${TEST} != 1 ]] ; then + extra_libs=() + 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="${ESYSROOT}/usr/$(get_libdir)" \ + INCPATH="${ESYSROOT}/usr/include" \ + IGNORE_SPEED=1 \ + "${@}" +} + +src_compile() { + 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. + TEST=1 mymake test + ./test || die "Running tests failed" +} + +src_install() { + mymake -f makefile.shared \ + DATAPATH="${EPREFIX}/usr/share/doc/${PF}" \ + DESTDIR="${ED}" \ + install install_docs + + find "${ED}" '(' -name '*.la' -o -name '*.a' ')' -delete || die +} diff --git a/dev-libs/libtomcrypt/metadata.xml b/dev-libs/libtomcrypt/metadata.xml new file mode 100644 index 00000000000..9dda15fd9cf --- /dev/null +++ b/dev-libs/libtomcrypt/metadata.xml @@ -0,0 +1,19 @@ + + + + + sam@gentoo.org + Sam James + + + mgorny@gentoo.org + Michał Górny + + + Uses dev-libs/libtommath for mathematical operations + Uses dev-libs/tomsfastmath for mathematical operations + + + libtom/libtomcrypt + +