public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/tomsfastmath/, dev-libs/tomsfastmath/files/
@ 2020-05-26  0:01 Michael Orlitzky
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Orlitzky @ 2020-05-26  0:01 UTC (permalink / raw
  To: gentoo-commits

commit:     f0b24a07e3b298277be4362cf56b33d591610c1f
Author:     Sam James (sam_c) <sam <AT> cmpct <DOT> info>
AuthorDate: Sun May 24 05:03:33 2020 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon May 25 23:08:31 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f0b24a07

dev-libs/tomsfastmath: New package

"TomsFastMath is a fast public domain, open source, large integer
arithmetic library written in portable ISO C."

app-antivirus/clamav currently bundles this, and
the new dev-libs/libtomcrypto can optionally make
use of it.

Introduce it as a new package to keep track of security
issues.

Bug: https://bugs.gentoo.org/649394
Closes: https://bugs.gentoo.org/723856
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Sam James (sam_c) <sam <AT> cmpct.info>
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-libs/tomsfastmath/Manifest                     |  1 +
 .../files/tomsfastmath-0.13.1-makefile-fix.patch   | 45 +++++++++++++++
 dev-libs/tomsfastmath/metadata.xml                 | 12 ++++
 dev-libs/tomsfastmath/tomsfastmath-0.13.1.ebuild   | 66 ++++++++++++++++++++++
 4 files changed, 124 insertions(+)

diff --git a/dev-libs/tomsfastmath/Manifest b/dev-libs/tomsfastmath/Manifest
new file mode 100644
index 00000000000..245166bd36a
--- /dev/null
+++ b/dev-libs/tomsfastmath/Manifest
@@ -0,0 +1 @@
+DIST tfm-0.13.1.tar.xz 322684 BLAKE2B 393c0e0e018b199c9fc975ab3013466399ea337f520f4634649a9e61b2218b9a6b218d11212b535fc8bbd2bf40d8722fc413dc60756f1b8ff7c78da049765083 SHA512 84225fe81bbcd1df7e40ed0b8c8077d60612246a76f3149b672dfd1066eb0179262fa4f5a42ffd2034e60cb74cfd86e0b49139371971ebbb4f41a4ecebca2111

diff --git a/dev-libs/tomsfastmath/files/tomsfastmath-0.13.1-makefile-fix.patch b/dev-libs/tomsfastmath/files/tomsfastmath-0.13.1-makefile-fix.patch
new file mode 100644
index 00000000000..7239178e5dd
--- /dev/null
+++ b/dev-libs/tomsfastmath/files/tomsfastmath-0.13.1-makefile-fix.patch
@@ -0,0 +1,45 @@
+diff --git a/makefile.shared b/makefile.shared
+index 47c35d9..cebaa04 100644
+--- a/makefile.shared
++++ b/makefile.shared
+@@ -1,7 +1,8 @@
+ #makefile for TomsFastMath
+ #
+ #
+-VERSION=1:0:0
++VERSION=0.13.1
++VERSION_LIB=1:0:0
+ 
+ LT  ?= libtool
+ LTCOMPILE = $(LT) --mode=compile --tag=CC $(CC)
+@@ -89,13 +90,16 @@ $(OBJECTS): $(HEADERS)
+ 	$(LTCOMPILE) $(CFLAGS) $(LDFLAGS) -o $@ -c $<
+ 
+ $(LIBNAME): $(OBJECTS)
+-	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) `find . -type f | LC_ALL=C sort | grep "[.]lo" | xargs` -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION) -export-symbols libtfm.symbols
++	libtool --mode=link --tag=CC $(CC) $(CFLAGS) $(LDFLAGS) `find . -type f | LC_ALL=C sort | grep "[.]lo" | xargs` -o $(LIBNAME) -rpath $(LIBPATH) -version-info $(VERSION_LIB) -export-symbols libtfm.symbols
+ 
+ install: $(LIBNAME)
+ 	install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(LIBPATH)
+ 	libtool --mode=install install -c $(LIBNAME) $(DESTDIR)$(LIBPATH)/$(LIBNAME)
+ 	install -d -g $(GROUP) -o $(USER) $(DESTDIR)$(INCPATH)
+ 	install -g $(GROUP) -o $(USER) $(HEADERS_PUB) $(DESTDIR)$(INCPATH)
++	sed -e 's,^Version:.*,Version: $(VERSION),' tomsfastmath.pc.in > tomsfastmath.pc
++	install -d $(DESTDIR)$(LIBPATH)/pkgconfig
++	install -m 644 tomsfastmath.pc $(DESTDIR)$(LIBPATH)/pkgconfig/
+ 
+ HEADER_FILES=$(notdir $(HEADERS_PUB))
+ uninstall:
+diff --git a/tomsfastmath.pc.in b/tomsfastmath.pc.in
+new file mode 100644
+index 0000000..a0275ab
+--- /dev/null
++++ b/tomsfastmath.pc.in
+@@ -0,0 +1,7 @@
++# TomsFastMath, a fast ISO C bignum library. -- Tom St Denis
++# SPDX-License-Identifier: Unlicense
++
++Name: TomFastMath
++Description: Fast multiple-precision integer library
++Version: @VERSION@
++Libs: -ltfm

diff --git a/dev-libs/tomsfastmath/metadata.xml b/dev-libs/tomsfastmath/metadata.xml
new file mode 100644
index 00000000000..6e3769c9110
--- /dev/null
+++ b/dev-libs/tomsfastmath/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>sam@cmpct.info</email>
+    <name>Sam James</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+</pkgmetadata>

diff --git a/dev-libs/tomsfastmath/tomsfastmath-0.13.1.ebuild b/dev-libs/tomsfastmath/tomsfastmath-0.13.1.ebuild
new file mode 100644
index 00000000000..3b61e419f34
--- /dev/null
+++ b/dev-libs/tomsfastmath/tomsfastmath-0.13.1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="TomsFastMath is a fast public domain large integer arithmetic library"
+HOMEPAGE="https://www.libtom.net/TomsFastMath/ https://github.com/libtom/tomsfastmath"
+SRC_URI="https://github.com/libtom/tomsfastmath/releases/download/v${PV}/tfm-${PV}.tar.xz"
+LICENSE="Unlicense"
+
+# Current SONAME is 1
+# Please bump when the ABI changes upstream
+# Helpful site:
+# https://abi-laboratory.pro/index.php?view=timeline&l=tomsfastmath
+SLOT="0/1"
+
+KEYWORDS="~amd64"
+
+PATCHES=(
+	"${FILESDIR}/${P}-makefile-fix.patch"
+)
+
+_emake() {
+	# Standard boilerplate
+	# Upstream use homebrewed makefiles
+	# Best to use same args for all, for consistency,
+	# in case behaviour changes (v possible).
+	emake \
+		CC="$(tc-getCC)" \
+		AR="$(tc-getAR)" \
+		RANLIB="$(tc-getRANLIB)" \
+		DESTDIR="${ED}" \
+		LIBPATH="/usr/$(get_libdir)" \
+		IGNORE_SPEED=1 \
+		"$@"
+}
+
+src_compile() {
+	_emake -f makefile.shared
+}
+
+src_test() {
+	_emake test_standalone stest rsatest
+
+	# We choose to be verbose during the test process
+	# because the output is quite repetitive with no
+	# clear demarcation b/t tests
+	tests=( "test" "stest" "rsatest" )
+
+	for test in "${tests[@]}"; do
+		einfo "Running test (${test})"
+		./${test} || die "Test (${test}) failed"
+		einfo "Completed test (${test})"
+	done
+}
+
+src_install() {
+	_emake -f makefile.shared install
+
+	# Remove unnecessary .la files
+	find "${ED}" -name '*.la' -delete || die
+	# Same for static libs
+	find "${ED}" -name "*.a" -delete || die
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/tomsfastmath/, dev-libs/tomsfastmath/files/
@ 2020-12-20 11:36 Michał Górny
  0 siblings, 0 replies; 2+ messages in thread
From: Michał Górny @ 2020-12-20 11:36 UTC (permalink / raw
  To: gentoo-commits

commit:     fb94282713e3a94fb240088227bf0f3b982a438b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 20 05:45:27 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Dec 20 11:35:45 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb942827

dev-libs/tomsfastmath: compatibility patch for (incoming) libtomcrypt

In a yet unreleased version of tomsfastmath, this patch
was added to export a needed symbol which libtomcrypt
makes use of.

Include it so that libtomcrypt can be built against
tomsfastmath if desired.

Signed-off-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../tomsfastmath-0.13.1-export-fp_isprime_ex.patch | 13 ++++
 .../tomsfastmath/tomsfastmath-0.13.1-r1.ebuild     | 69 ++++++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/dev-libs/tomsfastmath/files/tomsfastmath-0.13.1-export-fp_isprime_ex.patch b/dev-libs/tomsfastmath/files/tomsfastmath-0.13.1-export-fp_isprime_ex.patch
new file mode 100644
index 00000000000..627bf4b2f4d
--- /dev/null
+++ b/dev-libs/tomsfastmath/files/tomsfastmath-0.13.1-export-fp_isprime_ex.patch
@@ -0,0 +1,13 @@
+Needed because libtomcrypt expects this symbol to be available
+https://github.com/libtom/tomsfastmath/commit/81530c207da8b3a43867da14df7d79d2cdf96978.patch
+--- a/libtfm.symbols
++++ b/libtfm.symbols
+@@ -16,6 +16,7 @@ fp_gcd
+ fp_ident
+ fp_invmod
+ fp_isprime
++fp_isprime_ex
+ fp_lcm
+ fp_lshd
+ fp_mod
+

diff --git a/dev-libs/tomsfastmath/tomsfastmath-0.13.1-r1.ebuild b/dev-libs/tomsfastmath/tomsfastmath-0.13.1-r1.ebuild
new file mode 100644
index 00000000000..738e6706e8c
--- /dev/null
+++ b/dev-libs/tomsfastmath/tomsfastmath-0.13.1-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+DESCRIPTION="Fast public domain large integer arithmetic library"
+HOMEPAGE="https://www.libtom.net/TomsFastMath/
+	https://github.com/libtom/tomsfastmath"
+SRC_URI="https://github.com/libtom/tomsfastmath/releases/download/v${PV}/tfm-${PV}.tar.xz"
+LICENSE="Unlicense"
+
+# Current SONAME is 1
+# Please bump when the ABI changes upstream
+# Helpful site:
+# https://abi-laboratory.pro/index.php?view=timeline&l=tomsfastmath
+SLOT="0/1"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+
+PATCHES=(
+	"${FILESDIR}/${P}-makefile-fix.patch"
+	"${FILESDIR}/${PN}-0.13.1-export-fp_isprime_ex.patch"
+)
+
+_emake() {
+	# Standard boilerplate
+	# Upstream use homebrewed makefiles
+	# Best to use same args for all, for consistency,
+	# in case behaviour changes (v possible).
+	emake \
+		CC="$(tc-getCC)" \
+		AR="$(tc-getAR)" \
+		RANLIB="$(tc-getRANLIB)" \
+		DESTDIR="${ED}" \
+		LIBPATH="/usr/$(get_libdir)" \
+		IGNORE_SPEED=1 \
+		"$@"
+}
+
+src_compile() {
+	_emake -f makefile.shared
+}
+
+src_test() {
+	_emake test_standalone stest rsatest
+
+	# We choose to be verbose during the test process
+	# because the output is quite repetitive with no
+	# clear demarcation b/t tests
+	local tests=( "test" "stest" "rsatest" )
+
+	local test
+	for test in "${tests[@]}"; do
+		einfo "Running test (${test})"
+		./${test} || die "Test (${test}) failed"
+		einfo "Completed test (${test})"
+	done
+}
+
+src_install() {
+	_emake -f makefile.shared install
+
+	# Remove unnecessary .la files
+	find "${ED}" -name '*.la' -delete || die
+	# Same for static libs
+	find "${ED}" -name "*.a" -delete || die
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-20 11:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-26  0:01 [gentoo-commits] repo/gentoo:master commit in: dev-libs/tomsfastmath/, dev-libs/tomsfastmath/files/ Michael Orlitzky
  -- strict thread matches above, loose matches on Subject: below --
2020-12-20 11:36 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox