From 6511db03c1ea646ee381e052e2f930a82436297b Mon Sep 17 00:00:00 2001 From: Jiri Date: Sat, 2 Mar 2024 20:29:37 +0100 Subject: [PATCH 1/5] Rebuilt for java-21-openjdk as system jdk https://fedoraproject.org/wiki/Changes/Java21 --- swig.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swig.spec b/swig.spec index c7e3b43..f54607f 100644 --- a/swig.spec +++ b/swig.spec @@ -58,7 +58,7 @@ Summary: Connects C/C++/Objective C to some high-level programming languages Name: swig Version: 4.2.1 -Release: 1%{?dist} +Release: 2%{?dist} License: GPL-3.0-or-later AND BSD-3-Clause URL: https://www.swig.org/ Source0: http://downloads.sourceforge.net/project/swig/swig/swig-%{version}/swig-%{version}.tar.gz @@ -352,6 +352,9 @@ install -pm 644 Tools/swig.gdb %{buildroot}%{_datadir}/%{name}/gdb %{_datadir}/%{name}/gdb %changelog +* Sat Mar 02 2024 Jiri Vanek - 4.2.1-2 +- Rebuilt for java-21-openjdk as system jdk + * Mon Feb 26 2024 Jitka Plesnikova - 4.2.1-1 - 4.2.1 bump (rhbz#2265786) From 3d52b3c5d12b5f703b324e592e4772a292b57c8f Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Thu, 7 Mar 2024 17:10:07 +0100 Subject: [PATCH 2/5] Temporary disable java tests (rhbz#2266693) --- ...ng-deprecated-API-in-doxygen-example.patch | 29 +++++ ...stem.runFinalization-removal-warning.patch | 118 ++++++++++++++++++ swig.spec | 8 +- 3 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 swig-java-Avoid-using-deprecated-API-in-doxygen-example.patch create mode 100644 swig-java-Suppress-System.runFinalization-removal-warning.patch diff --git a/swig-java-Avoid-using-deprecated-API-in-doxygen-example.patch b/swig-java-Avoid-using-deprecated-API-in-doxygen-example.patch new file mode 100644 index 0000000..44f449e --- /dev/null +++ b/swig-java-Avoid-using-deprecated-API-in-doxygen-example.patch @@ -0,0 +1,29 @@ +From 8a19cb77adfec168236e2c63d1a9d1a310f886cc Mon Sep 17 00:00:00 2001 +From: Olly Betts +Date: Fri, 1 Mar 2024 10:40:12 +1300 +Subject: [PATCH] [java] Avoid using deprecated API in doxygen example + +Passing a String command to Runtime.exec() has been deprecated since +Java 18. +--- + Examples/java/doxygen/runme.java | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Examples/java/doxygen/runme.java b/Examples/java/doxygen/runme.java +index 6b7bb3d01..5970521c8 100644 +--- a/Examples/java/doxygen/runme.java ++++ b/Examples/java/doxygen/runme.java +@@ -33,8 +33,8 @@ public class runme { + System.out.println(" perimeter = " + shapes[i].perimeter()); + } + +- String command = "javadoc -quiet -public -d javadocs example.java Shape.java Circle.java Square.java RectangleInt.java"; +- System.out.println("\nRunning: " + command); ++ String[] command = {"javadoc", "-quiet", "-public", "-d", "javadocs", "example.java", "Shape.java", "Circle.java", "Square.java", "RectangleInt.java"}; ++ System.out.println("\nRunning: " + String.join(" ", command)); + Process p = Runtime.getRuntime().exec(command); + int exitCode = p.waitFor(); + System.out.println("javadoc exited with code " + exitCode); +-- +2.44.0 + diff --git a/swig-java-Suppress-System.runFinalization-removal-warning.patch b/swig-java-Suppress-System.runFinalization-removal-warning.patch new file mode 100644 index 0000000..2ad135d --- /dev/null +++ b/swig-java-Suppress-System.runFinalization-removal-warning.patch @@ -0,0 +1,118 @@ +From ec56bff28d3ad5acf82e139a83da8135aa2dd618 Mon Sep 17 00:00:00 2001 +From: Olly Betts +Date: Fri, 1 Mar 2024 10:42:22 +1300 +Subject: [PATCH] [java] Suppress System.runFinalization() removal warnings + +These need to be addressed, but meanwhile it makes running the testsuite +with OpenJDK 21 or newer unhelpfully noisy so suppressing it seems more +helpful than not. + +Closes: #2819 +--- + Examples/test-suite/java/cpp11_std_unique_ptr_runme.java | 2 ++ + Examples/test-suite/java/director_pass_by_value_runme.java | 2 ++ + Examples/test-suite/java/java_director_runme.java | 2 ++ + Examples/test-suite/java/li_boost_intrusive_ptr_runme.java | 4 ++++ + Examples/test-suite/java/li_boost_shared_ptr_runme.java | 4 ++++ + Examples/test-suite/java/li_std_auto_ptr_runme.java | 2 ++ + 6 files changed, 16 insertions(+) + +diff --git a/Examples/test-suite/java/cpp11_std_unique_ptr_runme.java b/Examples/test-suite/java/cpp11_std_unique_ptr_runme.java +index f90ef7041..c5622f65f 100644 +--- a/Examples/test-suite/java/cpp11_std_unique_ptr_runme.java ++++ b/Examples/test-suite/java/cpp11_std_unique_ptr_runme.java +@@ -10,6 +10,8 @@ public class cpp11_std_unique_ptr_runme { + } + } + ++ // Suppress warning about System.runFinalization() call. ++ @SuppressWarnings({"deprecation", "removal"}) + private static void WaitForGC() + { + System.gc(); +diff --git a/Examples/test-suite/java/director_pass_by_value_runme.java b/Examples/test-suite/java/director_pass_by_value_runme.java +index 1d34c3b55..48ccabf73 100644 +--- a/Examples/test-suite/java/director_pass_by_value_runme.java ++++ b/Examples/test-suite/java/director_pass_by_value_runme.java +@@ -12,6 +12,8 @@ public class director_pass_by_value_runme { + } + } + ++ // Suppress warning about System.runFinalization() call. ++ @SuppressWarnings({"deprecation", "removal"}) + private static void WaitForGC() { + System.gc(); + System.runFinalization(); +diff --git a/Examples/test-suite/java/java_director_runme.java b/Examples/test-suite/java/java_director_runme.java +index 2167d2621..40829463b 100644 +--- a/Examples/test-suite/java/java_director_runme.java ++++ b/Examples/test-suite/java/java_director_runme.java +@@ -13,6 +13,8 @@ public class java_director_runme { + } + } + ++ // Suppress warning about System.runFinalization() call. ++ @SuppressWarnings({"deprecation", "removal"}) + private static void WaitForGC() + { + System.gc(); +diff --git a/Examples/test-suite/java/li_boost_intrusive_ptr_runme.java b/Examples/test-suite/java/li_boost_intrusive_ptr_runme.java +index 750ec5067..721a78d56 100644 +--- a/Examples/test-suite/java/li_boost_intrusive_ptr_runme.java ++++ b/Examples/test-suite/java/li_boost_intrusive_ptr_runme.java +@@ -13,6 +13,8 @@ public class li_boost_intrusive_ptr_runme { + // Debugging flag + public final static boolean debug = false; + ++ // Suppress warning about System.runFinalization() call. ++ @SuppressWarnings({"deprecation", "removal"}) + private static void WaitForGC() + { + System.gc(); +@@ -23,6 +25,8 @@ public class li_boost_intrusive_ptr_runme { + } + } + ++ // Suppress warning about System.runFinalization() call. ++ @SuppressWarnings({"deprecation", "removal"}) + public static void main(String argv[]) + { + if (debug) +diff --git a/Examples/test-suite/java/li_boost_shared_ptr_runme.java b/Examples/test-suite/java/li_boost_shared_ptr_runme.java +index b513fade7..c1ec7f7bf 100644 +--- a/Examples/test-suite/java/li_boost_shared_ptr_runme.java ++++ b/Examples/test-suite/java/li_boost_shared_ptr_runme.java +@@ -13,6 +13,8 @@ public class li_boost_shared_ptr_runme { + // Debugging flag + public final static boolean debug = false; + ++ // Suppress warning about System.runFinalization() call. ++ @SuppressWarnings({"deprecation", "removal"}) + private static void WaitForGC() + { + System.gc(); +@@ -23,6 +25,8 @@ public class li_boost_shared_ptr_runme { + } + } + ++ // Suppress warning about System.runFinalization() call. ++ @SuppressWarnings({"deprecation", "removal"}) + public static void main(String argv[]) + { + if (debug) +diff --git a/Examples/test-suite/java/li_std_auto_ptr_runme.java b/Examples/test-suite/java/li_std_auto_ptr_runme.java +index 24e353ddc..978a72504 100644 +--- a/Examples/test-suite/java/li_std_auto_ptr_runme.java ++++ b/Examples/test-suite/java/li_std_auto_ptr_runme.java +@@ -10,6 +10,8 @@ public class li_std_auto_ptr_runme { + } + } + ++ // Suppress warning about System.runFinalization() call. ++ @SuppressWarnings({"deprecation", "removal"}) + private static void WaitForGC() + { + System.gc(); +-- +2.44.0 + diff --git a/swig.spec b/swig.spec index f54607f..05b4c4f 100644 --- a/swig.spec +++ b/swig.spec @@ -45,7 +45,9 @@ %ifarch i686 %{!?javalang:%global javalang 0} %else -%{!?javalang:%global javalang 1} +# Temporary disable java tests, because they doesn't pass with java-21-openjdk +# https://github.com/swig/swig/issues/2767 +%{!?javalang:%global javalang 0} %endif # Do not run Go tests, they failed with 4.0.0 on ppc64le, s390 @@ -69,6 +71,9 @@ Source2: description-ccache.h2m Source3: ccache-swig.sh Source4: ccache-swig.csh %endif +# Small fixes for java tests, in upstream after 4.2.1 +Patch0: swig-java-Avoid-using-deprecated-API-in-doxygen-example.patch +Patch1: swig-java-Suppress-System.runFinalization-removal-warning.patch BuildRequires: coreutils BuildRequires: findutils @@ -354,6 +359,7 @@ install -pm 644 Tools/swig.gdb %{buildroot}%{_datadir}/%{name}/gdb %changelog * Sat Mar 02 2024 Jiri Vanek - 4.2.1-2 - Rebuilt for java-21-openjdk as system jdk +- Temporary disable java tests (rhbz#2266693) * Mon Feb 26 2024 Jitka Plesnikova - 4.2.1-1 - 4.2.1 bump (rhbz#2265786) From 859a5f560f6783ef416f0b33729879874a42675b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 12 Apr 2024 09:57:42 +0200 Subject: [PATCH 3/5] disable PHP support on 32-bit --- swig.spec | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/swig.spec b/swig.spec index 05b4c4f..6314cda 100644 --- a/swig.spec +++ b/swig.spec @@ -16,6 +16,12 @@ %global ocamllang 0 %endif +%if 0%{?fedora} >= 41 +%ifarch %{ix86} +%global phplang 0 +%endif +%endif + %{!?tcl:%global tcl 1} %{!?lualang:%global lualang 1} %{!?perllang:%global perllang 1} @@ -60,7 +66,7 @@ Summary: Connects C/C++/Objective C to some high-level programming languages Name: swig Version: 4.2.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-3.0-or-later AND BSD-3-Clause URL: https://www.swig.org/ Source0: http://downloads.sourceforge.net/project/swig/swig/swig-%{version}/swig-%{version}.tar.gz @@ -357,6 +363,10 @@ install -pm 644 Tools/swig.gdb %{buildroot}%{_datadir}/%{name}/gdb %{_datadir}/%{name}/gdb %changelog +* Fri Apr 12 2024 Remi Collet - 4.2.1-3 +- disable PHP support on 32-bit + https://fedoraproject.org/wiki/Changes/php_no_32_bit + * Sat Mar 02 2024 Jiri Vanek - 4.2.1-2 - Rebuilt for java-21-openjdk as system jdk - Temporary disable java tests (rhbz#2266693) From 2510ac580b4ed742d60d4bd7e1155b8acc9c54f5 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Tue, 16 Apr 2024 17:02:40 +0200 Subject: [PATCH 4/5] Disable PHP support on 32-bit --- swig.spec | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/swig.spec b/swig.spec index 6314cda..56d81ed 100644 --- a/swig.spec +++ b/swig.spec @@ -16,18 +16,20 @@ %global ocamllang 0 %endif +%{!?tcl:%global tcl 1} +%{!?lualang:%global lualang 1} +%{!?perllang:%global perllang 1} +%{!?rubylang:%global rubylang 1} +%{!?python3lang:%global python3lang 1} + +# PHP drop support for 32-bit builds since Fedora 41. %if 0%{?fedora} >= 41 %ifarch %{ix86} %global phplang 0 %endif %endif - -%{!?tcl:%global tcl 1} -%{!?lualang:%global lualang 1} -%{!?perllang:%global perllang 1} %{!?phplang:%global phplang 1} -%{!?rubylang:%global rubylang 1} -%{!?python3lang:%global python3lang 1} + # OCaml packages not built on i686 since OCaml 5 / Fedora 39. %ifarch %{ix86} %{!?ocamllang:%global ocamllang 0} @@ -48,7 +50,7 @@ %bcond_without build_ccache_swig %endif -%ifarch i686 +%ifarch %{ix86} %{!?javalang:%global javalang 0} %else # Temporary disable java tests, because they doesn't pass with java-21-openjdk From 45987fab112c6f1f2bd3004c43dc12acd2ca72b2 Mon Sep 17 00:00:00 2001 From: Jitka Plesnikova Date: Mon, 29 Apr 2024 16:41:21 +0200 Subject: [PATCH 5/5] Fix gcc -Wformat-security warning in R Raise function (rhbz#2277767) --- ...t-security-warning-in-R-Raise-functi.patch | 27 +++++++++++++++++++ swig.spec | 8 +++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 swig-R-Fix-gcc-s-Wformat-security-warning-in-R-Raise-functi.patch diff --git a/swig-R-Fix-gcc-s-Wformat-security-warning-in-R-Raise-functi.patch b/swig-R-Fix-gcc-s-Wformat-security-warning-in-R-Raise-functi.patch new file mode 100644 index 0000000..0c0cd61 --- /dev/null +++ b/swig-R-Fix-gcc-s-Wformat-security-warning-in-R-Raise-functi.patch @@ -0,0 +1,27 @@ +From 3d5157514889c668bc14c245246c388eb23615ea Mon Sep 17 00:00:00 2001 +From: pekkarr +Date: Mon, 29 Apr 2024 10:00:38 +0300 +Subject: [PATCH] Fix gcc's -Wformat-security warning in R Raise function + (#2896) + +The `Rf_error` function takes a format string as its first argument. +--- + Lib/r/r.swg | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Lib/r/r.swg b/Lib/r/r.swg +index c1ce37c3e..63b69d8cf 100644 +--- a/Lib/r/r.swg ++++ b/Lib/r/r.swg +@@ -28,7 +28,7 @@ SWIGEXPORT void SWIG_init(void) { + + %runtime %{ + SWIGINTERN void SWIG_R_Raise(SEXP obj, const char *msg) { +- Rf_error(Rf_isString(obj) ? CHAR(Rf_asChar(obj)) : msg); ++ Rf_error("%s", Rf_isString(obj) ? CHAR(Rf_asChar(obj)) : msg); + } + %} + +-- +2.44.0 + diff --git a/swig.spec b/swig.spec index 56d81ed..841c419 100644 --- a/swig.spec +++ b/swig.spec @@ -68,7 +68,7 @@ Summary: Connects C/C++/Objective C to some high-level programming languages Name: swig Version: 4.2.1 -Release: 3%{?dist} +Release: 4%{?dist} License: GPL-3.0-or-later AND BSD-3-Clause URL: https://www.swig.org/ Source0: http://downloads.sourceforge.net/project/swig/swig/swig-%{version}/swig-%{version}.tar.gz @@ -82,6 +82,9 @@ Source4: ccache-swig.csh # Small fixes for java tests, in upstream after 4.2.1 Patch0: swig-java-Avoid-using-deprecated-API-in-doxygen-example.patch Patch1: swig-java-Suppress-System.runFinalization-removal-warning.patch +# Fix gcc's -Wformat-security warning in R Raise function +# https://github.com/swig/swig/pull/2896 +Patch2: swig-R-Fix-gcc-s-Wformat-security-warning-in-R-Raise-functi.patch BuildRequires: coreutils BuildRequires: findutils @@ -365,6 +368,9 @@ install -pm 644 Tools/swig.gdb %{buildroot}%{_datadir}/%{name}/gdb %{_datadir}/%{name}/gdb %changelog +* Mon Apr 29 2024 Jitka Plesnikova - 4.2.1-4 +- Fix gcc's -Wformat-security warning in R Raise function (rhbz#2277767) + * Fri Apr 12 2024 Remi Collet - 4.2.1-3 - disable PHP support on 32-bit https://fedoraproject.org/wiki/Changes/php_no_32_bit