summaryrefslogtreecommitdiff
path: root/dev-libs/libtomcrypt
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
committerV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
commit752d6256e5204b958b0ef7905675a940b5e9172f (patch)
tree330d16e6362a49cbed8875a777fe641a43376cd3 /dev-libs/libtomcrypt
parent0c100b7dd2b30e75b799d806df4ef899fd98e1ea (diff)
gentoo resync : 12.05.2022
Diffstat (limited to 'dev-libs/libtomcrypt')
-rw-r--r--dev-libs/libtomcrypt/Manifest1
-rw-r--r--dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild114
2 files changed, 115 insertions, 0 deletions
diff --git a/dev-libs/libtomcrypt/Manifest b/dev-libs/libtomcrypt/Manifest
index c73a0a9bd545..b70565c43da2 100644
--- a/dev-libs/libtomcrypt/Manifest
+++ b/dev-libs/libtomcrypt/Manifest
@@ -1,4 +1,5 @@
AUX libtomcrypt-1.18.2-slibtool.patch 4038 BLAKE2B 5fe1dadfc6afbc8f85f104299ff7b45706df3df5698f3375c83f4f573ea662a61158602e03b4c89da57969896181865f1f6b29ae6695ad71a3ab19adf4c559d8 SHA512 9486ae1abfe429d1dbe54185bb8b1fb1dc0550ae1089a000baf7afa4b6aa5011a4f1ad1b404b87a90fdae078125fcfd809298a46962a3cbba44d233231a834f7
DIST libtomcrypt-1.18.2.tar.xz 2638064 BLAKE2B fad67e9e2a2002425488db9987a853bda631d6638c2cb1052a1d0d1f393945e38037cc75c54cd3a4bf87bb2e13b1e868e81da054a84bbdb393519ddef5e27300 SHA512 f6117a12a42b07f8de4a8aedbccf6ff4ee94b4b81cb7263af99627c32eae646ca8ead7d3063737918db4aa118673001fcf2cfa8e4ca8b528fb00045fda7cc893
EBUILD libtomcrypt-1.18.2-r3.ebuild 3201 BLAKE2B b83c6bfb36a8bf22d704dc6f474283c49a29d59234df4c2c62ba16a8752cef6fc03199941600f6576e72f8e5c55846cbe048a05790acf35e2ff65c41000c38ee SHA512 63a526071754eab16b3609457018a389712e80d6e13ef0c5d8a1fbdeddc32f8110b7ca4ac6b966b60801112987669cd7f972f07d8a3274ef0e662229a5ed03dd
+EBUILD libtomcrypt-1.18.2-r4.ebuild 3207 BLAKE2B e7c12724683f6105afbf625bcc9592f0d31904f041b616f99a9764b1b33cc7404b0503ae8be4876d0aa6160a8c8b3587b2cedcaa3ef0d355e1856f9441dc4274 SHA512 cf7bc60b405f31a3dc09de2706b70c56bf3ff34b425f9cdedf9d3dacc4fda96c73ed247f7ed12fc6d07e7ed91b95857af5bc12bedf836d4b1788fb07e26b4b62
MISC metadata.xml 644 BLAKE2B 112aa0ed4b144bc52466f2e247814612bca0ddae22539aa4262826f5bba0c7daac8810939fff61cb3330bc6f921a606a81dae06db9200d22d722a3b6586c17e5 SHA512 2e2fcc358f5f2d0f3ae6566e1af4a5eb4dc40b8eede752bc408d0d77177c6d0540ef5c7b4ed6ca0ebd9822b3260fca3e367b59c1c52d8e7133cd0f92e2b1c957
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..11fd6e17f57b
--- /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
+}