commit:     250a6dba2d307b74f8ad11e16e94e6229b3a93ba
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  7 22:44:15 2025 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Sat Feb  8 02:07:13 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=250a6dba

sci-mathematics/4ti2: add 1.6.10

I'm reluctant to include an invasive build patch in case upstream
rejects it, but I haven't gotten a response on the PR, and this isn't a
fast moving project, so I'm starting to think I should just fix it.

Closes: https://bugs.gentoo.org/810323
Closes: https://bugs.gentoo.org/908485
Closes: https://bugs.gentoo.org/916679
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 sci-mathematics/4ti2/4ti2-1.6.10.ebuild            | 47 +++++++++++++
 sci-mathematics/4ti2/Manifest                      |  2 +
 .../4ti2/files/4ti2-1.6.10-slibtool.patch          | 78 ++++++++++++++++++++++
 3 files changed, 127 insertions(+)

diff --git a/sci-mathematics/4ti2/4ti2-1.6.10.ebuild 
b/sci-mathematics/4ti2/4ti2-1.6.10.ebuild
new file mode 100644
index 000000000000..580a2eadbe87
--- /dev/null
+++ b/sci-mathematics/4ti2/4ti2-1.6.10.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Software package for algebraic, geometric and combinatorial 
problems"
+HOMEPAGE="https://4ti2.github.io";
+SRC_URI="https://github.com/4ti2/4ti2/releases/download/Release_${PV//./_}/${P}.tar.gz
+       https://dev.gentoo.org/~mjo/distfiles/${P}-musl.patch.xz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~riscv ~x86 ~amd64-linux ~x86-linux"
+
+RDEPEND="
+       sci-mathematics/glpk:=[gmp]
+       dev-libs/gmp:0=[cxx(+)]"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${P}-slibtool.patch"
+       "${WORKDIR}/${P}-musl.patch"
+)
+
+src_prepare() {
+       default
+
+       # The swig subdir is not used on Gentoo, and in 1.6.10, they
+       # actually forgot to ship it. Let's make extra sure that e.g.
+       # we don't waste time autoreconfing it.
+       rm -rf swig || die
+       sed -e '/SUBDIRS += swig/d' -i Makefile.am || die
+       eautoreconf
+}
+
+src_configure() {
+       # This is not pointless: configure.ac disables shared libraries and
+       # enables static libraries by default.
+       econf --enable-shared --disable-static
+}
+
+src_install() {
+       default
+       find "${ED}" -name '*.la' -delete || die
+}

diff --git a/sci-mathematics/4ti2/Manifest b/sci-mathematics/4ti2/Manifest
index 7022a453246d..2ec6ff4f0de6 100644
--- a/sci-mathematics/4ti2/Manifest
+++ b/sci-mathematics/4ti2/Manifest
@@ -1 +1,3 @@
+DIST 4ti2-1.6.10-musl.patch.xz 15820 BLAKE2B 
2994a4e0e589e8c8233bf9367206129605538145b3dffd6dc186026d0e45d78e382467dbebd13d5e0ae5d4f96a0a9411811d3ddb390b5a9e68e4251bd37fbb02
 SHA512 
2fd0f470cf5d571875715be3dd67ea05edb222f1ca30f33698f3bfe1c470fa56695b03ccdf27dfaacaa613616cf67bc9165072c710d267be370a718f40a268bd
+DIST 4ti2-1.6.10.tar.gz 5496480 BLAKE2B 
e6d90e0282c1ad63ee887c7f301ce8127791d1f75b5c8a43866b812e7e773495ee2cf33e1e1d23eb3974cdd0632d7efc61ee7b2029902adad5601c3eedacbced
 SHA512 
d591ed272664c7467e9b28082c0a99002b3a4616cf437eecd243ccca2ab0f08abdba5dcd039a109b05793f7aaf9f405af9a58c7eff90b7b01b3b1f34fb7fdb2e
 DIST 4ti2-1.6.7.tar.gz 5649869 BLAKE2B 
ab0e7da1de88e5e99ead0b8fa7f7a72773b84ae903a31dc3134e83364ea45069889f8ce9812bb471cf72b824fe013756d557489b4d2ab31216141d5b6347acfc
 SHA512 
38d638fe01ff3cef1aebae1eefd276cf02f808978851b4465e132f77d3ab34ea51d512e2ea28a42ac65263b458c43cf420dc5f8ac930f959dd0c14916cef9841

diff --git a/sci-mathematics/4ti2/files/4ti2-1.6.10-slibtool.patch 
b/sci-mathematics/4ti2/files/4ti2-1.6.10-slibtool.patch
new file mode 100644
index 000000000000..5765fa75d5fb
--- /dev/null
+++ b/sci-mathematics/4ti2/files/4ti2-1.6.10-slibtool.patch
@@ -0,0 +1,78 @@
+mjo: we had another patch in Gentoo that adds "-lgmp" to 4ti2gmp_LDADD.
+I merged it into this one because otherwise they conflict.
+
+From b87d4c02616d6e5218658a782854e3156ab885aa Mon Sep 17 00:00:00 2001
+From: orbea <[email protected]>
+Date: Thu, 7 Mar 2024 14:10:14 -0800
+Subject: [PATCH] build: link internal dependencies with .la files
+
+When linking with internal dependencies the correct way is to add the
+libtool archives (.la) files to the appropriate LIBADD or LDADD
+variables.
+
+This fixes a build issue when using slibtool instead of GNU libtool.
+
+Gentoo issue: https://bugs.gentoo.org/916679
+---
+ src/groebner/Makefile.am           | 10 +++++-----
+ src/zsolve/Makefile.am             |  3 ++-
+ swig/allegrocommonlisp/Makefile.am |  8 ++++----
+ 3 files changed, 11 insertions(+), 10 deletions(-)
+
+diff --git a/src/groebner/Makefile.am b/src/groebner/Makefile.am
+index 64c2780..183920f 100644
+--- a/src/groebner/Makefile.am
++++ b/src/groebner/Makefile.am
+@@ -268,17 +268,17 @@ WRAPPERSCRIPTS =                         \
+ nodist_bin_SCRIPTS = $(WRAPPERSCRIPTS)
+ DISTCLEANFILES = $(WRAPPERSCRIPTS)
+ 
+-AM_LDFLAGS = -L../4ti2 -R$(libdir) -l4ti2common -no-undefined
++AM_LDFLAGS = -R$(libdir) -no-undefined
+ 
+ # 16 bit precision flags.
+-# 4ti2int16_LDADD = lib4ti2int16.la
++# 4ti2int16_LDADD = lib4ti2int16.la $(top_builddir)/src/4ti2/lib4ti2common.la
+ # 4ti2int16_CPPFLAGS = -D_4ti2_INT16_
+ # 4ti2int16_SOURCES = $(4ti2sources)
+ # lib4ti2int16_la_CPPFLAGS = -D_4ti2_INT16_
+ # lib4ti2int16_la_SOURCES = $(lib4ti2sources)
+ 
+ # 32 bit precision flags.
+-4ti2int32_LDADD = lib4ti2int32.la
++4ti2int32_LDADD = lib4ti2int32.la $(top_builddir)/src/4ti2/lib4ti2common.la
+ 4ti2int32_CPPFLAGS = -D_4ti2_INT32_
+ 4ti2int32_CXXFLAGS = $(TRAPV) $(AM_CXXFLAGS)
+ 4ti2int32_SOURCES = $(4ti2sources)
+@@ -287,7 +287,7 @@ lib4ti2int32_la_CXXFLAGS = $(TRAPV) $(AM_CXXFLAGS)
+ lib4ti2int32_la_SOURCES = $(lib4ti2sources)
+ 
+ # 64 bit precision flags.
+-4ti2int64_LDADD = lib4ti2int64.la
++4ti2int64_LDADD = lib4ti2int64.la $(top_builddir)/src/4ti2/lib4ti2common.la
+ 4ti2int64_CPPFLAGS = -D_4ti2_INT64_
+ 4ti2int64_CXXFLAGS = $(TRAPV) $(AM_CXXFLAGS)
+ 4ti2int64_SOURCES = $(4ti2sources)
+@@ -298,7 +298,7 @@ lib4ti2int64_la_SOURCES = $(lib4ti2sources)
+ # Arbitrary precision flags.
+ # 4ti2 uses GMP (GLPL), an arbitrary precision arithmetic library.
+ if HAVE_GMP_WITH_CXX
+-4ti2gmp_LDADD = lib4ti2gmp.la
++4ti2gmp_LDADD = lib4ti2gmp.la -lgmp $(top_builddir)/src/4ti2/lib4ti2common.la
+ 4ti2gmp_CPPFLAGS = -D_4ti2_GMP_ $(GMP_CFLAGS)
+ 4ti2gmp_SOURCES = $(4ti2sources)
+ lib4ti2gmp_la_CPPFLAGS = -D_4ti2_GMP_
+diff --git a/src/zsolve/Makefile.am b/src/zsolve/Makefile.am
+index 3a55c40..7826993 100644
+--- a/src/zsolve/Makefile.am
++++ b/src/zsolve/Makefile.am
+@@ -88,7 +88,8 @@ endif
+ # Link in the "common" 4ti2 functions.
+ # -no-undefined declares that no undefined symbols will remain after linking 
all these libraries.
+ # (This is necessary to build shared libraries on Cygwin.)
+-libzsolve_la_LDFLAGS = -L../4ti2 -R$(libdir) -l4ti2common ${GMP_LIBS} 
-no-undefined
++libzsolve_la_LDFLAGS = -R$(libdir) ${GMP_LIBS} -no-undefined
++libzsolve_la_LIBADD = $(top_builddir)/src/4ti2/lib4ti2common.la
+ 
+ bin_SCRIPTS = hilbert graver
+ DISTCLEANFILES = hilbert graver

Reply via email to