From 290d0ac2243a314697342bf218cd4a30b27680da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Sun, 21 Nov 2021 09:29:09 -0300 Subject: [PATCH] New package: gfan-0.6.2 Uses three patches taken from sagemath, cf https://git.sagemath.org/sage.git/plain/build/pkgs/gfan/patches?h=9.5.beta7 - fix location of cddlib include files - normalize the output of one failing test - make tests return an error so build aborts Also fixes for 32 bit bugs catched by testsuite: - add `-ffloat-store` to CFLAGS to fix `0009RenderStairCase` - patch typedef for `int64` which causes hang in `0602ResultantFanProjection` --- .../patches/fix-int64-for-32bit-archs.patch | 18 ++ .../gfan/patches/maketestsreturnerror.patch | 27 +++ .../patches/new-cddlib-header-location.patch | 71 +++++++ .../gfan/patches/truncate0008outputs.patch | 195 ++++++++++++++++++ srcpkgs/gfan/template | 38 ++++ srcpkgs/gfan/update | 1 + 6 files changed, 350 insertions(+) create mode 100644 srcpkgs/gfan/patches/fix-int64-for-32bit-archs.patch create mode 100644 srcpkgs/gfan/patches/maketestsreturnerror.patch create mode 100644 srcpkgs/gfan/patches/new-cddlib-header-location.patch create mode 100644 srcpkgs/gfan/patches/truncate0008outputs.patch create mode 100644 srcpkgs/gfan/template create mode 100644 srcpkgs/gfan/update diff --git a/srcpkgs/gfan/patches/fix-int64-for-32bit-archs.patch b/srcpkgs/gfan/patches/fix-int64-for-32bit-archs.patch new file mode 100644 index 00000000000..c642e32c224 --- /dev/null +++ b/srcpkgs/gfan/patches/fix-int64-for-32bit-archs.patch @@ -0,0 +1,18 @@ +patch typedef for `int64` which causes hang in `0602ResultantFanProjection` + +cf: +https://github.com/void-linux/void-packages/pull/34182 +https://trac.sagemath.org/ticket/32088 +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905300 + +--- a/src/vektor.h 2017-06-20 11:47:37.000000000 -0300 ++++ b/src/vektor.h 2021-11-21 18:28:43.384750825 -0300 +@@ -10,7 +10,7 @@ + + using namespace std; + +-typedef signed long int int64; ++typedef int64_t int64; + + void outOfRange(int i, int n); + diff --git a/srcpkgs/gfan/patches/maketestsreturnerror.patch b/srcpkgs/gfan/patches/maketestsreturnerror.patch new file mode 100644 index 00000000000..8197f08b74f --- /dev/null +++ b/srcpkgs/gfan/patches/maketestsreturnerror.patch @@ -0,0 +1,27 @@ +diff --git a/src/app_test.cpp b/src/app_test.cpp +index 755bfe6..183c735 100644 +--- a/src/app_test.cpp ++++ b/src/app_test.cpp +@@ -562,6 +562,9 @@ int testIntegers() + failed.push_back(i->folder); + } + cout<<"\n"; ++ cout<<"Number of succesful tests "< + #include +diff --git a/src/gfanlib_zcone.cpp b/src/gfanlib_zcone.cpp +index f24f09c..481f116 100644 +--- a/src/gfanlib_zcone.cpp ++++ b/src/gfanlib_zcone.cpp +@@ -16,8 +16,8 @@ + #include "setoper.h" + #include "cdd.h" + #else +-#include "cdd/setoper.h" +-#include "cdd/cdd.h" ++#include "cddlib/setoper.h" ++#include "cddlib/cdd.h" + #endif + //} + +@@ -52,8 +52,8 @@ namespace gfan{ + "dd_free_global_constants()\n" + "in your deinitialisation code (only available for cddlib version>=094d).\n" + "This requires the header includes:\n" +- "#include \"cdd/setoper.h\"\n" +- "#include \"cdd/cdd.h\"\n" ++ "#include \"cddlib/setoper.h\"\n" ++ "#include \"cddlib/cdd.h\"\n" + "\n" + "Alternatively, you may call gfan:initializeCddlibIfRequired() and deinitializeCddlibIfRequired()\n" + "if gfanlib is the only code using cddlib. If at some point cddlib is no longer required by gfanlib\n" +diff --git a/src/lp_cdd.cpp b/src/lp_cdd.cpp +index ec36517..5232d50 100644 +--- a/src/lp_cdd.cpp ++++ b/src/lp_cdd.cpp +@@ -5,9 +5,9 @@ + #include "cdd.h" + #include "cdd_f.h" + #else +-#include "cdd/setoper.h" +-#include "cdd/cdd.h" +-#include "cdd/cdd_f.h" ++#include "cddlib/setoper.h" ++#include "cddlib/cdd.h" ++#include "cddlib/cdd_f.h" + #endif + //} + #include "termorder.h" diff --git a/srcpkgs/gfan/patches/truncate0008outputs.patch b/srcpkgs/gfan/patches/truncate0008outputs.patch new file mode 100644 index 00000000000..bcc12b340b5 --- /dev/null +++ b/srcpkgs/gfan/patches/truncate0008outputs.patch @@ -0,0 +1,195 @@ +diff --git a/testsuite/0008PolynomialSetUnion/command b/testsuite/0008PolynomialSetUnion/command +index cbb23d6..d61cb71 100644 +--- a/testsuite/0008PolynomialSetUnion/command ++++ b/testsuite/0008PolynomialSetUnion/command +@@ -1 +1 @@ +-%s _bases | %s _polynomialsetunion |sort ++%s _bases | %s _polynomialsetunion |LC_ALL=C sort|tail -n +2 | sed -e '$ d' +diff --git a/testsuite/0008PolynomialSetUnion/output b/testsuite/0008PolynomialSetUnion/output +index 38dfb6f..12a65c7 100644 +--- a/testsuite/0008PolynomialSetUnion/output ++++ b/testsuite/0008PolynomialSetUnion/output +@@ -1,62 +1,60 @@ +-{ ++a*b-c^6, ++a*b^2-c^3, ++a*b^4-b, ++a*c-b^6, ++a*c^2-b, ++a*c^6-c, ++a-b^11, ++a-b^2*c, ++a-c^9, + a^11-c, + a^15-a, ++a^2*b-c, + a^2*b^3-a, ++a^2*c-b^3, + a^2-b^8, +-a^2*b-c, + a^2-c^4, +-a^2*c-b^3, +-a^3-b^5, +-a^3-b*c^2, + a^3*c^2-c} +-a^4-b^2, ++a^3-b*c^2, ++a^3-b^5, + a^4*c-a, ++a^4-b^2, + a^5-c^3, + a^6*b-a, + a^6-b*c, + a^8-c^2, + a^9-b, +-a-b^11, +-a-b^2*c, +-a*b^2-c^3, +-a*b^4-b, +-a*b-c^6, +-a*c^2-b, +-a*c^6-c, +-a-c^9, +-a*c-b^6, ++b*c-a^6, ++b*c^2-a^3, ++b*c^4-c, ++b-a*c^2, ++b-a^9, ++b-c^11, + b^11-a, + b^15-b, +-b^2-a^4, ++b^2*c-a, + b^2*c^3-b, ++b^2-a^4, + b^2-c^8, +-b^2*c-a, + b^3-a^2*c, + b^3-c^5, + b^4-c^2, + b^5-a^3, +-b^6-a*c, + b^6*c-b, ++b^6-a*c, + b^8-a^2, + b^9-c, +-b-a^9, +-b-a*c^2, +-b-c^11, +-b*c^2-a^3, +-b*c^4-c, +-b*c-a^6, ++c-a^11, ++c-a^2*b, ++c-b^9, + c^11-b, + c^15-c, + c^2-a^8, + c^2-b^4, +-c^3-a^5, + c^3-a*b^2, ++c^3-a^5, + c^4-a^2, + c^5-b^3, + c^6-a*b, + c^8-b^2, + c^9-a, +-c-a^11, +-c-a^2*b, +-c-b^9, +-Q[a,b,c] +diff --git a/testsuite/0008PolynomialSetUnion/outputNew b/testsuite/0008PolynomialSetUnion/outputNew +index 38dfb6f..12a65c7 100644 +--- a/testsuite/0008PolynomialSetUnion/outputNew ++++ b/testsuite/0008PolynomialSetUnion/outputNew +@@ -1,62 +1,60 @@ +-{ ++a*b-c^6, ++a*b^2-c^3, ++a*b^4-b, ++a*c-b^6, ++a*c^2-b, ++a*c^6-c, ++a-b^11, ++a-b^2*c, ++a-c^9, + a^11-c, + a^15-a, ++a^2*b-c, + a^2*b^3-a, ++a^2*c-b^3, + a^2-b^8, +-a^2*b-c, + a^2-c^4, +-a^2*c-b^3, +-a^3-b^5, +-a^3-b*c^2, + a^3*c^2-c} +-a^4-b^2, ++a^3-b*c^2, ++a^3-b^5, + a^4*c-a, ++a^4-b^2, + a^5-c^3, + a^6*b-a, + a^6-b*c, + a^8-c^2, + a^9-b, +-a-b^11, +-a-b^2*c, +-a*b^2-c^3, +-a*b^4-b, +-a*b-c^6, +-a*c^2-b, +-a*c^6-c, +-a-c^9, +-a*c-b^6, ++b*c-a^6, ++b*c^2-a^3, ++b*c^4-c, ++b-a*c^2, ++b-a^9, ++b-c^11, + b^11-a, + b^15-b, +-b^2-a^4, ++b^2*c-a, + b^2*c^3-b, ++b^2-a^4, + b^2-c^8, +-b^2*c-a, + b^3-a^2*c, + b^3-c^5, + b^4-c^2, + b^5-a^3, +-b^6-a*c, + b^6*c-b, ++b^6-a*c, + b^8-a^2, + b^9-c, +-b-a^9, +-b-a*c^2, +-b-c^11, +-b*c^2-a^3, +-b*c^4-c, +-b*c-a^6, ++c-a^11, ++c-a^2*b, ++c-b^9, + c^11-b, + c^15-c, + c^2-a^8, + c^2-b^4, +-c^3-a^5, + c^3-a*b^2, ++c^3-a^5, + c^4-a^2, + c^5-b^3, + c^6-a*b, + c^8-b^2, + c^9-a, +-c-a^11, +-c-a^2*b, +-c-b^9, +-Q[a,b,c] diff --git a/srcpkgs/gfan/template b/srcpkgs/gfan/template new file mode 100644 index 00000000000..174ed182f9d --- /dev/null +++ b/srcpkgs/gfan/template @@ -0,0 +1,38 @@ +# Template file for 'gfan' +pkgname=gfan +version=0.6.2 +revision=1 +wrksrc=gfan$version +build_style=gnu-makefile +makedepends="gmp-devel cddlib-devel" +short_desc="Package for computing Groebner fans and tropical varieties" +maintainer="Gonzalo TornarĂ­a " +license="GPL-2.0-or-later" +homepage="https://math.au.dk/~jensen/software/gfan/gfan.html" +distfiles="https://math.au.dk/~jensen/software/gfan/gfan${version}.tar.gz" +checksum=a674d5e5dc43634397de0d55dd5da3c32bd358d05f72b73a50e62c1a1686f10a + +# Makefile has this but our CFLAGS override it; build fails otherwise +CFLAGS="-DGMPRATIONAL" + +case $XBPS_TARGET_MACHINE in + # avoid numerical noise caused by extended-precision of registers + # fixes testsuite/0009RenderStairCase + i686*) CFLAGS+=" -ffloat-store" ;; +esac + +if [ -n "$CROSS_BUILD" ]; then + # depend on host gfan for installlinks + hostmakedepends+=" gfan" +fi + +do_install() { + if [ -z "$CROSS_BUILD" ]; then + # Makefile doesn't support DESTDIR so we add it to PREFIX + make PREFIX=${DESTDIR}/usr install + else + vbin gfan + # use host gfan to install links + cd ${DESTDIR}/usr/bin && gfan installlinks + fi +} diff --git a/srcpkgs/gfan/update b/srcpkgs/gfan/update new file mode 100644 index 00000000000..d7ac612f989 --- /dev/null +++ b/srcpkgs/gfan/update @@ -0,0 +1 @@ +ignore=lib*