diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2022-06-15 11:56:50 -0400 |
---|---|---|
committer | Michael Orlitzky <mjo@gentoo.org> | 2022-06-15 15:29:24 -0400 |
commit | a5f294bb04f044d59923b582e097257559283028 (patch) | |
tree | cf097e704840ecd97b97eda6f2f849f63bc5a75c | |
parent | sys-kernel/gentoo-kernel-bin: Bump to 5.18.4 (diff) | |
download | gentoo-a5f294bb04f044d59923b582e097257559283028.tar.gz gentoo-a5f294bb04f044d59923b582e097257559283028.tar.bz2 gentoo-a5f294bb04f044d59923b582e097257559283028.zip |
sci-mathematics/polymake: new revision with a few fixes.
* Build with perl-5.36. Thanks to Alessandro Barbieri for pointing out
the Fedora patch.
* Added a lower bound on sci-mathematics/normaliz (with USE=normaliz).
* Fixed a missing sci-mathematics/flint dependency that Toralf caught.
Closes: https://bugs.gentoo.org/839255
Closes: https://bugs.gentoo.org/851693
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
-rw-r--r-- | sci-mathematics/polymake/files/polymake-4.6-perl-5.36.patch | 15 | ||||
-rw-r--r-- | sci-mathematics/polymake/polymake-4.6-r1.ebuild | 124 |
2 files changed, 139 insertions, 0 deletions
diff --git a/sci-mathematics/polymake/files/polymake-4.6-perl-5.36.patch b/sci-mathematics/polymake/files/polymake-4.6-perl-5.36.patch new file mode 100644 index 000000000000..4a9d349ccb9a --- /dev/null +++ b/sci-mathematics/polymake/files/polymake-4.6-perl-5.36.patch @@ -0,0 +1,15 @@ +diff -up lib/core/src/perl/RefHash.xxs.orig lib/core/src/perl/RefHash.xxs +--- a/lib/core/src/perl/RefHash.xxs 2022-06-06 10:35:17.689807548 +0200 ++++ b/lib/core/src/perl/RefHash.xxs 2022-06-06 10:37:12.935663947 +0200 +@@ -71,7 +71,11 @@ SV* tmp_keysv::set(SV* keysv) + Copy(obj.keyp, HEK_KEY(hekp), sizeof(SV*), char); + HEK_LEN(hekp) = sizeof(SV*); + HEK_HASH(hekp) = U32(obj.keyl >> 4); // hash value ++#if PerlVersion < 5360 + HEK_FLAGS(hekp) = HVhek_UNSHARED; ++#else ++ HEK_FLAGS(hekp) = HVhek_NOTSHARED; ++#endif + sv.sv_any = &xpv; + sv.sv_refcnt = 1; + sv.sv_flags = SVt_PVIV | SVf_IVisUV | SVf_POK | SVp_POK | PmFlagsForHashKey; diff --git a/sci-mathematics/polymake/polymake-4.6-r1.ebuild b/sci-mathematics/polymake/polymake-4.6-r1.ebuild new file mode 100644 index 000000000000..446fedbda04a --- /dev/null +++ b/sci-mathematics/polymake/polymake-4.6-r1.ebuild @@ -0,0 +1,124 @@ +# Copyright 1999-2022 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-util/ninja + dev-lang/perl" + +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" + +# Tests observed failing after upgrade to polymake-4.5. No idea if they +# worked prior to that. Someone who actually understands polymake will +# have to get these working (at least briefly) before we re-enable them. +RESTRICT=test + +PATCHES=( "${FILESDIR}/${P}-perl-5.36.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'." +} |