summaryrefslogtreecommitdiff
path: root/dev-libs/libtomcrypt
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-12-25 23:06:25 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-12-25 23:06:25 +0000
commit441d1370330332b7d78f238d2f5e13f7aed5e4e0 (patch)
tree6a5171dd615dfeee62a45044144c66e864738fb0 /dev-libs/libtomcrypt
parentab3da91fb6c91a9df52fff8f991570f456fd3c7a (diff)
gentoo christmass resync : 25.12.2020
Diffstat (limited to 'dev-libs/libtomcrypt')
-rw-r--r--dev-libs/libtomcrypt/Manifest3
-rw-r--r--dev-libs/libtomcrypt/libtomcrypt-1.18.2-r1.ebuild98
-rw-r--r--dev-libs/libtomcrypt/metadata.xml19
3 files changed, 120 insertions, 0 deletions
diff --git a/dev-libs/libtomcrypt/Manifest b/dev-libs/libtomcrypt/Manifest
new file mode 100644
index 000000000000..eb87fc1819b1
--- /dev/null
+++ b/dev-libs/libtomcrypt/Manifest
@@ -0,0 +1,3 @@
+DIST libtomcrypt-1.18.2.tar.xz 2638064 BLAKE2B fad67e9e2a2002425488db9987a853bda631d6638c2cb1052a1d0d1f393945e38037cc75c54cd3a4bf87bb2e13b1e868e81da054a84bbdb393519ddef5e27300 SHA512 f6117a12a42b07f8de4a8aedbccf6ff4ee94b4b81cb7263af99627c32eae646ca8ead7d3063737918db4aa118673001fcf2cfa8e4ca8b528fb00045fda7cc893
+EBUILD libtomcrypt-1.18.2-r1.ebuild 2741 BLAKE2B 1343c630ce181faf31de0cc0f43184931133867f4a0c6799197e1c5f53dba94951f79fc4a0235ea35e12bf55cbc3a92aac03b11b4db250ca4ac32c47279a9563 SHA512 ae9a64698ebc42c77220dacf4f58fd06ae12b246f696c9e8c88a06e7d4ab30f1ae38d5e5ee4b11323e99d1df70a0e28bd978c8438b6e34e7a162364d4ff28b71
+MISC metadata.xml 643 BLAKE2B e66df23ddfeb04650dfa8c4cbd7d6e6a1816164fd0cac86dba9990610b672957c5ff7b6e83a17f8b6c19f75d1f50a1b448b8b618058510b8d6f54259ad451822 SHA512 7517fc02844cd6b9a9801b371c2c8faf9626dded317ad610af234cd89078221be021acb9da66f9078bb4b754a5e2f1b5efcbca2ccb1ef5c58afd8cf925e7a44e
diff --git a/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r1.ebuild b/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r1.ebuild
new file mode 100644
index 000000000000..5ce640567cab
--- /dev/null
+++ b/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r1.ebuild
@@ -0,0 +1,98 @@
+# 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="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~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)
+ 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="${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.
+ 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 000000000000..9dda15fd9cfb
--- /dev/null
+++ b/dev-libs/libtomcrypt/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="libtommath">Uses <pkg>dev-libs/libtommath</pkg> for mathematical operations</flag>
+ <flag name="tomsfastmath">Uses <pkg>dev-libs/tomsfastmath</pkg> for mathematical operations</flag>
+ </use>
+ <upstream>
+ <remote-id type="github">libtom/libtomcrypt</remote-id>
+ </upstream>
+</pkgmetadata>