From d268bc54cda6aa99272afd7c30806ee1a9bb3b7c Mon Sep 17 00:00:00 2001
From: jengelh <>
Date: Mar 28 2023 16:01:57 +0000
Subject: Update 4ti2 to version 1.6.9 / rev 7 via SR 1074789
https://build.opensuse.org/request/show/1074789
by user jengelh + dimstar_suse
- Add 0001-build-resolve-missing-includes-showing-on-gcc-13.patch
---
diff --git a/.files b/.files
index 0e69379..12cd4fc 100644
Binary files a/.files and b/.files differ
diff --git a/.rev b/.rev
index f27e8c5..b086ce4 100644
--- a/.rev
+++ b/.rev
@@ -46,4 +46,12 @@
- Modernize specfile.
833994
+
+ c7e4fe00244a633ab1f488cbd29d19ca
+ 1.6.9
+
+ dimstar_suse
+ - Add 0001-build-resolve-missing-includes-showing-on-gcc-13.patch
+ 1074789
+
diff --git a/0001-build-resolve-missing-includes-showing-on-gcc-13.patch b/0001-build-resolve-missing-includes-showing-on-gcc-13.patch
new file mode 100644
index 0000000..f906074
--- /dev/null
+++ b/0001-build-resolve-missing-includes-showing-on-gcc-13.patch
@@ -0,0 +1,27 @@
+From c024db44f43593fbfe9d8d51f035db7a605d1fa6 Mon Sep 17 00:00:00 2001
+From: Jan Engelhardt
+Date: Tue, 28 Mar 2023 00:33:03 +0200
+Subject: [PATCH] build: resolve missing includes showing on gcc-13
+References: https://github.com/4ti2/4ti2/pull/40
+
+../../src/zsolve/VectorArrayAPI.hpp: In function 'void _4ti2_zsolve_::convert(const T1&, T2&) [with T1 = long int; T2 = int]':
+../../src/zsolve/VectorArrayAPI.hpp:79:14: error: 'INT32_MIN' was not declared in this scope; did you mean 'INT_MIN'?
+---
+ src/zsolve/VectorArrayAPI.hpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/zsolve/VectorArrayAPI.hpp b/src/zsolve/VectorArrayAPI.hpp
+index a5cb948..cd2ae99 100644
+--- a/src/zsolve/VectorArrayAPI.hpp
++++ b/src/zsolve/VectorArrayAPI.hpp
+@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ #include "zsolve/VectorArray.hpp"
+ #include "zsolve/Exception.h"
+ #include
++#include
+ #include
+
+ namespace _4ti2_zsolve_ {
+--
+2.40.0
+
diff --git a/4ti2-docdir.diff b/4ti2-docdir.diff
index 72b0efc..0383570 100644
--- a/4ti2-docdir.diff
+++ b/4ti2-docdir.diff
@@ -6,19 +6,16 @@ Subject: [PATCH] build: stop misplacing documentation
docdir must not be statically set as it would override what the
user gave to ./configure --docdir=...
---
- doc/Makefile.am | 2 --
+ doc/Makefile.am | 2 --
1 file changed, 2 deletions(-)
-diff --git a/doc/Makefile.am b/doc/Makefile.am
-index 78abbd6..ea73e88 100644
---- a/doc/Makefile.am
-+++ b/doc/Makefile.am
+Index: 4ti2-1.6.9/doc/Makefile.am
+===================================================================
+--- 4ti2-1.6.9.orig/doc/Makefile.am
++++ 4ti2-1.6.9/doc/Makefile.am
@@ -1,5 +1,3 @@
-docdir = $(pkgdatadir)/doc
-
doc_DATA = 4ti2_manual.pdf
## Manual sources.
---
-2.19.0
-
diff --git a/4ti2-handle-prefix.patch b/4ti2-handle-prefix.patch
new file mode 100644
index 0000000..4e1dfa3
--- /dev/null
+++ b/4ti2-handle-prefix.patch
@@ -0,0 +1,72 @@
+From 0d4518dbcf9321df4d8cad6e97e562f34f7d31f4 Mon Sep 17 00:00:00 2001
+From: Alois Wohlschlager
+Date: Thu, 1 Jul 2021 14:37:06 +0000
+Subject: [PATCH] scripts: apply realpath for $0
+References: https://github.com/4ti2/4ti2/pull/31
+
+When $0 is a symlink, program execution would fail to find the right
+directory. Fix that up.
+
+The 4ti2 program names are quite generic (e.g. "output"), and hence
+openSUSE has relegated them to /usr/libexec/4ti2, offering instead
+prefixed symlinks in /usr/bin, e.g. /usr/bin/4ti2_groebner ->
+/usr/libexec/4ti2/groebner.
+---
+ src/groebner/script.template | 2 +-
+ src/groebner/script.template.in | 2 +-
+ src/zsolve/graver.template | 2 +-
+ src/zsolve/hilbert.template | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+Index: 4ti2-1.6.9/src/groebner/script.template
+===================================================================
+--- 4ti2-1.6.9.orig/src/groebner/script.template
++++ 4ti2-1.6.9/src/groebner/script.template
+@@ -21,7 +21,7 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ # We locate where this script is so we can call the executables.
+-SCRIPT=`which "$0"`
++SCRIPT=$(realpath $(which "$0"))
+ DIR=`dirname "$SCRIPT"`
+ FUNCTION=`basename "$SCRIPT"`
+
+Index: 4ti2-1.6.9/src/groebner/script.template.in
+===================================================================
+--- 4ti2-1.6.9.orig/src/groebner/script.template.in
++++ 4ti2-1.6.9/src/groebner/script.template.in
+@@ -21,7 +21,7 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ # We locate where this script is so we can call the executables.
+-SCRIPT=`which "$0"`
++SCRIPT=$(realpath $(which "$0"))
+ DIR=`dirname "$SCRIPT"`
+ FUNCTION=`basename "$SCRIPT"`
+
+Index: 4ti2-1.6.9/src/zsolve/graver.template
+===================================================================
+--- 4ti2-1.6.9.orig/src/zsolve/graver.template
++++ 4ti2-1.6.9/src/zsolve/graver.template
+@@ -2,7 +2,7 @@
+
+ # We locate where this script is so we can call the executable zsolve which
+ # should be in the same directory as this script.
+-SCRIPT=`which "$0"`
++SCRIPT=$(realpath $(which "$0"))
+ SCRIPTDIR=`dirname "$SCRIPT"`
+ EXECUTABLE=zsolve
+
+Index: 4ti2-1.6.9/src/zsolve/hilbert.template
+===================================================================
+--- 4ti2-1.6.9.orig/src/zsolve/hilbert.template
++++ 4ti2-1.6.9/src/zsolve/hilbert.template
+@@ -2,7 +2,7 @@
+
+ # We locate where this script is so we can call the executable zsolve which
+ # should be in the same directory as this script.
+-SCRIPT=`which "$0"`
++SCRIPT=$(realpath $(which "$0"))
+ SCRIPTDIR=`dirname "$SCRIPT"`
+ EXECUTABLE=zsolve
+
diff --git a/4ti2.changes b/4ti2.changes
index a42254e..446d841 100644
--- a/4ti2.changes
+++ b/4ti2.changes
@@ -1,4 +1,20 @@
-------------------------------------------------------------------
+Mon Mar 27 22:35:21 UTC 2023 - Jan Engelhardt
+
+- Add 0001-build-resolve-missing-includes-showing-on-gcc-13.patch
+
+-------------------------------------------------------------------
+Thu Jul 1 20:03:41 UTC 2021 - Jan Engelhardt
+
+- Run fdupes to eliminate script copies.
+
+-------------------------------------------------------------------
+Thu Jul 1 13:39:30 UTC 2021 - Alois Wohlschlager
+
+- Add patch 4ti2-handle-prefix.patch to handle the downstream
+ 4ti2_ executable prefix in wrapper scripts.
+
+-------------------------------------------------------------------
Sat Aug 24 15:47:19 UTC 2019 - Jan Engelhardt
- Modernize specfile.
diff --git a/4ti2.spec b/4ti2.spec
index 2e668f8..0ed4876 100644
--- a/4ti2.spec
+++ b/4ti2.spec
@@ -1,7 +1,7 @@
#
# spec file for package 4ti2
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -26,8 +26,11 @@ URL: https://4ti2.github.io/
Source: https://github.com/4ti2/4ti2/releases/download/Release_1_6_9/4ti2-1.6.9.tar.gz
Patch1: 4ti2-docdir.diff
+Patch2: 4ti2-handle-prefix.patch
+Patch3: 0001-build-resolve-missing-includes-showing-on-gcc-13.patch
BuildRequires: autoconf >= 2.59
BuildRequires: automake
+BuildRequires: fdupes
BuildRequires: gcc-c++ >= 4.3
BuildRequires: glpk-devel >= 4.52
BuildRequires: gmp-devel >= 4.1.4
@@ -73,7 +76,7 @@ developing against 4ti2's libraries.
autoreconf -fi
%configure --enable-shared --disable-static \
--includedir="%_includedir/%name" --docdir="%_docdir/%name"
-make %{?_smp_mflags}
+%make_build
%install
%make_install
@@ -85,6 +88,7 @@ pushd "$b/%_libexecdir/%name"
for i in *; do
ln -s "%_libexecdir/%name/$i" "$b/%_bindir/4ti2_$i"
done
+%fdupes -s %buildroot/%_prefix
%post -n lib4ti2-0 -p /sbin/ldconfig
%postun -n lib4ti2-0 -p /sbin/ldconfig