Github messages for voidlinux
 help / color / mirror / Atom feed
From: tornaria <tornaria@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: gfan-0.6.2
Date: Sun, 21 Nov 2021 22:52:41 +0100	[thread overview]
Message-ID: <20211121215241.bXT7mmDUeD2s4CNN_areJk0qXxZFgE1-oM15X7r5cec@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-34182@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 334 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages gfan
https://github.com/void-linux/void-packages/pull/34182

New package: gfan-0.6.2
Dependency of sagemath

A patch file from https://github.com/void-linux/void-packages/pull/34182.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-gfan-34182.patch --]
[-- Type: text/x-diff, Size: 11085 bytes --]

From 2c5be10e5ede5ff7210c5c7d12fc0ec5bdf04223 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
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 000000000000..c642e32c224e
--- /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 000000000000..8197f08b74f1
--- /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 "<<good<<endl;
++	  cout<<"Number of failed tests "<<bad<<endl;
++
+ 	  if(!failed.empty())
+ 	  {
+ 		  cout<<"Failed tests:\n-------------\n";
+@@ -569,11 +572,9 @@ int testIntegers()
+ 		  {
+ 			  cout<<*i<<" FAILED!\n";
+ 		  }
++		  return 1;
+ 	  }
+ 
+-	  cout<<"Number of succesful tests "<<good<<endl;
+-	  cout<<"Number of failed tests "<<bad<<endl;
+-
+ 	  return 0;
+   }
+ };
diff --git a/srcpkgs/gfan/patches/new-cddlib-header-location.patch b/srcpkgs/gfan/patches/new-cddlib-header-location.patch
new file mode 100644
index 000000000000..e67c35ad452f
--- /dev/null
+++ b/srcpkgs/gfan/patches/new-cddlib-header-location.patch
@@ -0,0 +1,71 @@
+diff --git a/doc/installation.tex b/doc/installation.tex
+index 763f147..61c87be 100644
+--- a/doc/installation.tex
++++ b/doc/installation.tex
+@@ -20,7 +20,7 @@ Should this command fail, then you are using an old version of gfan.
+ As an alternative to using package managers as above you can try to locate an executable file named ``gfan'' in the installation of other math software. SageMath, for example, contains a gfan executable. You also have the possibility of installing a precompiled executables: go to the Gfan webpage, go to the binaries.html subpage, and follow the instructions there. There is however only very few executables available.
+ 
+ %% Rewrite this section.
+-%% The apt-get linux trouble disappears if all includes of cdd files are of form ``cdd/set\_oper.h''. Now of course if we cannot run apt-get because we are not root we need to install cddlib manually. Here we should use configure to specify how that is done correctly. We should use --prefix=, --includedir=, and possibly --libdir=.
++%% The apt-get linux trouble disappears if all includes of cdd files are of form ``cddlib/set\_oper.h''. Now of course if we cannot run apt-get because we are not root we need to install cddlib manually. Here we should use configure to specify how that is done correctly. We should use --prefix=, --includedir=, and possibly --libdir=.
+ 
+ %% The same thing goes for gmp???? EXCEPT THAT FOR SOME REASON gmp is allowed to be in /usr/include .
+ 
+diff --git a/src/app_librarytest.cpp b/src/app_librarytest.cpp
+index 3b1395b..d91a264 100644
+--- a/src/app_librarytest.cpp
++++ b/src/app_librarytest.cpp
+@@ -12,8 +12,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
+ #include <iostream>
+ #include <fstream>
+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 000000000000..bcc12b340b51
--- /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 000000000000..174ed182f9d3
--- /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 <tornaria@cmat.edu.uy>"
+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 000000000000..d7ac612f989d
--- /dev/null
+++ b/srcpkgs/gfan/update
@@ -0,0 +1 @@
+ignore=lib*

  parent reply	other threads:[~2021-11-21 21:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-21 12:32 [PR PATCH] " tornaria
2021-11-21 13:49 ` [PR PATCH] [Updated] " tornaria
2021-11-21 15:29 ` tornaria
2021-11-21 15:39 ` tornaria
2021-11-21 15:47 ` leahneukirchen
2021-11-21 16:11 ` tornaria
2021-11-21 17:22 ` ericonr
2021-11-21 20:14 ` tornaria
2021-11-21 20:20 ` tornaria
2021-11-21 20:23 ` tornaria
2021-11-21 21:52 ` tornaria [this message]
2021-11-22 12:18 ` [PR PATCH] [Merged]: " leahneukirchen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211121215241.bXT7mmDUeD2s4CNN_areJk0qXxZFgE1-oM15X7r5cec@z \
    --to=tornaria@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).