From 9de53b150b379c698ca0a9806dca07c178f337994dc2f8308dc867bcd60fb43b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 1 Jul 2021 19:11:21 +0000 Subject: [PATCH 1/3] Accepting request 903460 from home:aloisw:branches:science - Add patch to handle the downstream 4ti2_ executable prefix in wrapper scripts OBS-URL: https://build.opensuse.org/request/show/903460 OBS-URL: https://build.opensuse.org/package/show/science/4ti2?expand=0&rev=20 --- 4ti2-handle-prefix.patch | 33 +++++++++++++++++++++++++++++++++ 4ti2.changes | 5 +++++ 4ti2.spec | 4 +++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 4ti2-handle-prefix.patch diff --git a/4ti2-handle-prefix.patch b/4ti2-handle-prefix.patch new file mode 100644 index 0000000..264cc56 --- /dev/null +++ b/4ti2-handle-prefix.patch @@ -0,0 +1,33 @@ +--- a/src/groebner/script.template.in ++++ b/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"` + +--- a/src/zsolve/graver.template ++++ b/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 + +--- a/src/zsolve/hilbert.template ++++ b/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 606dc0d..1ab5cc7 100644 --- a/4ti2.changes +++ b/4ti2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jul 1 13:39:30 UTC 2021 - Alois Wohlschlager + +- Add patch to handle the downstream 4ti2_ executable prefix in wrapper scripts + ------------------------------------------------------------------- Sat Aug 24 15:47:19 UTC 2019 - Jan Engelhardt diff --git a/4ti2.spec b/4ti2.spec index ea2d394..f4acb80 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) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -26,6 +26,8 @@ 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 +# PATCH-FIX-OPENSUSE handle our downstream 4ti2_ executable prefix in the wrapper scripts +Patch2: 4ti2-handle-prefix.patch BuildRequires: autoconf >= 2.59 BuildRequires: automake BuildRequires: gcc-c++ >= 4.3 From 2e4233f38e375a2ac1cf970af05baeea9d9df40f00151cd20822cee99823f372 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 1 Jul 2021 20:04:56 +0000 Subject: [PATCH 2/3] Rework 4ti2-handle-prefix.patch to follow submission guidelines. Run fdupes to eliminate script copies. OBS-URL: https://build.opensuse.org/package/show/science/4ti2?expand=0&rev=21 --- 4ti2-docdir.diff | 13 ++++------ 4ti2-handle-prefix.patch | 51 +++++++++++++++++++++++++++++++++++----- 4ti2.changes | 8 ++++++- 4ti2.spec | 5 ++-- 4 files changed, 60 insertions(+), 17 deletions(-) diff --git a/4ti2-docdir.diff b/4ti2-docdir.diff index c23a410..6304003 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 index 264cc56..73cdf47 100644 --- a/4ti2-handle-prefix.patch +++ b/4ti2-handle-prefix.patch @@ -1,5 +1,27 @@ ---- a/src/groebner/script.template.in -+++ b/src/groebner/script.template.in +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. @@ -9,8 +31,23 @@ DIR=`dirname "$SCRIPT"` FUNCTION=`basename "$SCRIPT"` ---- a/src/zsolve/graver.template -+++ b/src/zsolve/graver.template +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 @@ -20,8 +57,10 @@ SCRIPTDIR=`dirname "$SCRIPT"` EXECUTABLE=zsolve ---- a/src/zsolve/hilbert.template -+++ b/src/zsolve/hilbert.template +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 diff --git a/4ti2.changes b/4ti2.changes index 1ab5cc7..e317f01 100644 --- a/4ti2.changes +++ b/4ti2.changes @@ -1,7 +1,13 @@ +------------------------------------------------------------------- +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 to handle the downstream 4ti2_ executable prefix in wrapper scripts +- 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 diff --git a/4ti2.spec b/4ti2.spec index f4acb80..b2e6cc7 100644 --- a/4ti2.spec +++ b/4ti2.spec @@ -26,10 +26,10 @@ 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 -# PATCH-FIX-OPENSUSE handle our downstream 4ti2_ executable prefix in the wrapper scripts Patch2: 4ti2-handle-prefix.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 @@ -75,7 +75,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 @@ -87,6 +87,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 From 28f75db5a21db7da1e77557c3f2d50ad492276503ad20d6aee44336d713760de Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 27 Mar 2023 22:40:56 +0000 Subject: [PATCH 3/3] - Add 0001-build-resolve-missing-includes-showing-on-gcc-13.patch OBS-URL: https://build.opensuse.org/package/show/science/4ti2?expand=0&rev=22 --- ...e-missing-includes-showing-on-gcc-13.patch | 27 +++++++++++++++++++ 4ti2.changes | 5 ++++ 4ti2.spec | 3 ++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0001-build-resolve-missing-includes-showing-on-gcc-13.patch 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..eff549d --- /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.changes b/4ti2.changes index e317f01..4a2f770 100644 --- a/4ti2.changes +++ b/4ti2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +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 diff --git a/4ti2.spec b/4ti2.spec index b2e6cc7..b473fde 100644 --- a/4ti2.spec +++ b/4ti2.spec @@ -1,7 +1,7 @@ # # spec file for package 4ti2 # -# Copyright (c) 2021 SUSE LLC +# 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 @@ -27,6 +27,7 @@ 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