summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-mathematics/polymake')
-rw-r--r--sci-mathematics/polymake/Manifest2
-rw-r--r--sci-mathematics/polymake/files/polymake-4.11-barycentric-subdiv.patch23
-rw-r--r--sci-mathematics/polymake/files/polymake-4.11-singular-sat.patch53
-rw-r--r--sci-mathematics/polymake/metadata.xml56
-rw-r--r--sci-mathematics/polymake/polymake-3.0_p2.ebuild90
-rw-r--r--sci-mathematics/polymake/polymake-4.11.ebuild122
6 files changed, 242 insertions, 104 deletions
diff --git a/sci-mathematics/polymake/Manifest b/sci-mathematics/polymake/Manifest
index 46fae3d858fd..64de0ecea8e1 100644
--- a/sci-mathematics/polymake/Manifest
+++ b/sci-mathematics/polymake/Manifest
@@ -1 +1 @@
-DIST polymake-3.0r2.tar.bz2 37695790 BLAKE2B 101dda48128b51737b81d3dc09a8ef32d07c5f67605370c5ef0d5638ee6de427c6e8ff66094f96593ad21fa937ca5890af772f6e877fab0e31f4c98ec7c6730b SHA512 b4c22b2c6da8ef597dc05a44a30c7a55fd924a96854cde3f725095465972eabe1e24508f8e5d544f3131c82c973117b15983c38a0242fc7f1d4a4a8ecddb1d46
+DIST polymake-4.11-minimal.tar.bz2 7325783 BLAKE2B 87e62741e4e44c5fea7454d5cc8cb205cf13f8ee743c1d72100f937d0677505ce0c5c8f5b37c118f89079ca88f313991eaefb2ea02c49b6c7b45c438c6f9e13b SHA512 94adf3fcec21de50451091a04ca17010f5e71b44e3dcd4e2d52b9f952b94ee0cf3f6df15657b761b0bda20eb47cbdc0cb2481bb440c7243442be34f913292246
diff --git a/sci-mathematics/polymake/files/polymake-4.11-barycentric-subdiv.patch b/sci-mathematics/polymake/files/polymake-4.11-barycentric-subdiv.patch
new file mode 100644
index 000000000000..2f58b0f76299
--- /dev/null
+++ b/sci-mathematics/polymake/files/polymake-4.11-barycentric-subdiv.patch
@@ -0,0 +1,23 @@
+commit d55dc6bd7f2da9245884f86706cb96e2d11fa83a
+Author: Benjamin Lorenz <lorenz@math.tu-berlin.de>
+Date: Tue Nov 7 16:49:33 2023 +0100
+
+ barycentric_subdivision: dont call back on empty strings
+
+ thanks jamesjer
+
+ @Jenkins: merge
+
+diff --git a/apps/topaz/src/barycentric_subdivision.cc b/apps/topaz/src/barycentric_subdivision.cc
+index 753afb4040..e2d4130bc3 100644
+--- a/apps/topaz/src/barycentric_subdivision.cc
++++ b/apps/topaz/src/barycentric_subdivision.cc
+@@ -139,7 +139,7 @@ bs_data2Object(const bool realize,
+ else
+ desc << k << "th ";
+ desc << "barycentric subdivision of " << description;
+- if (description.back() != '\n')
++ if (description.empty() || description.back() != '\n')
+ desc << endl;
+ p_out.set_description() << desc.str();
+ return p_out;
diff --git a/sci-mathematics/polymake/files/polymake-4.11-singular-sat.patch b/sci-mathematics/polymake/files/polymake-4.11-singular-sat.patch
new file mode 100644
index 000000000000..739e503ac246
--- /dev/null
+++ b/sci-mathematics/polymake/files/polymake-4.11-singular-sat.patch
@@ -0,0 +1,53 @@
+commit 4ce0549f510d246c8f69c85c509fc2d13d882442
+Author: Benjamin Lorenz <lorenz@math.tu-berlin.de>
+Date: Thu Nov 9 11:15:06 2023 +0100
+
+ singular: support new return types for saturation command
+
+ This was changed from (ideal, exponent) to just the ideal in singular 4-3-2p5.
+ To allow older versions we keep using sat but support both return types
+ instead of switching to the new sat_with_exp.
+
+diff --git a/bundled/singular/apps/ideal/src/singularIdeal.cc b/bundled/singular/apps/ideal/src/singularIdeal.cc
+index 4cbc00a6f4..bdade5c29d 100644
+--- a/bundled/singular/apps/ideal/src/singularIdeal.cc
++++ b/bundled/singular/apps/ideal/src/singularIdeal.cc
+@@ -236,22 +236,24 @@ public:
+ arg.next->data=(void *)idCopy(J);
+ // call primdecSY
+ BOOLEAN res=iiMake_proc(sathdl, nullptr ,&arg);
+- if(!res && (iiRETURNEXPR.Typ() == LIST_CMD)){
+- lists L = (lists)iiRETURNEXPR.Data();
+- SingularIdeal_wrap* result;
+- if(L->m[0].Typ() == IDEAL_CMD){
+- result = new SingularIdeal_impl((::ideal) (L->m[0].Data()),singRing);
+- } else {
+- throw std::runtime_error("Something went wrong for the primary decomposition");
++ if(!res) {
++ ::ideal iddata = nullptr;
++ if (iiRETURNEXPR.Typ() == LIST_CMD) {
++ lists L = (lists)iiRETURNEXPR.Data();
++ if(L->m[0].Typ() == IDEAL_CMD)
++ iddata = (::ideal) L->m[0].Data();
++ } else if (iiRETURNEXPR.Typ() == IDEAL_CMD) {
++ iddata = (::ideal) iiRETURNEXPR.Data();
++ }
++ if (iddata != nullptr) {
++ SingularIdeal_wrap* result = new SingularIdeal_impl(iddata, singRing);
++ iiRETURNEXPR.CleanUp();
++ iiRETURNEXPR.Init();
++ return result;
+ }
+- iiRETURNEXPR.CleanUp();
+- iiRETURNEXPR.Init();
+- return result;
+- } else {
+- iiRETURNEXPR.Init();
+- throw std::runtime_error("Something went wrong for the saturation");
+ }
+-
++ iiRETURNEXPR.Init();
++ throw std::runtime_error("saturation: unable to parse ideal from return value");
+ }
+
+ Array<SingularIdeal_wrap*> primary_decomposition() const
diff --git a/sci-mathematics/polymake/metadata.xml b/sci-mathematics/polymake/metadata.xml
index fb608830c0a6..e8e79ebd3fc8 100644
--- a/sci-mathematics/polymake/metadata.xml
+++ b/sci-mathematics/polymake/metadata.xml
@@ -1,24 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>sci-mathematics@gentoo.org</email>
<name>Gentoo Mathematics Project</name>
</maintainer>
<use>
- <flag name="cdd">Enable sci-libs/cddlib interface for convex hull
- computations (Should be kept enabled).</flag>
- <flag name="lrs">Enable sci-libs/lrslib interface for convex hull computations.</flag>
- <flag name="ppl">Enable dev-libs/ppl interface for convex hull computations.</flag>
- <flag name="bliss">Enable sci-libs/bliss interface for graph and face lattice isomorphism computations.</flag>
- <flag name="group">Build extension for dealing with permutation groups and symmetric objects.</flag>
- <flag name="libnormaliz">Build the bundled extension for lattice related computations.</flag>
- <flag name="singular">Enable the interface to sci-mathematics/singular for ideal related computations.</flag>
- <flag name="libpolymake">Build the polymake library to build applications using the C++ interface.</flag>
+ <flag name="bliss">
+ Enable <pkg>sci-libs/bliss</pkg> interface for graph and face lattice
+ isomorphism computations.
+ </flag>
+ <flag name="cdd">
+ Enable <pkg>sci-libs/cddlib</pkg> interface for convex hull
+ computations (Should be kept enabled).
+ </flag>
+ <flag name="flint">
+ Build with "strongly recommended" support for
+ <pkg>sci-mathematics/flint</pkg>.
+ </flag>
+ <flag name="libpolymake">
+ Build the polymake library to build applications using the C++
+ interface.
+ </flag>
+ <flag name="lrs">
+ Enable <pkg>sci-libs/lrslib</pkg> interface for convex hull
+ computations.
+ </flag>
+ <flag name="nauty">
+ Build the extension for graph automorphism computations using
+ <pkg>sci-mathematics/nauty</pkg>.
+ </flag>
+ <flag name="normaliz">
+ Build the bundled extension for lattice computations using
+ <pkg>sci-mathematics/normaliz</pkg>.
+ </flag>
+ <flag name="ppl">
+ Enable <pkg>dev-libs/ppl</pkg> interface for convex hull computations.
+ </flag>
+ <flag name="singular">
+ Enable the interface to <pkg>sci-mathematics/singular</pkg> for
+ ideal related computations.
+ </flag>
</use>
<longdescription lang="en">
-Polymake started out as a tool for the algorithmic treatment of convex
-polyhedra. By now it also deals with finite simplicial complexes,
-tight spans of finite metric spaces, and other objects.
+ Polymake is open source software for research in polyhedral
+ geometry. It deals with polytopes, polyhedra, and fans as well as
+ simplicial complexes, matroids, graphs, tropical hypersurfaces, and
+ other objects.
</longdescription>
+<upstream>
+ <remote-id type="github">polymake/polymake</remote-id>
+</upstream>
</pkgmetadata>
diff --git a/sci-mathematics/polymake/polymake-3.0_p2.ebuild b/sci-mathematics/polymake/polymake-3.0_p2.ebuild
deleted file mode 100644
index 179fb83a8924..000000000000
--- a/sci-mathematics/polymake/polymake-3.0_p2.ebuild
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit eutils flag-o-matic
-
-DESCRIPTION="research tool for polyhedral geometry and combinatorics"
-SRC_URI="https://polymake.org/lib/exe/fetch.php/download/polymake-3.0r2.tar.bz2"
-HOMEPAGE="https://polymake.org"
-
-IUSE="+cdd lrs ppl bliss group +libnormaliz singular libpolymake"
-
-REQUIRED_USE="group? ( cdd lrs )"
-
-SLOT="0"
-LICENSE="GPL-2"
-KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-
-DEPEND="dev-lang/perl
- dev-libs/gmp:0=
- dev-libs/mpfr:0
- dev-libs/libxml2:2
- dev-libs/libxslt
- ppl? ( dev-libs/ppl )
- cdd? ( sci-libs/cddlib )
- lrs? ( >=sci-libs/lrslib-051[gmp] )
- bliss? ( sci-libs/bliss[gmp] )
- group? ( dev-libs/boost:= )
- libnormaliz? ( dev-libs/boost:= )
- singular? ( >=sci-mathematics/singular-4.0.1 )"
-RDEPEND="${DEPEND}
- dev-perl/XML-LibXML
- dev-perl/XML-LibXSLT
- dev-perl/XML-Writer
- dev-perl/Term-ReadLine-Gnu"
-
-S="${WORKDIR}/${PN}-3.0"
-
-pkg_pretend() {
- einfo "During compile this package uses up to"
- einfo "750MB of RAM per process. Use MAKEOPTS=\"-j1\" if"
- einfo "you run into trouble."
-}
-
-src_configure() {
- export CXXOPT=$(get-flag -O)
-
- # We need to define BLISS_USE_GMP if bliss was built with gmp support.
- # Therefore we require gmp support on bliss, so that the package
- # manager can prevent rebuilds with changed gmp flag.
- if use bliss ; then
- append-cxxflags -DBLISS_USE_GMP
- fi
-
- # Configure does not accept --host, therefore econf cannot be used
-
- # Some of the options do not support using just '--with-option'
- local myconf=""
- use !group && myconf="$myconf --without-group"
- use !libnormaliz && myconf="$myconf --without-libnormaliz"
- use !libpolymake && myconf="$myconf --without-callable"
-
- # And many other --with-arguments expect a path: --with-option=/path
- ./configure --prefix="${EPREFIX}/usr" \
- --libdir="${EPREFIX}/usr/$(get_libdir)" \
- --libexecdir="${EPREFIX}/usr/$(get_libdir)/polymake" \
- --without-prereq \
- --without-java \
- $(use_with cdd cdd "${EPREFIX}/usr") \
- $(use_with lrs lrs "${EPREFIX}/usr") \
- $(use_with ppl ppl "${EPREFIX}/usr") \
- $(use_with bliss bliss "${EPREFIX}/usr") \
- $(use_with singular singular "${EPREFIX}/usr") \
- ${myconf} || die
-}
-
-src_install() {
- emake -j1 DESTDIR="${D}" install
-}
-
-pkg_postinst() {
- elog "Docs can be found on https://www.polymake.org/doku.php/documentation"
- elog " "
- elog "Support for jreality is missing, sorry (see bug #346073)."
- elog " "
- elog "Additional features for polymake are available through external"
- elog "software such as sci-mathematics/4ti2 and sci-mathematics/topcom."
- elog "After installing new external software run 'polymake --reconfigure'."
-}
diff --git a/sci-mathematics/polymake/polymake-4.11.ebuild b/sci-mathematics/polymake/polymake-4.11.ebuild
new file mode 100644
index 000000000000..8c6be02dd591
--- /dev/null
+++ b/sci-mathematics/polymake/polymake-4.11.ebuild
@@ -0,0 +1,122 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic ninja-utils toolchain-funcs
+
+DESCRIPTION="Tool for polyhedral geometry and combinatorics"
+SRC_URI="https://polymake.org/lib/exe/fetch.php/download/${P}-minimal.tar.bz2"
+HOMEPAGE="https://polymake.org/"
+
+# polymake itself is GPL-2, but even the minimal tarball bundles a lot
+# of other code. I've included everything that turns up with a
+#
+# find ./ -name 'LICENSE' -o -name 'COPYING'
+#
+# in the list below. If any of these bother you, you may want to take a
+# closer look at how (or even if) the corresponding code is being used.
+LICENSE="BSD GPL-2 GPL-2+ MIT WTFPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~riscv ~x86 ~amd64-linux ~x86-linux"
+IUSE="bliss +cdd +flint +normaliz libpolymake lrs nauty ppl singular"
+
+REQUIRED_USE="^^ ( bliss nauty )"
+
+# The "configure" script isn't autotools; it basically exists just to
+# exec some other perl script but using the familiar name.
+BDEPEND="dev-lang/perl
+ ${NINJA_DEPEND}"
+
+DEPEND="
+ libpolymake? ( dev-lang/perl )
+ dev-libs/boost:=
+ dev-libs/gmp:=
+ dev-libs/libxml2:2=
+ dev-libs/libxslt:=
+ dev-libs/mpfr:=
+ sys-libs/readline:=
+ bliss? ( sci-libs/bliss:=[gmp] )
+ cdd? ( sci-libs/cddlib:= )
+ flint? ( sci-mathematics/flint:= )
+ lrs? ( >=sci-libs/lrslib-051:=[gmp] )
+ nauty? ( sci-mathematics/nauty:= )
+ normaliz? ( >=sci-mathematics/normaliz-3.8:= )
+ ppl? ( dev-libs/ppl:= )
+ singular? ( sci-mathematics/singular:= )"
+
+RDEPEND="${DEPEND}
+ dev-lang/perl
+ dev-perl/JSON
+ dev-perl/Term-ReadLine-Gnu
+ dev-perl/TermReadKey
+ dev-perl/XML-SAX
+ dev-perl/XML-Writer"
+
+PATCHES=(
+ "${FILESDIR}/${P}-singular-sat.patch"
+ "${FILESDIR}/${P}-barycentric-subdiv.patch"
+)
+
+src_configure() {
+ # Without this, the build system tries to use "the highest possible"
+ # optimization level and will override what's in your CXXFLAGS.
+ export CXXOPT=""
+
+ tc-export CC CXX
+
+ # We need to define BLISS_USE_GMP if bliss was built with gmp support.
+ # Therefore we require gmp support on bliss, so that the package
+ # manager can prevent rebuilds with changed gmp flag. Yes, this should
+ # be append-cppflags; but the build system doesn't respect CPPFLAGS.
+ use bliss && append-cxxflags -DBLISS_USE_GMP
+
+ # This isn't an autotools ./configure script, so a lot of things
+ # don't work the way you'd expect. We disable openmp unconditionally
+ # because it's only supposedly only used for building the bundled
+ # libnormaliz (we unbundle it) and for something called to_simplex
+ # that I can't find anywhere in the polymake source.
+ ./configure --prefix="${EPREFIX}/usr" \
+ --libdir="${EPREFIX}/usr/$(get_libdir)" \
+ --libexecdir="${EPREFIX}/usr/$(get_libdir)/polymake" \
+ $(usev !libpolymake "--without-callable") \
+ --without-java \
+ --without-javaview \
+ --without-native \
+ --without-scip \
+ --without-soplex \
+ --without-openmp \
+ $(use_with bliss bliss "${EPREFIX}/usr") \
+ $(use_with cdd cdd "${EPREFIX}/usr") \
+ $(use_with flint flint "${EPREFIX}/usr") \
+ $(use_with lrs lrs "${EPREFIX}/usr") \
+ $(use_with nauty nauty "${EPREFIX}/usr") \
+ $(use_with normaliz libnormaliz "${EPREFIX}/usr") \
+ $(use_with ppl ppl "${EPREFIX}/usr") \
+ $(use_with singular singular "${EPREFIX}/usr") \
+ || die
+}
+
+# There is a backwards-compatible Makefile that would call ninja for us
+# in src_compile/src_install, but it doesn't handle MAKEOPTS correctly.
+src_compile() {
+ eninja -C build/Opt
+}
+
+src_install() {
+ # DESTDIR needs to find its way into the real install script,
+ # support/install.pl.
+ export DESTDIR="${D}"
+ eninja -C build/Opt install
+}
+
+src_test() {
+ perl/polymake --script run_testcases --emacs-style \
+ || die "test suite failed"
+}
+
+pkg_postinst() {
+ elog "Additional features for polymake are available through external"
+ elog "software such as sci-mathematics/4ti2 and sci-mathematics/topcom."
+ elog "After installing new external software run 'polymake --reconfigure'."
+}