diff --git a/15515f390c5e3316a7faf0cf85d661a297d45a50.patch b/15515f390c5e3316a7faf0cf85d661a297d45a50.patch deleted file mode 100644 index 00a16df..0000000 --- a/15515f390c5e3316a7faf0cf85d661a297d45a50.patch +++ /dev/null @@ -1,328 +0,0 @@ -From 15515f390c5e3316a7faf0cf85d661a297d45a50 Mon Sep 17 00:00:00 2001 -From: Julien Schueller -Date: Tue, 4 Jan 2022 13:50:02 +0100 -Subject: [PATCH] PCRE2 - -Closes #2120 ---- - CMakeLists.txt | 10 ++++----- - Doc/Manual/Preface.html | 6 +++--- - Doc/Manual/Windows.html | 22 ++++++++++++-------- - Source/Swig/misc.c | 41 ++++++++++++++++++++++++------------- - Source/Swig/naming.c | 22 ++++++++++++-------- - Tools/cmake/FindPCRE.cmake | 37 --------------------------------- - Tools/cmake/FindPCRE2.cmake | 21 +++++++++++++++++++ - Tools/mkwindows.sh | 2 +- - Tools/nuget-install.cmd | 28 ------------------------- - Tools/pcre-build.sh | 4 ++-- - appveyor.yml | 15 ++++++++------ - configure.ac | 19 +++++++++-------- - 12 files changed, 106 insertions(+), 121 deletions(-) - delete mode 100644 Tools/cmake/FindPCRE.cmake - create mode 100644 Tools/cmake/FindPCRE2.cmake - delete mode 100644 Tools/nuget-install.cmd - -Index: swig-4.0.2/Doc/Manual/Preface.html -=================================================================== ---- swig-4.0.2.orig/Doc/Manual/Preface.html -+++ swig-4.0.2/Doc/Manual/Preface.html -@@ -283,9 +283,9 @@ You must use PCRE - needs to be installed on your system to build SWIG, in particular --pcre-config must be available. If you have PCRE headers and libraries but not --pcre-config itself or, alternatively, wish to override the compiler or linker --flags returned by pcre-config, you may set PCRE_LIBS and PCRE_CFLAGS variables -+pcre2-config must be available. If you have PCRE headers and libraries but not -+pcre2-config itself or, alternatively, wish to override the compiler or linker -+flags returned by pcre-config, you may set PCRE2_LIBS and PCRE2_CFLAGS variables - to be used instead. And if you don't have PCRE at all, the configure script - will provide instructions for obtaining it. -

-Index: swig-4.0.2/Doc/Manual/Windows.html -=================================================================== ---- swig-4.0.2.orig/Doc/Manual/Windows.html -+++ swig-4.0.2/Doc/Manual/Windows.html -@@ -320,7 +320,7 @@ the autotools will fail miserably on tho - -
  • - The PCRE third party library needs to be built next. --Download the latest PCRE source tarball, such as pcre-8.10.tar.bz2, from -+Download the latest PCRE source tarball, such as pcre2-10.39.tar.bz2, from - PCRE and place in the /usr/src/swig directory. - Build PCRE as a static library using the Tools/pcre-build.sh script as follows: - -Index: swig-4.0.2/Source/Swig/misc.c -=================================================================== ---- swig-4.0.2.orig/Source/Swig/misc.c -+++ swig-4.0.2/Source/Swig/misc.c -@@ -1312,7 +1312,8 @@ void Swig_offset_string(String *s, int n - - - #ifdef HAVE_PCRE --#include -+#define PCRE2_CODE_UNIT_WIDTH 8 -+#include - - static int split_regex_pattern_subst(String *s, String **pattern, String **subst, const char **input) - { -@@ -1375,7 +1376,7 @@ static void copy_with_maybe_case_convers - } - } - --String *replace_captures(int num_captures, const char *input, String *subst, int captures[], String *pattern, String *s) -+String *replace_captures(int num_captures, const char *input, String *subst, size_t captures[], String *pattern, String *s) - { - int convertCase = 0, convertNextOnly = 0; - String *result = NewStringEmpty(); -@@ -1397,7 +1398,7 @@ String *replace_captures(int num_capture - } else if (isdigit((unsigned char)*p)) { - int group = *p++ - '0'; - if (group < num_captures) { -- int l = captures[group*2], r = captures[group*2 + 1]; -+ int l = (int)captures[group*2], r = (int)captures[group*2 + 1]; - if (l != -1) { - copy_with_maybe_case_conversion(result, input + l, r - l, &convertCase, convertNextOnly); - } -@@ -1449,26 +1450,31 @@ String *Swig_string_regex(String *s) { - const int pcre_options = 0; - - String *res = 0; -- pcre *compiled_pat = 0; -- const char *pcre_error, *input; -- int pcre_errorpos; -+ pcre2_code *compiled_pat = 0; -+ const char *input; -+ PCRE2_UCHAR pcre_error[256]; -+ int pcre_errornum; -+ size_t pcre_errorpos; - String *pattern = 0, *subst = 0; -- int captures[30]; -- -+ size_t *captures = 0; -+ pcre2_match_data *match_data = 0; - if (split_regex_pattern_subst(s, &pattern, &subst, &input)) { - int rc; - -- compiled_pat = pcre_compile( -- Char(pattern), pcre_options, &pcre_error, &pcre_errorpos, NULL); -+ compiled_pat = pcre2_compile( -+ (PCRE2_SPTR8)Char(pattern), PCRE2_ZERO_TERMINATED, pcre_options, &pcre_errornum, &pcre_errorpos, NULL); - if (!compiled_pat) { -+ pcre2_get_error_message (pcre_errornum, pcre_error, sizeof pcre_error); - Swig_error("SWIG", Getline(s), "PCRE compilation failed: '%s' in '%s':%i.\n", - pcre_error, Char(pattern), pcre_errorpos); - SWIG_exit(EXIT_FAILURE); - } -- rc = pcre_exec(compiled_pat, NULL, input, (int)strlen(input), 0, 0, captures, 30); -+ match_data = pcre2_match_data_create_from_pattern (compiled_pat, NULL); -+ rc = pcre2_match(compiled_pat, (PCRE2_SPTR8)input, PCRE2_ZERO_TERMINATED, 0, 0, match_data, NULL); -+ captures = pcre2_get_ovector_pointer (match_data); - if (rc >= 0) { - res = replace_captures(rc, input, subst, captures, pattern, s); -- } else if (rc != PCRE_ERROR_NOMATCH) { -+ } else if (rc != PCRE2_ERROR_NOMATCH) { - Swig_error("SWIG", Getline(s), "PCRE execution failed: error %d while matching \"%s\" using \"%s\".\n", - rc, Char(pattern), input); - SWIG_exit(EXIT_FAILURE); -@@ -1477,12 +1483,19 @@ String *Swig_string_regex(String *s) { - - DohDelete(pattern); - DohDelete(subst); -- pcre_free(compiled_pat); -+ pcre2_code_free(compiled_pat); -+ pcre2_match_data_free(match_data); - return res ? res : NewStringEmpty(); - } - - String *Swig_pcre_version(void) { -- return NewStringf("PCRE Version: %s", pcre_version()); -+ int len = pcre2_config(PCRE2_CONFIG_VERSION, NULL); -+ char *buf = malloc(len); -+ String *result; -+ pcre2_config(PCRE2_CONFIG_VERSION, buf); -+ result = NewStringf("PCRE Version: %s", buf); -+ free(buf); -+ return result; - } - - #else -Index: swig-4.0.2/Source/Swig/naming.c -=================================================================== ---- swig-4.0.2.orig/Source/Swig/naming.c -+++ swig-4.0.2/Source/Swig/naming.c -@@ -1092,26 +1092,32 @@ static DOH *get_lattr(Node *n, List *lat - } - - #ifdef HAVE_PCRE --#include -+#define PCRE2_CODE_UNIT_WIDTH 8 -+#include - - static int name_regexmatch_value(Node *n, String *pattern, String *s) { -- pcre *compiled_pat; -- const char *err; -- int errpos; -+ pcre2_code *compiled_pat; -+ PCRE2_UCHAR err[256]; -+ int errornum; -+ size_t errpos; - int rc; - -- compiled_pat = pcre_compile(Char(pattern), 0, &err, &errpos, NULL); -+ compiled_pat = pcre2_compile((PCRE2_SPTR8)Char(pattern), PCRE2_ZERO_TERMINATED, 0, &errornum, &errpos, NULL); - if (!compiled_pat) { -+ pcre2_get_error_message (errornum, err, sizeof err); - Swig_error("SWIG", Getline(n), - "Invalid regex \"%s\": compilation failed at %d: %s\n", - Char(pattern), errpos, err); - SWIG_exit(EXIT_FAILURE); - } - -- rc = pcre_exec(compiled_pat, NULL, Char(s), Len(s), 0, 0, NULL, 0); -- pcre_free(compiled_pat); -+ pcre2_match_data *match_data = 0; -+ match_data = pcre2_match_data_create_from_pattern (compiled_pat, NULL); -+ rc = pcre2_match(compiled_pat, (PCRE2_SPTR8)Char(s), PCRE2_ZERO_TERMINATED, 0, 0, match_data, 0); -+ pcre2_code_free(compiled_pat); -+ pcre2_match_data_free(match_data); - -- if (rc == PCRE_ERROR_NOMATCH) -+ if (rc == PCRE2_ERROR_NOMATCH) - return 0; - - if (rc < 0 ) { -Index: swig-4.0.2/Tools/cmake/FindPCRE2.cmake -=================================================================== ---- /dev/null -+++ swig-4.0.2/Tools/cmake/FindPCRE2.cmake -@@ -0,0 +1,21 @@ -+# - Find PCRE2 -+# Perl Compatible Regular Expressions -+# https://www.pcre.org/ -+ -+# The following variables are set: -+# PCRE2_FOUND - System has the PCRE library -+# PCRE2_LIBRARIES - The PCRE library file -+# PCRE2_INCLUDE_DIRS - The folder with the PCRE headers -+ -+find_library(PCRE2_LIBRARY NAMES pcre2 pcre2-8) -+find_path(PCRE2_INCLUDE_DIR pcre2.h) -+ -+set (PCRE2_LIBRARIES ${PCRE2_LIBRARY}) -+set (PCRE2_INCLUDE_DIRS ${PCRE2_INCLUDE_DIR}) -+ -+include(FindPackageHandleStandardArgs) -+find_package_handle_standard_args(PCRE2 DEFAULT_MSG PCRE2_LIBRARIES PCRE2_INCLUDE_DIRS) -+ -+mark_as_advanced ( -+ PCRE2_LIBRARY -+ PCRE2_INCLUDE_DIR) -Index: swig-4.0.2/Tools/mkwindows.sh -=================================================================== ---- swig-4.0.2.orig/Tools/mkwindows.sh -+++ swig-4.0.2/Tools/mkwindows.sh -@@ -84,7 +84,7 @@ export CXXFLAGS="$compileflags" - swigbasename=swig-$version - swigwinbasename=swigwin-$version - tarball=$swigbasename.tar.gz --pcre_tarball=`ls pcre-*.tar.*` -+pcre_tarball=`ls pcre2-*.tar.*` - - if ! test -f "$pcre_tarball"; then - echo "Could not find PCRE tarball. Please download a PCRE source tarball from http://www.pcre.org" -Index: swig-4.0.2/Tools/nuget-install.cmd -=================================================================== ---- swig-4.0.2.orig/Tools/nuget-install.cmd -+++ /dev/null -@@ -1,28 +0,0 @@ --rem Workaround 'nuget install' not being reliable by retrying a few times --@echo off --rem initiate the retry number --set errorCode=1 --set retryNumber=0 --set maxRetries=5 -- --:RESTORE --nuget install %* -- --rem problem? --IF ERRORLEVEL %errorCode% GOTO :RETRY -- --rem everything is fine! --@echo Installed nuget, retries: %reTryNumber% --GOTO :EXIT -- --:RETRY --@echo Oops, nuget restore exited with code %errorCode% - let us try again! --set /a retryNumber=%retryNumber%+1 --IF %reTryNumber% LSS %maxRetries% (GOTO :RESTORE) --IF %retryNumber% EQU %maxRetries% (GOTO :ERR) -- --:ERR --@echo Sorry, we tried restoring nuget packages for %maxRetries% times and all attempts were unsuccessful! --EXIT /B 1 -- --:EXIT -Index: swig-4.0.2/Tools/pcre-build.sh -=================================================================== ---- swig-4.0.2.orig/Tools/pcre-build.sh -+++ swig-4.0.2/Tools/pcre-build.sh -@@ -37,8 +37,8 @@ fi - - echo "Looking for PCRE tarball..." - rm -rf pcre --pcre_tarball=`ls pcre-*.tar*` --test -n "$pcre_tarball" || bail "Could not find tarball matching pattern: pcre-*.tar*" -+pcre_tarball=`ls pcre2-*.tar*` -+test -n "$pcre_tarball" || bail "Could not find tarball matching pattern: pcre2-*.tar*" - test -f "$pcre_tarball" || bail "Could not find a single PCRE tarball. Found: $pcre_tarball" - - echo "Extracting tarball: $pcre_tarball" -Index: swig-4.0.2/configure.ac -=================================================================== ---- swig-4.0.2.orig/configure.ac -+++ swig-4.0.2/configure.ac -@@ -54,24 +54,24 @@ dnl To make configuring easier, check fo - if test x"${with_pcre}" = xyes ; then - AC_MSG_CHECKING([whether to use local PCRE]) - local_pcre_config=no -- if test -z $PCRE_CONFIG; then -- if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then -- PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config -- local_pcre_config=$PCRE_CONFIG -+ if test -z $PCRE2_CONFIG; then -+ if test -f `pwd`/pcre/pcre-swig-install/bin/pcre2-config; then -+ PCRE2_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre2-config -+ local_pcre_config=$PCRE2_CONFIG - fi - fi - AC_MSG_RESULT([$local_pcre_config]) - fi - AS_IF([test "x$with_pcre" != xno], -- [AX_PATH_GENERIC([pcre], -+ [AX_PATH_GENERIC([pcre2], - [], dnl Minimal version of PCRE we need -- accept any - [], dnl custom sed script for version parsing is not needed - [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library]) -- LIBS="$LIBS $PCRE_LIBS" -- CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" -+ LIBS="$LIBS $PCRE2_LIBS" -+ CPPFLAGS="$CPPFLAGS $PCRE2_CFLAGS" - ], - [AC_MSG_FAILURE([ -- Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions) -+ Cannot find pcre2-config script from PCRE (Perl Compatible Regular Expressions) - library package. This dependency is needed for configure to complete, - Either: - - Install the PCRE developer package on your system (preferred approach). -@@ -82,7 +82,8 @@ AS_IF([test "x$with_pcre" != xno], - (quite easy and does not require privileges to install PCRE on your system) - - Use configure --without-pcre to disable regular expressions support in SWIG - (not recommended).]) -- ]) -+ ], -+ [],[],[--libs8]) - ]) - - diff --git a/_service b/_service new file mode 100644 index 0000000..952d5e7 --- /dev/null +++ b/_service @@ -0,0 +1,18 @@ + + + https://github.com/swig/swig.git + git + .git + @PARENT_TAG@ + v(.*) + v4.1.0 + enable + + + swig-*.tar + gz + + + swig + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..d9869a4 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/swig/swig.git + 1e99e4fe37c0f2334b6de1c6bc3fcd3188bc2c92 \ No newline at end of file diff --git a/fix-gcc12-error.patch b/fix-gcc12-error.patch deleted file mode 100644 index a170694..0000000 --- a/fix-gcc12-error.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 76d5a9ec270a763c892ae28070e391cf99e0b7cd Mon Sep 17 00:00:00 2001 -From: William S Fulton -Date: Tue, 18 Jan 2022 21:37:02 +0000 -Subject: [PATCH] gcc-12 warning fix in test-case - -Closes #2145 ---- - Examples/test-suite/nested_class.i | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Examples/test-suite/nested_class.i b/Examples/test-suite/nested_class.i -index b10c339493e..c778a12cf7c 100644 ---- a/Examples/test-suite/nested_class.i -+++ b/Examples/test-suite/nested_class.i -@@ -201,7 +201,7 @@ struct Outer { - Integer xx; - } MultipleInstanceAnonDerived1, MultipleInstanceAnonDerived2, *MultipleInstanceAnonDerived3, MultipleInstanceAnonDerived4[2]; - --#if defined(__GNUC__) || defined(_MSC_VER) || defined(SWIG) -+#if (defined(__GNUC__) && __GNUC__ < 12) || defined(_MSC_VER) || defined(SWIG) - /* some compilers do not accept these */ - struct : public InnerMultiple { - Integer xx; diff --git a/swig-4.0.2.tar.gz b/swig-4.0.2.tar.gz deleted file mode 100644 index 0505c79..0000000 --- a/swig-4.0.2.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d53be9730d8d58a16bf0cbd1f8ac0c0c3e1090573168bfa151b01eb47fa906fc -size 8097014 diff --git a/swig-Define-PY_SSIZE_T_CLEAN-macro.patch b/swig-Define-PY_SSIZE_T_CLEAN-macro.patch deleted file mode 100644 index cf91135..0000000 --- a/swig-Define-PY_SSIZE_T_CLEAN-macro.patch +++ /dev/null @@ -1,62 +0,0 @@ -From abc8e0bb277f7a54ff4ee209845dde910d267819 Mon Sep 17 00:00:00 2001 -From: William S Fulton -Date: Fri, 27 May 2022 18:58:04 +0100 -Subject: [PATCH] Define PY_SSIZE_T_CLEAN macro - -before #include "Python.h" as recommended in Python 3.7 and later. - -Issue #2277 ---- - CHANGES.current | 11 +++++++++++ - Lib/python/embed.i | 2 +- - Lib/python/pyruntime.swg | 2 +- - 3 files changed, 13 insertions(+), 2 deletions(-) - -Index: swig-4.0.2/CHANGES.current -=================================================================== ---- swig-4.0.2.orig/CHANGES.current -+++ swig-4.0.2/CHANGES.current -@@ -7,6 +7,17 @@ the issue number to the end of the URL: - Version 4.0.2 (8 Jun 2020) - ========================== - -+2022-05-27: xypron -+ [Python] #2277 Define PY_SSIZE_T_CLEAN macro before #include "Python.h" as -+ recommended in Python 3.7 and later. -+ -+ To avoid this macro definition, add the following to your interface file so -+ that SWIG_NO_PY_SSIZE_T_CLEAN is defined at the beginning of the C++ wrappers: -+ -+ %begin %{ -+ #define SWIG_NO_PY_SSIZE_T_CLEAN -+ %} -+ - 2020-06-07 vigsterkr - [Ruby] #1717 Nil fix mangling strings - -Index: swig-4.0.2/Lib/python/embed.i -=================================================================== ---- swig-4.0.2.orig/Lib/python/embed.i -+++ swig-4.0.2/Lib/python/embed.i -@@ -29,7 +29,7 @@ As far as I know, this module is C++ saf - #endif - - %wrapper %{ --#ifndef PY_SSIZE_T_CLEAN -+#ifndef SWIG_NO_PY_SSIZE_T_CLEAN - #define PY_SSIZE_T_CLEAN - #endif - #include -Index: swig-4.0.2/Lib/python/pyruntime.swg -=================================================================== ---- swig-4.0.2.orig/Lib/python/pyruntime.swg -+++ swig-4.0.2/Lib/python/pyruntime.swg -@@ -4,7 +4,7 @@ - # include - #endif - --#ifndef PY_SSIZE_T_CLEAN -+#ifndef SWIG_NO_PY_SSIZE_T_CLEAN - #define PY_SSIZE_T_CLEAN - #endif - #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) diff --git a/swig-Define-PY_SSIZE_T_CLEAN-only-when-not-defined-yet.patch b/swig-Define-PY_SSIZE_T_CLEAN-only-when-not-defined-yet.patch deleted file mode 100644 index 5709738..0000000 --- a/swig-Define-PY_SSIZE_T_CLEAN-only-when-not-defined-yet.patch +++ /dev/null @@ -1,44 +0,0 @@ -From c3f17b415dc63906218306135da49bf1f941588f Mon Sep 17 00:00:00 2001 -From: Michal Suchanek -Date: Thu, 13 Oct 2022 23:25:52 +0200 -Subject: [PATCH] Define PY_SSIZE_T_CLEAN only when not defined yet - -Users of swig 4.0.2 and python 3.10 will likely define the -PY_SSIZE_T_CLEAN macro by hand when relevant because their bindings -won't build otherwise. - -Unconditionally defining PY_SSIZE_T_CLEAN in swig 4.10 will lead to -macro redefinition warning. - -Signed-off-by: Michal Suchanek ---- - Lib/python/embed.i | 2 +- - Lib/python/pyruntime.swg | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -Index: swig-4.0.2/Lib/python/embed.i -=================================================================== ---- swig-4.0.2.orig/Lib/python/embed.i -+++ swig-4.0.2/Lib/python/embed.i -@@ -29,7 +29,7 @@ As far as I know, this module is C++ saf - #endif - - %wrapper %{ --#ifndef SWIG_NO_PY_SSIZE_T_CLEAN -+#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) - #define PY_SSIZE_T_CLEAN - #endif - #include -Index: swig-4.0.2/Lib/python/pyruntime.swg -=================================================================== ---- swig-4.0.2.orig/Lib/python/pyruntime.swg -+++ swig-4.0.2/Lib/python/pyruntime.swg -@@ -4,7 +4,7 @@ - # include - #endif - --#ifndef SWIG_NO_PY_SSIZE_T_CLEAN -+#if !defined(PY_SSIZE_T_CLEAN) && !defined(SWIG_NO_PY_SSIZE_T_CLEAN) - #define PY_SSIZE_T_CLEAN - #endif - #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) diff --git a/swig-Python-define-PY_SSIZE_T_CLEAN.patch b/swig-Python-define-PY_SSIZE_T_CLEAN.patch deleted file mode 100644 index 2579283..0000000 --- a/swig-Python-define-PY_SSIZE_T_CLEAN.patch +++ /dev/null @@ -1,47 +0,0 @@ -From ca6a73277b7f48ce4cf9d30d7bff7813f3685684 Mon Sep 17 00:00:00 2001 -From: Heinrich Schuchardt -Date: Mon, 9 May 2022 19:53:20 +0200 -Subject: [PATCH] Python: define PY_SSIZE_T_CLEAN - -It is recommended to always define PY_SSIZE_T_CLEAN before including -Python.h. Cf. https://docs.python.org/3/c-api/intro.html - -This avoids errors like: - - SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats - -Signed-off-by: Heinrich Schuchardt ---- - Lib/python/embed.i | 4 +++- - Lib/python/pyruntime.swg | 3 +++ - 2 files changed, 6 insertions(+), 1 deletion(-) - -Index: swig-4.0.2/Lib/python/embed.i -=================================================================== ---- swig-4.0.2.orig/Lib/python/embed.i -+++ swig-4.0.2/Lib/python/embed.i -@@ -29,7 +29,9 @@ As far as I know, this module is C++ saf - #endif - - %wrapper %{ -- -+#ifndef PY_SSIZE_T_CLEAN -+#define PY_SSIZE_T_CLEAN -+#endif - #include - - #ifdef __cplusplus -Index: swig-4.0.2/Lib/python/pyruntime.swg -=================================================================== ---- swig-4.0.2.orig/Lib/python/pyruntime.swg -+++ swig-4.0.2/Lib/python/pyruntime.swg -@@ -4,6 +4,9 @@ - # include - #endif - -+#ifndef PY_SSIZE_T_CLEAN -+#define PY_SSIZE_T_CLEAN -+#endif - #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) - /* Use debug wrappers with the Python release dll */ - # undef _DEBUG diff --git a/swig-octave-6.patch b/swig-octave-6.patch deleted file mode 100644 index 4e6d9ce..0000000 --- a/swig-octave-6.patch +++ /dev/null @@ -1,347 +0,0 @@ -From 582e3a3fee8a7cfe5903da1c4b0db8e40d5d2deb Mon Sep 17 00:00:00 2001 -From: Robert Fries -Date: Wed, 12 May 2021 19:44:17 -0400 -Subject: [PATCH 2/5] Allow swig wrapped modules to compile with -Bsymbolic - ---- - Lib/octave/octrun.swg | 8 ++++++++ - Lib/octave/octruntime.swg | 2 ++ - 2 files changed, 10 insertions(+) - -diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg -index 1069e0e54b7..a7291df1478 100644 ---- a/Lib/octave/octrun.swg -+++ b/Lib/octave/octrun.swg -@@ -1178,6 +1178,10 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - #endif - { return ptr->print(os, pr_as_read_syntax); } - -+#if SWIG_OCTAVE_PREREQ(4,4,0) -+ static void set_type_id(int type_id) { t_id=type_id; } -+#endif -+ - virtual type_conv_info numeric_conversion_function(void) const { - return octave_base_value::type_conv_info (default_numeric_conversion_function, - octave_scalar::static_type_id ()); -@@ -1285,6 +1289,10 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - # endif - #endif - -+#if SWIG_OCTAVE_PREREQ(4,4,0) -+ static void set_type_id(int type_id) { t_id=type_id; } -+#endif -+ - private: - #if !SWIG_OCTAVE_PREREQ(4,0,0) - DECLARE_OCTAVE_ALLOCATOR; -diff --git a/Lib/octave/octruntime.swg b/Lib/octave/octruntime.swg -index a397fb7c189..ca69e44c48f 100644 ---- a/Lib/octave/octruntime.swg -+++ b/Lib/octave/octruntime.swg -@@ -295,9 +295,11 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { - for (int i = 0; i < types.numel(); ++i) { - if (types(i) == octave_swig_ref::static_type_name()) { - register_octave_swig_ref = false; -+ octave_swig_ref::set_type_id(i); - } - if (types(i) == octave_swig_packed::static_type_name()) { - register_octave_swig_packed = false; -+ octave_swig_packed::set_type_id(i); - } - } - if (register_octave_swig_ref) { - -From 2536f07ec26a06adb4290747cd229928b569ed72 Mon Sep 17 00:00:00 2001 -From: Robert Fries -Date: Wed, 12 May 2021 19:45:24 -0400 -Subject: [PATCH 3/5] Octave module lets examples and tests work with Octave-6 - * Try-catch replacement for check of error_state * Add execute method in - addition to call * Replace oct_mach_info with octave::mach_info * Call - from interpreter: global_varval global_assign * Assign a global name - requires locating the stack which requires interpreter to tree evaluator - to callStack * Do not use discard_error_messages or - discard_warning_messages - ---- - Lib/octave/octcontainer.swg | 11 +++++- - Lib/octave/octrun.swg | 69 ++++++++++++++++++++++++++++++++++--- - Lib/octave/octruntime.swg | 12 +++++-- - 3 files changed, 83 insertions(+), 9 deletions(-) - -diff --git a/Lib/octave/octcontainer.swg b/Lib/octave/octcontainer.swg -index 80d593f4fd5..85954acb031 100644 ---- a/Lib/octave/octcontainer.swg -+++ b/Lib/octave/octcontainer.swg -@@ -569,8 +569,17 @@ namespace swig { - } else { - return octseq.check() ? SWIG_OK : SWIG_ERROR; - } -- } catch (std::exception& e) { -+ } -+%#if SWIG_OCTAVE_PREREQ(6,0,0) -+ catch (octave::execution_exception& exec) { -+ } -+%#endif -+ catch (std::exception& e) { -+%#if SWIG_OCTAVE_PREREQ(6,0,0) -+ if (seq) // Know that octave is not in an error state -+%#else - if (seq&&!error_state) -+%#endif - error("swig type error: %s",e.what()); - return SWIG_ERROR; - } -diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg -index a7291df1478..68bdeea0993 100644 ---- a/Lib/octave/octrun.swg -+++ b/Lib/octave/octrun.swg -@@ -171,7 +171,16 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - - octave_function* function_value(bool = false) { return this; } - -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave_value_list call(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -+ return execute(tw,nargout,args); -+ } -+#endif -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave_value_list execute(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -+#else - octave_value_list call(octave::tree_evaluator& tw, int nargout = 0, const octave_value_list& args = octave_value_list()) { -+#endif - octave_value_list all_args; - all_args.append(first_args); - all_args.append(args); -@@ -456,10 +465,20 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - // Fill in dim_vector - for (int k=0;k a; -+ try { -+ a = out.int_vector_value(); -+ } -+ catch (octave::execution_exception& oee) { -+ return dim_vector(1,1); -+ } -+#else - Array a = out.int_vector_value(); - if (error_state) return dim_vector(1,1); -+#endif - dim_vector d; - d.resize(a.numel() < 2 ? 2 : a.numel()); - d(0) = d(1) = 1; -@@ -874,7 +903,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - } - - virtual bool load_binary (std::istream& is, bool swap, -- oct_mach_info::float_format fmt) { -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave::mach_info::float_format fmt) { -+#else -+ oct_mach_info::float_format fmt) { -+#endif - return true; - } - -@@ -1142,7 +1175,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - { return ptr->save_binary(os, save_as_floats); } - - virtual bool load_binary (std::istream& is, bool swap, -- oct_mach_info::float_format fmt) -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave::mach_info::float_format fmt) -+#else -+ oct_mach_info::float_format fmt) -+#endif - { return ptr->load_binary(is, swap, fmt); } - - #if defined (HAVE_HDF5) -@@ -1261,7 +1298,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - } - - virtual bool load_binary (std::istream& is, bool swap, -- oct_mach_info::float_format fmt) { -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave::mach_info::float_format fmt) { -+#else -+ oct_mach_info::float_format fmt) { -+#endif - return true; - } - -@@ -1515,16 +1556,24 @@ SWIGRUNTIMEINLINE void SWIG_Octave_SetConstant(octave_swig_type *module_ns, cons - } - - SWIGRUNTIMEINLINE octave_value SWIG_Octave_GetGlobalValue(std::string name) { -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave::interpreter *interp = octave::interpreter::the_interpreter (); -+ return interp->global_varval(name); -+#else - #if SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - return symtab.global_varval(name); - #else - return get_global_value(name, true); - #endif -+#endif - } - - SWIGRUNTIME void SWIG_Octave_SetGlobalValue(std::string name, const octave_value& value) { --#if SWIG_OCTAVE_PREREQ(4,4,0) -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave::interpreter *interp = octave::interpreter::the_interpreter (); -+ interp->global_assign(name, value); -+#elif SWIG_OCTAVE_PREREQ(4,4,0) - octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - symtab.global_assign(name, value); - #else -@@ -1534,10 +1583,20 @@ SWIGRUNTIME void SWIG_Octave_SetGlobalValue(std::string name, const octave_value - - SWIGRUNTIME void SWIG_Octave_LinkGlobalValue(std::string name) { - #if SWIG_OCTAVE_PREREQ(4,4,0) -- octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - octave::symbol_scope symscope = octave::interpreter::the_interpreter()->get_current_scope(); -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave::interpreter *interp = octave::interpreter::the_interpreter (); -+ interp->assign(name, interp->global_varval(name)); -+ octave::tree_evaluator& tree_eval = interp->get_evaluator(); -+ octave::call_stack& callStack = tree_eval.get_call_stack(); -+ std::shared_ptr stackFrame = callStack.get_current_stack_frame(); -+ octave::symbol_record sym=symscope.lookup_symbol(name); -+ stackFrame->mark_global(sym); -+#else -+ octave::symbol_table& symtab = octave::interpreter::the_interpreter()->get_symbol_table(); - symscope.assign(name, symtab.global_varval(name)); - symscope.mark_global(name); -+#endif - #else - #if !SWIG_OCTAVE_PREREQ(3,2,0) - link_to_global_variable(curr_sym_tab->lookup(name, true)); -diff --git a/Lib/octave/octruntime.swg b/Lib/octave/octruntime.swg -index ca69e44c48f..e76151f146b 100644 ---- a/Lib/octave/octruntime.swg -+++ b/Lib/octave/octruntime.swg -@@ -19,7 +19,8 @@ static bool SWIG_init_user(octave_swig_type* module_ns); - SWIGINTERN bool SWIG_Octave_LoadModule(std::string name) { - bool retn = false; - { --#if SWIG_OCTAVE_PREREQ(4,2,0) -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+#elif SWIG_OCTAVE_PREREQ(4,2,0) - octave::unwind_protect frame; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -@@ -62,7 +63,8 @@ SWIGINTERN bool SWIG_Octave_LoadModule(std::string name) { - SWIGINTERN bool SWIG_Octave_InstallFunction(octave_function *octloadfcn, std::string name) { - bool retn = false; - { --#if SWIG_OCTAVE_PREREQ(4,2,0) -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+#elif SWIG_OCTAVE_PREREQ(4,2,0) - octave::unwind_protect frame; - frame.protect_var(discard_error_messages); discard_error_messages = true; - frame.protect_var(discard_warning_messages); discard_warning_messages = true; -@@ -316,7 +318,11 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) { - SWIG_InitializeModule(0); - SWIG_PropagateClientData(); - --#if SWIG_OCTAVE_PREREQ(4,4,0) -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ octave::tree_evaluator& tree_eval = octave::interpreter::the_interpreter()->get_evaluator(); -+ octave::call_stack& stack = tree_eval.get_call_stack(); -+ octave_function *me = stack.current_function(); -+#elif SWIG_OCTAVE_PREREQ(4,4,0) - octave::call_stack& stack = octave::interpreter::the_interpreter()->get_call_stack(); - octave_function *me = stack.current(); - #else - -From 0bf0d58c52e477cae99986b7c7a656c09d50aa43 Mon Sep 17 00:00:00 2001 -From: Robert Fries -Date: Wed, 12 May 2021 20:22:30 -0400 -Subject: [PATCH 4/5] Additional changes due to name changes in octave-6 * - is_map to isstruct, is_object to isobject - ---- - Lib/octave/octrun.swg | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - -diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg -index 68bdeea0993..e95f9e9de6b 100644 ---- a/Lib/octave/octrun.swg -+++ b/Lib/octave/octrun.swg -@@ -660,7 +660,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - return true; - } - -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ virtual bool isstruct() const { -+#else - virtual bool is_map() const { -+#endif - return true; - } - -@@ -808,7 +812,11 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - return as_value(); - } - -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ virtual bool isobject() const { -+#else - virtual bool is_object() const { -+#endif - return true; - } - -@@ -1117,8 +1125,13 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - bool is_defined() const - { return ptr->is_defined(); } - -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ virtual bool isstruct() const -+ { return ptr->isstruct(); } -+#else - virtual bool is_map() const - { return ptr->is_map(); } -+#endif - - virtual octave_value subsref(const std::string &ops, const std::list < octave_value_list > &idx) - { return ptr->subsref(ops, idx); } -@@ -1129,8 +1142,13 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); - octave_value subsasgn(const std::string &ops, const std::list < octave_value_list > &idx, const octave_value &rhs) - { return ptr->subsasgn(ops, idx, rhs); } - -+#if SWIG_OCTAVE_PREREQ(6,0,0) -+ virtual bool isobject() const -+ { return ptr->isobject(); } -+#else - virtual bool is_object() const - { return ptr->is_object(); } -+#endif - - virtual bool is_string() const - { return ptr->is_string(); } - - diff --git a/swig-python310.patch b/swig-python310.patch deleted file mode 100644 index aeedc43..0000000 --- a/swig-python310.patch +++ /dev/null @@ -1,23 +0,0 @@ -From a2850397ba3eec5d4c58304cf8277ca535919760 Mon Sep 17 00:00:00 2001 -From: Julien Schueller -Date: Thu, 5 Aug 2021 14:05:10 +0200 -Subject: [PATCH] [Python] Fix overload_simple_cast test with 3.10 - -Closes #2044 ---- - Examples/test-suite/python/python_overload_simple_cast_runme.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Examples/test-suite/python/python_overload_simple_cast_runme.py b/Examples/test-suite/python/python_overload_simple_cast_runme.py -index fc398ab29b9..7a0174af8a2 100644 ---- a/Examples/test-suite/python/python_overload_simple_cast_runme.py -+++ b/Examples/test-suite/python/python_overload_simple_cast_runme.py -@@ -9,6 +9,8 @@ def __init__(self, x): - def __int__(self): - return self.x - -+ def __index__(self): -+ return self.x - - class Ad: - diff --git a/swig.changes b/swig.changes index cc62787..691b13b 100644 --- a/swig.changes +++ b/swig.changes @@ -1,11 +1,65 @@ ------------------------------------------------------------------- -Thu Oct 13 17:47:25 UTC 2022 - Michal Suchanek +Wed Nov 2 10:54:51 UTC 2022 - Klaus Kämpf -- Fix SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats - with python 3.10 gh#swig/swig#2277 - + swig-Python-define-PY_SSIZE_T_CLEAN.patch - + swig-Define-PY_SSIZE_T_CLEAN-macro.patch - + swig-Define-PY_SSIZE_T_CLEAN-only-when-not-defined-yet.patch +- adapt source name to please build service + +------------------------------------------------------------------- +Tue Oct 25 07:44:08 UTC 2022 - kkaempf@suse.com + +- Update to version 4.1.0 from 4.1.0-beta1 + +------------------------------------------------------------------- +Sun Oct 16 12:50:55 UTC 2022 - Klaus Kämpf + +- Update to 4.1.0~beta1 + * Add Javascript Node v12-v18 support, remove support prior to v6. + * Octave 6.0 to 6.4 support added. + * Add PHP 8 support. + * PHP wrapping is now done entirely via PHP's C API + - no more .php wrapper. + * Perl 5.8.0 is now the oldest version SWIG supports. + * Python 3.3 is now the oldest Python 3 version SWIG supports. + * Python 3.9-3.11 support added. + * Various memory leak fixes in Python generated code. + * Scilab 5.5-6.1 support improved. + * Many improvements for each and every target language. + * Various preprocessor expression handling improvements. + * Improved C99, C++11, C++14, C++17 support. + Start adding C++20 standard. + * Make SWIG much more move semantics friendly. + * Add C++ std::unique_ptr support. + * Few minor C++ template handling improvements. + * Various C++ using declaration fixes. + * Few fixes for handling Doxygen comments. + * GitHub Actions is now used instead of Travis CI for continuous + integration. + * Add building SWIG using CMake as a secondary build system. + * Update optional SWIG build dependency for regex support + from PCRE to PCRE2. + +- dropped patches, all upstream + * 15515f390c5e3316a7faf0cf85d661a297d45a50.patch + * fix-gcc12-error.patch + * swig-Define-PY_SSIZE_T_CLEAN-macro.patch + * swig-Define-PY_SSIZE_T_CLEAN-only-when-not-defined-yet.patch + * swig-Python-define-PY_SSIZE_T_CLEAN.patch + * swig-octave-6.patch + * swig-python310.patch + * swig308-isfinite.diff + +------------------------------------------------------------------- +Fri Oct 14 14:06:08 UTC 2022 - kkaempf@suse.com + +- Update to version rel-4.0.2: + * [R] Run destructors of local C++ objects on SWIG_fail + * [php] Update exception_memory_leak_runme.php + * [lua] Run destructors of local C++ objects on SWIG_fail + * Fix issues with exception_memory_leak testcase + * Define PY_SSIZE_T_CLEAN only when not defined yet + * Add missing SWIGTYPE *const& typemaps + * Revert "[xml] Move to "Experimental" target language status" + * Cleanup SWIG_VERSION definition + * Additional SWIG_VERSION testing ------------------------------------------------------------------- Thu Sep 8 13:23:05 UTC 2022 - Stephan Kulow diff --git a/swig.spec b/swig.spec index 8b17001..b93ff89 100644 --- a/swig.spec +++ b/swig.spec @@ -30,31 +30,16 @@ BuildRequires: ruby BuildRequires: ruby-devel %endif Name: swig -Version: 4.0.2 +Version: 4.1.0 +%define srcversion v4.1.0 Release: 0 Summary: Simplified Wrapper and Interface Generator License: BSD-3-Clause AND GPL-3.0-or-later Group: Development/Languages/C and C++ URL: http://www.swig.org/ -Source: http://prdownloads.sourceforge.net/swig/%{name}-%{version}.tar.gz +Source: https://github.com/swig/swig/archive/refs/tags/%{srcversion}.tar.gz Source1: %{name}.rpmlintrc -# PATCH-FIX-UPSTREAM swig-octave-6.patch gh#swig/swig#2020 badshah400@gmail.com -- Allow swig to work with octave 6 and above; patch part of upstream merge request -Patch0: swig-octave-6.patch -Patch1: fix-gcc12-error.patch -# PATCH-FIX-UPSTREAM swig-python310.patch -- gh#swig/swig#2064, Fix swig test suite with python310 -Patch2: swig-python310.patch -# PATCH-FIX-UPSTREAM 15515f390c5e3316a7faf0cf85d661a297d45a50.patch - gh#swig/swig#2138, remove obsolete pcre1 -# from https://github.com/swig/swig/commit/15515f390c5e3316a7faf0cf85d661a297d45a50.patch -Patch3: 15515f390c5e3316a7faf0cf85d661a297d45a50.patch -# PATCH-FIX-UPSTREAM https://github.com/swig/swig/pull/2277 -Patch4: swig-Python-define-PY_SSIZE_T_CLEAN.patch -# PATCH-FIX-UPSTREAM https://github.com/swig/swig/pull/2277 -Patch5: swig-Define-PY_SSIZE_T_CLEAN-macro.patch -# PATCH-FIX-UPSTREAM https://github.com/swig/swig/pull/2401 -Patch6: swig-Define-PY_SSIZE_T_CLEAN-only-when-not-defined-yet.patch -Patch308: swig308-isfinite.diff - BuildRequires: autoconf BuildRequires: automake BuildRequires: bison @@ -135,7 +120,6 @@ understandig SWIG usage. %prep %setup -q -%autopatch -p1 %build %ifarch s390 s390x diff --git a/swig308-isfinite.diff b/swig308-isfinite.diff deleted file mode 100644 index 9a84cb3..0000000 --- a/swig308-isfinite.diff +++ /dev/null @@ -1,25 +0,0 @@ -From 7d7454cacbae4355432a7f88455de4981742033f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= -Date: Wed, 8 May 2019 14:50:10 +0200 -Subject: [PATCH] swig308-isfinite - ---- - Lib/typemaps/fragments.swg | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/Lib/typemaps/fragments.swg b/Lib/typemaps/fragments.swg -index e83f415c4322..cac69ffff745 100644 ---- a/Lib/typemaps/fragments.swg -+++ b/Lib/typemaps/fragments.swg -@@ -129,6 +129,8 @@ inline int SWIG_isfinite_func(T x) { - # elif defined(__sun) && defined(__SVR4) - # include - # define SWIG_isfinite(X) (finite(X)) -+# elif defined(__GNUC__) -+# define SWIG_isfinite(X) (__builtin_isfinite(X)) - # endif - #endif - %} --- -2.21.0 - diff --git a/v4.1.0.tar.gz b/v4.1.0.tar.gz new file mode 100644 index 0000000..9e379d1 --- /dev/null +++ b/v4.1.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b9313b1af5edfcea158a389520be266f013bc9be4ce933d79a30c5659ba99fe +size 3783642