Accepting request 1011257 from home:kwk:branches:devel:tools:building

- Update to 4.1.0
  * 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
- 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
- Cherrypick 15515f390c5e3316a7faf0cf85d661a297d45a50.patch from
  upstream to replace obsolete pcre1 with pcre2
- Add swig-python310.patch -- gh#swig/swig#2064, Fix swig test
  suite with Python 3.10
- Add fix-gcc12-error.patch in order to fix GCC 12 compilation error.
- Add swig-octave-6.patch -- Allow swig to work with octave 6 and
  above; patch part of upstream merge request [gh#swig/swig#2020].
- Fixing package dependencies for CentOS
- move examples to /usr/share/swig/examples
- Update to 4.0.2
  - A few fixes around doxygen comment handling.
  - Ruby 2.7 support added.
  - Various minor improvements to C#, D, Java, OCaml, Octave, Python,
    R, Ruby.
  - Considerable performance improvement running SWIG on large
    interface files.
- drop upstreamed patches
  ruby-std-wstring-byte-order.patch
  0001-Fix-code-generated-for-Ruby-global-variables.patch
  0002-Add-support-for-Ruby-2.7.patch
  0003-Move-new-macros-for-Ruby-to-their-dedicated-namespac.patch
  0004-Improve-description-of-cast-macros-for-Ruby.patch
        
- Revert last change, drop 0005-disable_li_std_wstring.patch
- ruby-std-wstring-byte-order.patch: fix wstring encoding boo#1171368
- Add 0005-disable_li_std_wstring.patch for BE arches
  (ppc64 s390 s390x) as bypass boo#1171368
- Ruby 2.7 support (cherry-picked from upstream)
  0001-Fix-code-generated-for-Ruby-global-variables.patch
  0002-Add-support-for-Ruby-2.7.patch
  0003-Move-new-macros-for-Ruby-to-their-dedicated-namespac.patch
  0004-Improve-description-of-cast-macros-for-Ruby.patch
- Update to 4.0.1
  - SWIG now cleans up on error by removing all generated files.
  - Add Python 3.8 support.
  - Python Sphinx compatibility added for Doxygen comments.
  - Some minor regressions introduced in 4.0.0 were fixed.
  - Fix some C++17 compatibility problems in Python and Ruby generated
    code.
  - Minor improvements/fixes for C#, Java, Javascript, Lua, MzScheme,
    Ocaml, Octave and Python.
  
  See https://raw.githubusercontent.com/swig/swig/master/CHANGES
- Update to 4.0.0
  - Support for Doxygen documentation comments which are parsed and
    converted into JavaDoc or PyDoc comments.
  - STL wrappers improved for C#, Java and Ruby.
  - C++11 STL containers added for Java, Python and Ruby.
  - Improved support for parsing C++11 and C++14 code.
  - Various fixes for shared_ptr.
  - Various C preprocessor corner case fixes.
  - Corner case fixes for member function pointers.
  - Python module overhaul by simplifying the generated code and turning
    most optimizations on by default.
  - %template improvements wrt scoping to align with C++ explicit
    template instantiations.
  - Added support for a command-line options file (sometimes
    called a response file).
  - Numerous enhancements and fixes for all supported target languages.
  - SWIG now classifies the status of target languages into either
    'Experimental' or 'Supported' to indicate the expected maturity
    level.
  - Support for CFFI, Allegrocl, Chicken, CLISP, S-EXP, UFFI, Pike,
    Modula3 has been removed.
  - Octave 4.4-5.1 support added.
  - PHP5 support removed, PHP7 is now the supported PHP version.
  - Minimum Python version required is now 2.7, 3.2-3.7 are the only
    other versions supported.
  - Added support for Javascript NodeJS versions 2-10.
  - OCaml support is much improved and updated, minimum OCaml version
    required is now 3.12.0.
  See https://raw.githubusercontent.com/swig/swig/master/CHANGES
- Drop patches (all included)
  swig-3.0.12-Coverity-fix-issue-reported-for-SWIG_Python_FixMetho.patch
  swig-3.0.12-Fix-generated-code-for-constant-expressions-containi.patch
  swig-perl526.patch
  swig-3.0.12-fix-collections.patch
  swig-3.0.12-Fix-Coverity-issue-reported-for-setslice-pycontainer.patch
  swig-3.0.12-Coverity-fix-issue-reported-for-wrapper-argument-che.patch
  swig-3.0.12-support-octave-4.4.patch
  swig-ocaml-int64.patch
  swig-3.0.12-Coverity-fix-issue-reported-for-SWIG_Python_ConvertF.patch
- Add swig-3.0.12-support-octave-4.4.patch to add support for
  octave 4.4; patch taken from upstream git (gh#swig/swig#1256).
- Add patches to build with python 3.7 properly:
  * swig-3.0.12-Coverity-fix-issue-reported-for-SWIG_Python_ConvertF.patch
  * swig-3.0.12-Coverity-fix-issue-reported-for-SWIG_Python_FixMetho.patch
  * swig-3.0.12-Coverity-fix-issue-reported-for-wrapper-argument-che.patch
  * swig-3.0.12-Fix-Coverity-issue-reported-for-setslice-pycontainer.patch
  * swig-3.0.12-Fix-generated-code-for-constant-expressions-containi.patch
  * swig-3.0.12-fix-collections.patch
- Use version req to check for 1500 instead for non-existing release
- Move to generic requires those that are true under both conditions
- Use autopatch to apply all the patches at once
- Reduce some conditionals for old distros lets consider sle11/rhel6
  as minimal supported configuration
- Make sure we can be built and distributed with python3 only
  present in the system
- Run python2 and python3 tests for Factory
- add swig-perl526.patch from upstream to work with perl 5.26
- use individual libboost-*-devel packages instead of boost-devel
- Update to 3.0.12
  - Add support for Octave-4.2.
  - Enhance %extend to support template functions.
  - Language specific enhancements and fixes for C#, D, Guile,
    Java, PHP7.
- Update to 3.0.11
  - PHP 7 support added.
  - C++11 alias templates and type aliasing support added.
  - Minor fixes and enhancements for C# Go Guile Java Javascript
    Octave PHP Python R Ruby Scilab XML.
- Update to 3.0.10
  - Regression fixes for smart pointers and importing Python modules.
- Update to 3.0.9
  - Add support for Python's implicit namespace packages.
  - Fixes to support Go 1.6.
  - C++11 std::array support added for Java.
  - Improved C++ multiple inheritance support for Java/C# wrappers.
  - Various other minor fixes and improvements for C#, D, Go, Java,
    Javascript, Lua, Python, R, Ruby, Scilab.
- drop swig308-Fix-li_boost_array-test.patch, upstream
- Add disabled build conditional for ocaml support (fate#320836)
- Add swig-ocaml-int64.patch (ocaml PR#6517, fate#320836)
- Add swig308-isfinite.diff to fix isfinite issue with new glibc.
- Add swig308-Fix-li_boost_array-test.patch to fix boost::array
  test on PPC.
- Update to 3.0.8
  - pdf documentation enhancements.
  - Various Python 3.5 issues fixed.
  - std::array support added for Ruby and Python.
  - shared_ptr support added for Ruby.
  - Minor improvements for CFFI, Go, Java, Perl, Python, Ruby.
- Update to 3.0.7
  - Add support for Octave-4.0.0.
  - Remove potential Android security exploit in generated Java classes.
  - Minor new features and bug fixes.
- drop swig-octave4.patch and swig-3.0.6.patch, upstream now
- Add swig-octave4.patch to fix swig bindings for octave >= 4.0
  (patch taken from Fedora, and has been submitted upstream).
- Fix ocaml check (swig-3.0.6.patch)
- Update to 3.0.6
  - Stability and regression fixes.
  - Fixed parsing of C++ corner cases.
  - Language improvements and bug fixes for C#, Go, Java, Lua,
    Python, R.
- explicitly disable ocaml (bug in configure script)
- Update to version 3.0.5 
  * Added support for Scilab.
  * Important Python regression fix when wrapping C++ default arguments.
  * Minor improvements for C#, Go, Octave, PHP and Python.
- Update to 3.0.4
  - Python regression fix when wrapping C++ default arguments.
  - Improved error messages.
- Update to 3.0.3
  - Add support for C++11 strongly typed enumerations.
  - Numerous bug fixes and minor enhancements for C#, D, Go, Java,
    Javascript, PHP, Perl and Python wrappers.
- drop nested_classes.diff, patch is upstream
- Fix syntax error in find command
- support nested classes in ruby [bnc#892480]
  new patch: nested_classes.diff
- Update to 3.0.2
  - Bug fix during install and a couple of other minor changes.
- Update to 3.0.1
  - Javascript module added. This supports JavascriptCore (Safari/Webkit),
    v8 (Chromium) and node.js currently.
  - A few notable regressions introduced in 3.0.0 have been fixed - in
    Lua, nested classes and parsing of operator <<.
  - The usual round of bug fixes and minor improvements for:
    C#, GCJ, Go, Java, Lua, PHP and Python.      
- Update to 3.0.0
  - This is a major new release focusing primarily on C++
    improvements.
  - C++11 support added. Please see documentation for details of
    supported features:
    http://www.swig.org/Doc3.0/CPlusPlus11.html
  - Nested class support added. This has been taken full advantage
    of in Java and C#. Other languages can use the nested classes,
    but require further work for a more natural integration into
    the target language.
  - We urge folk knowledgeable in the other target languages to
    step forward and help with this effort.
  - Lua: improved metatables and support for %nspace.
  - Go 1.3 support added.
  - Python import improvements including relative imports.
  - Python 3.3 support completed.
  - Perl director support added.
  - C# .NET 2 support is now the minimum. Generated using statements
    are replaced by fully qualified names.
  - Bug fixes and improvements to the following languages:
    C#, Go, Guile, Java, Lua, Perl, PHP, Python, Octave, R, Ruby, Tcl
  - Various other bug fixes and improvements affecting all
    languages.
  - Note that this release contains some backwards incompatible
    changes in some languages.
  - Full detailed release notes are in the changes file.
- drop 0001-Fix-Ruby-tracking-code-to-use-C-hash.patch,
  ruby-1.8.6-newobject.patch, and swig-fix_ocaml_type.patch.
  All upstreamed.
- set CCSHARED to "-fPIC" on s390/s390x 
- Update to 2.0.12
  - This is a maintenance release backporting some fixes from the
    pending 3.0.0 release.
  - Octave 3.8 support added.
  - C++11 support for new versions of erase/insert in the STL
    containers.
  - Compilation fixes on some systems for the generated Lua, PHP,
    Python and R wrappers.
 
  - Drop upstreamed patches:
    swig-lua-fix-void-return-for-int-functions.patch
    swig-support-octave-3.8.0.patch
    ruby-2.0-encoding-utf8.patch
- Add patch swig-support-octave-3.8.0.patch: adds support for
  octave version 3.8.0 to swig; patch taken from upstream git
  and rebased for present version. 
- Add swig-lua-fix-void-return-for-int-functions.patch to fix
  void returns in non-void functions for its lua binding; patch
  submitted upstream (bnc#84331,
  https://github.com/swig/swig/issues/93).
- Update to SWIG 2.0.11
  - Minor bug fixes and enhancements mostly in Python, but also
    C#, Lua, Ocaml, Octave, Perl, PHP, Python, R, Ruby, Tcl.
- Ruby 1.8.6 (SLE10) tracks objects differently
  Add ruby-1.8.6-newobject.patch
- Remove skip-python-li_std_containers_int.patch, fixed upstream
- Remove python-2.4.patch, fixed upstream
- Fix Fedora/RHEL builds (BuildRequires:  perl-Test-Simple)
- Change Ruby 1.9+ object tracking to use C hashes, fixes all
  failed Ruby tests.
  Patch added:   0001-Fix-Ruby-tracking-code-to-use-C-hash.patch
  Patch removed: 0008-Ruby-Disable-broken-tests.patch
- Ruby 2.0 strictly enforces encoding
  Add ruby-2.0-encoding-utf8.patch
- Update to SWIG 2.0.10
  - Ruby 1.9 support is now complete.
  - Add support for Guile 2.0 and Guile 1.6 support (GH interface) has
    been dropped.
  - Various small language neutral improvements and fixes.
  - Various bug fixes and minor improvements specific to C#, CFFI, D,
    Java, Octave, PHP, Python,
  - Minor bug fix in ccache-swig.
  - Development has moved to Github with Travis continuous integration
    testing - patches using https://github.com/swig/swig are welcome.     
- drop 0012-Python-Disable-broken-test-in-threads_exception.patch
- Add swig-fix_ocaml_type.patch to change the declaration of 
  caml_array_length to match that in ocaml's header.
- Fix RHEL4 and 6 build
- Update to SWIG 2.0.9
  SWIG-2.0.9 summary:
  - Improved typemap matching.
  - Ruby 1.9 support is much improved.
  - Various bug fixes and minor improvements in C#, CFFI, Go, Java,
    Modula3, Octave, Perl, Python, R, Ruby, Tcl and in ccache-swig.
- Removed patches (included in 2.0.9 release)
  - 0001-Ruby-replace-obsolete-STR2CSTR-macro-with-StringValu.patch
  - 0002-Ruby-use-RbConfig-instead-of-deprecated-Config-modul.patch
  - 0003-Ruby-Fix-include-pathes-for-Ruby-1.9.patch
  - 0004-Ruby-Add-local-dir-to-loadpath-for-Ruby-1.9.patch
  - 0007-Ruby-1.9-methods-returns-array-of-Symbols-now.patch
- Removed broken patch
  - swig-2.0.4-guile2.patch
- Disable tests failing on (deprecated) Python 2.4
  - new patch: python-2.4.patch
- fix build on SLE10: disable autogen.sh
  Add patch: PyInt_FromSize_t unavailable under Python 2.4
- Update to 2.0.8
  * Fix a couple of regressions introduced in 2.0.5 and 2.0.7.
  * Improved using declarations and using directives support.
  * Minor fixes/enhancements for C#, Java, Octave, Perl and Python.
- Fix segfault in constructor/destructor warning (upstream ID 3530078)
- Port SWIG to Ruby 1.9 (various patches)
- Disable broken tests
- Update to 2.0.7
  * Important regression fixes since 2.0.5 for typemaps in general and
    in Python.
  * Fixes and enhancements for Go, Java, Octave and PHP.
- Update to 2.0.6
  * Various fixes with templates and typedef types.
  * Some template lookup problems fixed.
  * Templated type fixes to use correct typemaps.
  * Autodoc documentation generation improvements.
  * Python STL container wrappers improvements including addition of
    stepped slicing.
  * Approximately 70 fixes and minor enhancements for the following
    target languages: AllegroCL, C#, D, Go, Java, Lua, Ocaml, Octave,
    Perl, PHP, Python, R, Ruby, Tcl, Xml.
- Added a patch (r12814.patch) to fix regression leading to uncompilable code
  when using typedef and function pointer references (taken from Debian).
- The perl 5.12 packages are compiled with -Duse64bitint, which 
  means that IVs are 64-bits even on 32-bit architectures. When 
  converting IVs, SWIG assumes that an IV is the same size as a 
  long, which causes OverflowErrors with  unsigned longs when 
  the value is greater than 2^31. 
- fix SLES 10 build, disable failing test (bnc#750618)
- fix build, add Group field to subpackages
- fix license to be in spdx.org format
- generate guile 2 friendly code
- Update to swig 2.0.4
  (see CHANGES.current for complete list)
  * [Perl] Patch #3260265 fixing overloading of non-primitive types and integers in 
    Perl 5.12 and later.
  * [Ruby] Fix %import where one of the imported files %include one of the STL include
    files such as std_vector.i.
  * [python] Additional fixes for python3.2 support.
  * [python] Fixed PyGetSetDescr for python3.2.
  * Bug 2635919: Convenience method to convert std::map to a python dict.
  * Fixed bug 1163440: vararg typemaps.
  * [Python] Applied patch #1932484: migrate PyCObject to PyCapsule.
  * [Python] Merged in the szager-python-builtin branch, adding the -builtin feature
    for python.  The -builtin option may provide a significant performance gain
    in python wrappers.  For full details and limitations, refer to Doc/Manual/Python.html.
    A small test suite designed to demonstrate the performance gain is in
    Examples/python/performance.
- Fix RHEL/Fedora build
- Drop adapt-perl512.diff and replace it with swig-2.0.3-perl512.patch
  which is applied upstream.
- Add swig-2.0.3-perl514.patch: fix test failures with Perl 5.14 
- Update to swig 2.0.3 
  * Much better nested class/struct support.
  * Much improved template partial specialization and explicit 
    specialization handling.
  * Namespace support improved with the 'nspace' feature where 
    namespaces can be automatically translated into Java packages or C# namespaces.
  * Improved typemap and symbol table debugging.
  * Numerous subtle typemap matching rule changes when using the 
    default (SWIGTYPE) type. These now work much like C++ class template 
    partial specialization matching.
  * Other small enhancements for typemaps. 
    Typemap fragments are also now official and documented.
  * Warning and error display refinements.
  * Wrapping of shared_ptr is improved and documented now.
  * Numerous C++ unary scope operator (::) fixes.
  * Better support for boolean expressions.
  * Various bug fixes and improvements in the Allegrocl, C#, Java, 
    Lua, Octave, PHP, Python, R, Ruby and XML modules.
- fix build with new perl 5.12: there is no Reference type anymore,
  but references and integers are the same, so a 0L was seen as 0
  pointer - breaking the test suite. The fix is to remove the check
- take patch from swig svn to fix assertion on -xmlout (fix
  yast2-storage build)
- tune .spec file to build on multiple distros
- package documentation as noarch
- updated to 1.3.40
  * SWIG now supports directors for PHP.
  * PHP support improved in general.
  * Octave 3.2 support added.
  * Various bug fixes/enhancements for Allegrocl, C#, Java, Octave,
    Perl, Python, Ruby and Tcl.
  * Other generic fixes and minor new features.
- updated to 1.3.39
  * Python 3 support added
  * PHP4 support dropped
  * many bugfixes and improvements
- ccache support disabled as it didn't work (todo after 11.2)
- fixed two integer overflows in perlprimtypes.swg. These were
  actually why the two tests on ppc failed. *sigh* (bnc#431945)
- disable two perl tests on ppc
- updated to 1.3.36
  * Enhancement to directors to wrap all protected members
  * Optimisation feature for objects returned by value
  * A few bugs fixes in the PHP, Java, Ruby, R, C#, Python, Lua and
    Perl modules
  * Other minor generic bug fixes
- updated to 1.3.35
  * Octave language module added
  * Bug fixes in Python, Lua, Java, C#, Perl modules
  * A few other generic bugs and runtime assertions fixed
- remove the croak patch, croak(Nullch) is correct (see
  https://sourceforge.net/tracker/?func=detail&atid=301645&aid=1925121&group_id=1645)
- testsuite-warnings.patch not needed
- define SWIG_croak_null as croak("%s","") not croak(Nullch)
  as croak is defined to take a string constant as 1st arg.
- Don't return an unitialized local variable in template code.
- Bracket if clauses so that the compiler doesn't warn in template code.
- updated to 1.3.34
  + shared_ptr support for Python
  + Support for latest R - version 2.6
  + Various minor improvements/bug fixes for R, Lua, Python, Java,
    C#
  + A few other generic bug fixes, mainly for templates and using
    statements
- updated to 1.3.33
  + shared_ptr support for Java and C#
  + Enhanced STL support for Ruby
  + Fixed long-standing memory leak in PHP Module
  + Numerous fixes and minor enhancements for Allegrocl, C#, cffi,
    Chicken, Guile, Java, Lua, Ocaml, Perl, PHP, Python, Ruby, Tcl
  + Improved warning support
- don't "update" autofoo when building for  older dists in the
  buildservice
- install examples in '%%_libdir/swig/examples' (not Examples) to
  pass the devel-file-in-non-devel-package rpmlint check
- fixed some rpmlint errors
- install the precompiled examples to %%_libdir/swig
- temporarily disabled li_std_string run test under perl5 on ix86
  and s390
- build examples and testsuite with -fno-strict-aliasing (packages
  using swig & python should do the same for now)
- fixed testsuite-warnings.patch
- updated to 1.3.31, for changes see
  http://swig.svn.sourceforge.net/viewvc/swig/trunk/CHANGES?r1=9073&r2=9585&diff_format=u
- fixed bug in the python module that caused aborts on some
  architectures
- don't install executable documentation files
- fixed for Python 2.5 (further fixes may be needed, at least it
  builds again)
  (python25.patch)
- use $RPM_OPT_FLAGS, unhide compilation of test wrappers (ditto)
  (testsuite.patch)
- fixed build
- update to version 1.3.29
  * support for Common Lisp with CFFI
  * new %extend_smart_pointer() directive to extend SWIG smart
    pointer support in Python
  * new %bang directive for methods ending with exclamation marks
    in Ruby
  * New -autorename option for Ruby to rename methods to match
    Ruby naming conventions
  * enhancements to the %rename directive
  * initial support for wrappint Java code in scripting languages
    using gcj
  * new %copyctor directive for automatic generation of copy
    constructors
  * many more enhancements + bugfixes
- fixed top-level Makefile.in to work with autoconf-2.60
  (autoconf260.patch)
- added python-devel to buildrequires to test the Python module
  during build
  
- Fix missing slash.
- split documentation into swig-doc and swig-examples
  [#153015]
- fix build with perl-5.8.8 (thanks to Olaf Hering)
- converted neededforbuild to BuildRequires
- use -fPIC instead of -fpic (-fpic didn't pass testsuite on s390x)
- fix endless loop when write fails
  [#141754] (write-loop.patch)
- fix build on x86_64 (fPIC in gifplot) 
- don't build as root 
- update -> 1.3.27
- parallelize build
- run test suite
- update to 1.3.24 again, I hope that subversion guys will fix their
  problems till next release
- fix swigpy build on lib64 
- back to 1.3.21 due to subversion incompatibility
- update to 1.3.24
- our python now has sys.lib, so no need for patching
- spec file cleanup
- swiglibdir is now same as upstream - $datadir/swig/version
- update to 1.3.23
- runtime no more included
- remove most of buildrequires, as they're needed just for examples and
  they anyway don't compile out of the source directory
- -fno-strict-aliasing
- added php4 to neededforbuild
- renamed mod_php4-devel to php4-devel in neededforbuild
- updated to 1.3.21
- Updated to 1.3.20. This release includes a large number of
  enhancements including improved C++ support, directors, contracts, and
  more.
- handle libdir correctly
- try to force swig compilation to accept CFLAGS
- cleaned up specfile
- add -fPIC
- fix libtool problems
- fixed permissions for files in lib
- fix permissions for documentation
- use swiglibdir to have save setup as previous versions
- updated to 1.3.19
- compile with -fPIC (should fix #26765)
- configure scripts finds correctly more requirements:
    - java includes
    - python on lib64
    - ocaml on lib64
- build more runtimes:
    - added php4
    - fixed perl
- not marking files as config, as they do not contain configuration
- simplified file list
- updated to 1.3.17:
    * added pike and ocaml bindings
    * many bugfixes
- removed bogus self-provides 
- made it work with threaded perl-5.8
- updated to 1.3.13
- added more documentation (html manual and some others)
- delete bogus config.{log,status} from Examples/GIFPlot
- compile with tcl again (needs --with-tclconfig)
- fix libdir usage 
- fixed parser.yxx to compile with bison 1.32
- fixed to compile with python 2.2
- update to version 1.3.9:
  * many fixes and improvements
- added libraries in /usr/lib
- update to version 1.3.6
- fixed call of suse_update_config
- call autoconf also in subdirs
- added xf86 to neededforbuild
- Fix last change to do it right.
- added swig1.3a5-Printv.dif.bz2 - fixed to work on ia64
- changed neededforbuild <tcld> to <tcl-devel>
- removed kaffe from neededforbuild
- fixed filelist 
- fixed neededforbuild
- update to version 1.3a5
- fixed file list
- fixed neededforbuild
- improved optimalization
- update to version 1.3a3
- bzipped sources
- added BuildRoot
- Use doc macro
- fixed to compile
- man to /usr/share 
- fixed neededforbuild 
                                 
- Reinserted old # Commandline: line.
- ran old prepare_spec on spec file to switch to new prepare_spec.
 - Spec file created from swig1.1p5.tar.gz by autospec

OBS-URL: https://build.opensuse.org/request/show/1011257
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=140
This commit is contained in:
Klaus Kämpf 2022-10-16 17:27:44 +00:00 committed by Git OBS Bridge
parent 73917f97e0
commit c6fa32ce57
14 changed files with 80 additions and 928 deletions

View File

@ -1,328 +0,0 @@
From 15515f390c5e3316a7faf0cf85d661a297d45a50 Mon Sep 17 00:00:00 2001
From: Julien Schueller <schueller@phimeca.com>
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 <a href="http://www.gnu.org
<p>
<a href="http://www.pcre.org/">PCRE</a>
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.
</p>
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
<li>
The PCRE third party library needs to be built next.
-Download the latest PCRE source tarball, such as <tt>pcre-8.10.tar.bz2</tt>, from
+Download the latest PCRE source tarball, such as <tt>pcre2-10.39.tar.bz2</tt>, from
<a href=http://www.pcre.org>PCRE</a> and place in the <tt>/usr/src/swig</tt> 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 <pcre.h>
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include <pcre2.h>
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 <pcre.h>
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include <pcre2.h>
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])
])

18
_service Normal file
View File

@ -0,0 +1,18 @@
<services>
<service name="tar_scm" mode="disabled">
<param name="url">https://github.com/swig/swig.git</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="revision">master</param>
<param name="changesgenerate">enable</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">swig-*.tar</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="disabled">
<param name="basename">swig</param>
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/swig/swig.git</param>
<param name="changesrevision">7334e9c16f11486ad969083d55ade76715403aa0</param></service></servicedata>

View File

@ -1,23 +0,0 @@
From 76d5a9ec270a763c892ae28070e391cf99e0b7cd Mon Sep 17 00:00:00 2001
From: William S Fulton <wsf@fultondesigns.co.uk>
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;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d53be9730d8d58a16bf0cbd1f8ac0c0c3e1090573168bfa151b01eb47fa906fc
size 8097014

3
swig-4.1.0-beta1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:59ed11bfa49d03314509d28e3eeb9294524d5be9ec3f7f36be8bd2be94208519
size 8601046

View File

@ -1,62 +0,0 @@
From abc8e0bb277f7a54ff4ee209845dde910d267819 Mon Sep 17 00:00:00 2001
From: William S Fulton <wsf@fultondesigns.co.uk>
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 <Python.h>
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 <math.h>
#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)

View File

@ -1,44 +0,0 @@
From c3f17b415dc63906218306135da49bf1f941588f Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
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 <msuchanek@suse.de>
---
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 <Python.h>
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 <math.h>
#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)

View File

@ -1,47 +0,0 @@
From ca6a73277b7f48ce4cf9d30d7bff7813f3685684 Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
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 <heinrich.schuchardt@canonical.com>
---
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 <Python.h>
#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 <math.h>
#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

View File

@ -1,347 +0,0 @@
From 582e3a3fee8a7cfe5903da1c4b0db8e40d5d2deb Mon Sep 17 00:00:00 2001
From: Robert Fries <robert_fries@partech.com>
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 <robert_fries@partech.com>
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<ndim;k++) {
const octave_value& obj = c(k);
+#if SWIG_OCTAVE_PREREQ(6,0,0)
+ try {
+ d.elem(k) = obj.int_value();
+ }
+ catch (octave::execution_exception& oee) {
+ // __dims__ should return a cell filled with integers
+ return dim_vector(1,1);
+ }
+#else
d.elem(k) = obj.int_value();
// __dims__ should return a cell filled with integers
if (error_state) return dim_vector(1,1);
+#endif
}
return d;
#if SWIG_OCTAVE_PREREQ(4,4,0)
@@ -468,8 +487,18 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
} else if (out.is_matrix_type() || out.is_numeric_type() ) {
#endif
if (out.rows()==1 || out.columns()==1) {
+#if SWIG_OCTAVE_PREREQ(6,0,0)
+ Array<int> a;
+ try {
+ a = out.int_vector_value();
+ }
+ catch (octave::execution_exception& oee) {
+ return dim_vector(1,1);
+ }
+#else
Array<int> 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<octave::stack_frame> 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 <robert_fries@partech.com>
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(); }

View File

@ -1,23 +0,0 @@
From a2850397ba3eec5d4c58304cf8277ca535919760 Mon Sep 17 00:00:00 2001
From: Julien Schueller <schueller@phimeca.com>
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:

View File

@ -1,11 +1,55 @@
-------------------------------------------------------------------
Thu Oct 13 17:47:25 UTC 2022 - Michal Suchanek <msuchanek@suse.com>
Sun Oct 16 12:50:55 UTC 2022 - Klaus Kämpf <kkaempf@suse.com>
- 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
- Update to 4.1.0
* 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 <coolo@suse.com>

View File

@ -30,31 +30,16 @@ BuildRequires: ruby
BuildRequires: ruby-devel
%endif
Name: swig
Version: 4.0.2
Version: 4.1.0~beta1
%define srcversion 4.1.0-beta1
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: http://prdownloads.sourceforge.net/swig/%{name}-%{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
@ -134,8 +119,8 @@ This package contains SWIG examples, useful both for testing and
understandig SWIG usage.
%prep
%setup -q
%autopatch -p1
%setup -q -n %{name}-%{srcversion}
#%%autopatch -p1
%build
%ifarch s390 s390x

View File

@ -1,25 +0,0 @@
From 7d7454cacbae4355432a7f88455de4981742033f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Klaus=20K=C3=A4mpf?= <kkaempf@suse.de>
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 <ieeefp.h>
# define SWIG_isfinite(X) (finite(X))
+# elif defined(__GNUC__)
+# define SWIG_isfinite(X) (__builtin_isfinite(X))
# endif
#endif
%}
--
2.21.0