diff --git a/macros.sip b/macros.sip index 6e07e489278263fe12b06ebb34d76f7726f4197c..bceeb120f770bd3afdcdad23ad62f25de022a991 100644 --- a/macros.sip +++ b/macros.sip @@ -1,3 +1,3 @@ %_sip_api_major 12 -%_sip_api_minor 5 +%_sip_api_minor 7 %_sip_api %{_sip_api_major}.%{_sip_api_minor} diff --git a/sip-4.18-no_rpath.patch b/sip-4.18-no_rpath.patch index 406a26c8ecb46c27226a5f6a642ac44003bc4362..0ae91e44d148d3e216130902401b614494b90a3b 100644 --- a/sip-4.18-no_rpath.patch +++ b/sip-4.18-no_rpath.patch @@ -1,7 +1,7 @@ -diff -up sip-4.18/siputils.py.no_rpath sip-4.18/siputils.py ---- sip-4.18/siputils.py.no_rpath 2015-03-25 06:00:24.000000000 -0500 -+++ sip-4.18/siputils.py 2016-04-13 11:34:48.179894616 -0500 -@@ -435,7 +435,7 @@ class Makefile: +diff -rupN --no-dereference sip-4.19.25/siputils.py sip-4.19.25-new/siputils.py +--- sip-4.19.25/siputils.py 2021-10-21 13:45:54.808566613 +0200 ++++ sip-4.19.25-new/siputils.py 2021-10-21 13:45:54.812566611 +0200 +@@ -436,7 +436,7 @@ class Makefile: if l_dir in ("", ".", ".."): continue @@ -10,7 +10,7 @@ diff -up sip-4.18/siputils.py.no_rpath sip-4.18/siputils.py if self._python: incdir.append(self.config.py_inc_dir) -@@ -612,7 +612,7 @@ class Makefile: +@@ -613,7 +613,7 @@ class Makefile: # Handle library directories. libdir_qt = self.optional_list("LIBDIR_QT") libdir.extend(libdir_qt) diff --git a/sip-4.18-no_strip.patch b/sip-4.18-no_strip.patch index 3273311ffac5cb9a684eb38e929bdb0d6391beee..326759e800d0070f1ac90906ac1cc543a98b4467 100644 --- a/sip-4.18-no_strip.patch +++ b/sip-4.18-no_strip.patch @@ -1,7 +1,7 @@ -diff -up sip-4.18/siputils.py.no_strip sip-4.18/siputils.py ---- sip-4.18/siputils.py.no_strip 2015-03-25 06:00:24.000000000 -0500 -+++ sip-4.18/siputils.py 2016-04-13 11:34:23.718690341 -0500 -@@ -1469,7 +1469,7 @@ class ModuleMakefile(Makefile): +diff -rupN --no-dereference sip-4.19.25/siputils.py sip-4.19.25-new/siputils.py +--- sip-4.19.25/siputils.py 2021-02-26 16:17:35.156108000 +0100 ++++ sip-4.19.25-new/siputils.py 2021-10-21 13:45:54.780566626 +0200 +@@ -1473,7 +1473,7 @@ class ModuleMakefile(Makefile): """ def __init__(self, configuration, build_file, install_dir=None, static=0, console=0, qt=0, opengl=0, threaded=0, warnings=1, debug=0, @@ -10,7 +10,7 @@ diff -up sip-4.18/siputils.py.no_strip sip-4.18/siputils.py export_all=0, universal=None, arch=None, deployment_target=None): """Initialise an instance of a module Makefile. -@@ -1780,7 +1780,7 @@ class SIPModuleMakefile(ModuleMakefile): +@@ -1784,7 +1784,7 @@ class SIPModuleMakefile(ModuleMakefile): """ def __init__(self, configuration, build_file, install_dir=None, static=0, console=0, qt=0, opengl=0, threaded=0, warnings=1, debug=0, diff --git a/sip-4.19.12.tar.gz b/sip-4.19.12.tar.gz deleted file mode 100644 index a0adacb1b2374f9256f1961aaa4575e0d15686f7..0000000000000000000000000000000000000000 Binary files a/sip-4.19.12.tar.gz and /dev/null differ diff --git a/sip-4.19.18-no_hardcode_sip_so.patch b/sip-4.19.18-no_hardcode_sip_so.patch new file mode 100644 index 0000000000000000000000000000000000000000..86c453c678b0736f0cda5c490124aec71fbe8ed4 --- /dev/null +++ b/sip-4.19.18-no_hardcode_sip_so.patch @@ -0,0 +1,12 @@ +diff -rupN --no-dereference sip-4.19.25/configure.py sip-4.19.25-new/configure.py +--- sip-4.19.25/configure.py 2021-02-26 16:28:41.621025600 +0100 ++++ sip-4.19.25-new/configure.py 2021-10-21 13:45:54.845566597 +0200 +@@ -449,7 +449,7 @@ def create_makefiles(macros): + if sys.platform == 'win32': + mod = 'sip.lib' if opts.static else 'sip.pyd' + else: +- mod = 'libsip.a' if opts.static else 'sip.so' ++ mod = 'libsip.a' if opts.static else sip_module_name.split('.')[-1] + '.so' + + all_installs.append((mod, sip_module_dest_dir)) + diff --git a/sip-4.19.25-py_ssize_t_clean.patch b/sip-4.19.25-py_ssize_t_clean.patch new file mode 100644 index 0000000000000000000000000000000000000000..a6f10db1c66b75b220d30c222fbc82212b53a70f --- /dev/null +++ b/sip-4.19.25-py_ssize_t_clean.patch @@ -0,0 +1,52 @@ +From: Jochen Sprickerhof +Date: Fri, 5 Nov 2021 09:13:14 +0100 +Subject: Make parser not break on py_ssize_t_clean directive from SIP v6.4 + +--- + sipgen/metasrc/lexer.l | 1 + + sipgen/metasrc/parser.y | 13 +++++++++++++ + 2 files changed, 14 insertions(+) + +diff --git a/sipgen/metasrc/lexer.l b/sipgen/metasrc/lexer.l +index a52b018..c328202 100644 +--- a/sipgen/metasrc/lexer.l ++++ b/sipgen/metasrc/lexer.l +@@ -174,6 +174,7 @@ SIP_QOBJECT {return TK_QOBJECT;} + timestamp {return TK_TIMESTAMP;} + type {return TK_TYPE;} + use_argument_names {return TK_USEARGNAMES;} ++py_ssize_t_clean {return TK_PYSSIZETCLEAN;} + use_limited_api {return TK_USELIMITEDAPI;} + all_raise_py_exception {return TK_ALLRAISEPYEXC;} + call_super_init {return TK_CALLSUPERINIT;} +diff --git a/sipgen/metasrc/parser.y b/sipgen/metasrc/parser.y +index 5623dca..2d98380 100644 +--- a/sipgen/metasrc/parser.y ++++ b/sipgen/metasrc/parser.y +@@ -389,6 +389,7 @@ static scopedNameDef *fullyQualifiedName(scopedNameDef *snd); + %token TK_TIMESTAMP + %token TK_TYPE + %token TK_USEARGNAMES ++%token TK_PYSSIZETCLEAN + %token TK_USELIMITEDAPI + %token TK_ALLRAISEPYEXC + %token TK_CALLSUPERINIT +@@ -2012,6 +2013,18 @@ module_arg: TK_KWARGS '=' TK_STRING_VALUE { + $$.call_super_init = -1; + $$.def_error_handler = NULL; + } ++ | TK_PYSSIZETCLEAN '=' bool_value { ++ $$.token = TK_PYSSIZETCLEAN; ++ ++ $$.c_module = FALSE; ++ $$.kwargs = defaultKwArgs; ++ $$.name = NULL; ++ $$.use_arg_names = FALSE; ++ $$.use_limited_api = FALSE; ++ $$.all_raise_py_exc = FALSE; ++ $$.call_super_init = -1; ++ $$.def_error_handler = NULL; ++ } + | TK_USELIMITEDAPI '=' bool_value { + $$.token = TK_USELIMITEDAPI; + diff --git a/sip-4.19.25.tar.gz b/sip-4.19.25.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..e4395e680c736d558e13d6db467e95813b239f1e Binary files /dev/null and b/sip-4.19.25.tar.gz differ diff --git a/sip.spec b/sip.spec index 1a519d0348f6fd9894f6f7a0d1ad3bc1c7a14ff2..7675c748e824b9992b07c835c006b474599f76a8 100644 --- a/sip.spec +++ b/sip.spec @@ -1,137 +1,194 @@ -%{!?python2_inc:%global python2_inc %(%{__python2} -c "from distutils.sysconfig import get_python_inc; print get_python_inc(1)")} %{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")} -%{!?python2_sitearch:%global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} - +%global PYINCLUDE %{_includedir}/python%{python3_version} %global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) - %undefine _strict_symbol_defs_build - -Name: sip -Version: 4.19.12 -Release: 12 -Summary: A C/C++ library bindings generator for Python v2 and v3 -# sipgen/parser.{c.h} is GPLv2 with exceptions (bison) -License: GPLv2 and (GPLv2 with exceptions) or GPLv3 -URL: http://www.riverbankcomputing.com/software/sip/intro -Source0: http://downloads.sourceforge.net/pyqt/sip-%{version}.tar.gz -Source1: macros.sip -Source2: sip-wrapper.sh -BuildRequires: gcc-c++ sed -Obsoletes: sip-macros < %{version}-%{release} -Provides: sip-macros = %{version}-%{release} -Patch0001: sip-4.18-no_strip.patch -Patch0002: sip-4.18-no_rpath.patch - -%description -SIP is a tool that makes it very easy to create Python bindings for C and C++ -libraries. It was originally developed to create PyQt, the Python bindings for -the Qt toolkit, but can be used to create bindings for any C or C++ library. - -SIP comprises a code generator and a Python module. The code generator processes -a set of specification files and generates C or C++ code which is then compiled -to create the bindings extension module. The SIP Python module provides support -functions to the automatically generated code. - -%package -n python3-sip -Summary: A C/C++ library bindings generator for Python v3 -Provides: python3-sip-api(12) = 12.5 python3-sip-api(12) = 12.5 - +%global wx_siplib 1 +%global pyqt5_sip 1 + +Summary: SIP - Python/C++ Bindings Generator +Name: sip +Version: 4.19.25 +Release: 1 +License: GPLv2 or GPLv3 +Url: https://riverbankcomputing.com/software/sip/intro +Source0: https://riverbankcomputing.com/static/Downloads/sip/%{version}/sip-%{version}.tar.gz +Source1: macros.sip +Source10: sip-wrapper.sh + +Patch50: sip-4.18-no_strip.patch +Patch51: sip-4.18-no_rpath.patch +Patch53: sip-4.19.18-no_hardcode_sip_so.patch +Patch54: sip-4.19.25-py_ssize_t_clean.patch + +BuildRequires: make +BuildRequires: gcc-c++ +BuildRequires: sed +BuildRequires: bison +BuildRequires: flex + +Obsoletes: sip-macros < %{version}-%{release} +Provides: sip-macros = %{version}-%{release} + +%global _description\ +SIP is a tool for generating bindings for C++ classes so that they can be\ +accessed as normal Python classes. SIP takes many of its ideas from SWIG but,\ +because it is specifically designed for C++ and Python, is able to generate\ +tighter bindings. SIP is so called because it is a small SWIG.\ +\ +SIP was originally designed to generate Python bindings for KDE and so has\ +explicit support for the signal slot mechanism used by the Qt/KDE class\ +libraries. However, SIP can be used to generate Python bindings for any C++\ +class library. + +%description %_description + +%package doc +Summary: Documentation for %summary +BuildArch: noarch +%description doc +This package contains HTML documentation for SIP. +%_description + + +%package -n python3-sip +Summary: SIP - Python 3/C++ Bindings Generator +Provides: python3-sip-api(12) = 12.7 %description -n python3-sip This is the Python 3 build of SIP. -SIP is a tool that makes it very easy to create Python bindings for C and C++ -libraries. It was originally developed to create PyQt, the Python bindings for -the Qt toolkit, but can be used to create bindings for any C or C++ library. - -SIP comprises a code generator and a Python module. The code generator processes -a set of specification files and generates C or C++ code which is then compiled -to create the bindings extension module. The SIP Python module provides support -functions to the automatically generated code. - -%package -n python3-sip-devel -Summary: Files needed to generate Python v3 bindings for any C++ class library -Requires: sip = %{version}-%{release} python3-devel -BuildRequires: python3-devel +%_description +%package -n python3-sip-devel +Summary: Files needed to generate Python bindings for any C++ class library +Requires: sip = %{version}-%{release} +BuildRequires: python3-devel +Requires: python3-devel %description -n python3-sip-devel -Files needed to generate Python v3 bindings for any C++ class library - -%package -n python3-pyqt4-sip -Summary: Python 3/C++ Bindings Generator for pyqt4 -Provides: python3-pyqt4-sip-api(12) = 12.5 python3-pyqt4-sip-api(12) = 12.5 -BuildRequires: python3-devel +%{summary}. +%package -n python3-pyqt4-sip +Summary: SIP - Python 3/C++ Bindings Generator for pyqt4 +BuildRequires: python3-devel +Provides: python3-pyqt4-sip-api(12) = 12.7 %description -n python3-pyqt4-sip This is the Python 3 build of pyqt4-SIP. -SIP is a tool that makes it very easy to create Python bindings for C and C++ -libraries. It was originally developed to create PyQt, the Python bindings for -the Qt toolkit, but can be used to create bindings for any C or C++ library. - -SIP comprises a code generator and a Python module. The code generator processes -a set of specification files and generates C or C++ code which is then compiled -to create the bindings extension module. The SIP Python module provides support -functions to the automatically generated code. - -%package -n python3-pyqt5-sip -Summary: Python 3/C++ Bindings Generator for pyqt5 -BuildRequires: python3-devel -Provides: python3-pyqt5-sip-api(12) = 12.5 python3-pyqt5-sip-api(12) = 12.5 - +%package -n python3-pyqt5-sip +Summary: SIP - Python 3/C++ Bindings Generator for pyqt5 +BuildRequires: python3-devel +Provides: python3-pyqt5-sip-api(12) = 12.7 %description -n python3-pyqt5-sip This is the Python 3 build of pyqt5-SIP. -SIP is a tool that makes it very easy to create Python bindings for C and C++ -libraries. It was originally developed to create PyQt, the Python bindings for -the Qt toolkit, but can be used to create bindings for any C or C++ library. +%package -n python3-wx-siplib +Summary: SIP - Python 3/C++ Bindings Generator for wx +BuildRequires: python3-devel +Provides: python3-wx-siplib-api(12) = 12.7 +Provides: python3-wx-siplib-api(12) = 12.7 +%description -n python3-wx-siplib +This is the Python 3 build of wx-siplib. + +%_description + -SIP comprises a code generator and a Python module. The code generator processes -a set of specification files and generates C or C++ code which is then compiled -to create the bindings extension module. The SIP Python module provides support -functions to the automatically generated code. %prep -%autosetup -n %{name}-%{version} -p1 + +%setup -q -n %{name}-%{version} + +%patch50 -p1 -b .no_strip +%patch51 -p1 -b .no_rpath +%patch53 -p1 -b .no_sip_so +%patch54 -p1 -b .py_ssize_t_clean + + %build -install -d %{_target_platform}-python3 -cd %{_target_platform}-python3 -%{__python3} ../configure.py CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" +flex --outfile=sipgen/lexer.c sipgen/metasrc/lexer.l +bison --yacc --defines=sipgen/parser.h --output=sipgen/parser.c sipgen/metasrc/parser.y +sed -i -e 's|target = siplib|target = sip|g' siplib/siplib.sbf + +mkdir %{_target_platform}-python3 +pushd %{_target_platform}-python3 +%{__python3} ../configure.py \ + -b %{_bindir} -d %{python3_sitearch} -e %{PYINCLUDE} \ + CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" + %make_build -cd - -install -d %{_target_platform}-python3-pyqt4 -cd %{_target_platform}-python3-pyqt4 -%{__python3} ../configure.py --sip-module=PyQt4.sip CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" +popd + +mkdir %{_target_platform}-python3-pyqt4 +pushd %{_target_platform}-python3-pyqt4 +%{__python3} ../configure.py \ + --sip-module=PyQt4.sip \ + -b %{_bindir} -d %{python3_sitearch} -e %{PYINCLUDE} \ + CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" + %make_build -cd - -install -d %{_target_platform}-python3-pyqt5 -cd %{_target_platform}-python3-pyqt5 -%{__python3} ../configure.py --sip-module=PyQt5.sip CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" +popd + +mkdir %{_target_platform}-python3-pyqt5 +pushd %{_target_platform}-python3-pyqt5 +%{__python3} ../configure.py \ + --sip-module=PyQt5.sip \ + -b %{_bindir} -d %{python3_sitearch} -e %{PYINCLUDE} \ + CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" + %make_build -cd - +popd + +sed -i -e 's|target = sip|target = siplib|g' siplib/siplib.sbf +mkdir %{_target_platform}-python3-wx +pushd %{_target_platform}-python3-wx +%{__python3} ../configure.py \ + --sip-module=wx.siplib \ + -b %{_bindir} -d %{python3_sitearch} -e %{PYINCLUDE} \ + CXXFLAGS+="%{optflags}" CFLAGS+="%{optflags}" LFLAGS+="%{?__global_ldflags}" + +%make_build +popd +sed -i -e 's|target = siplib|target = sip|g' siplib/siplib.sbf + + %install %make_install -C %{_target_platform}-python3 -ln -s sip %{buildroot}%{_bindir}/python3-sip %make_install -C %{_target_platform}-python3-pyqt4 %make_install -C %{_target_platform}-python3-pyqt5 -install -d %{buildroot}%{python3_sitearch}/__pycache__/exclude_rpm_hack -install %{SOURCE2} %{buildroot}%{_bindir}/sip-pyqt4 -install %{SOURCE2} %{buildroot}%{_bindir}/sip-pyqt5 +%make_install -C %{_target_platform}-python3-wx +mv %{buildroot}%{python3_sitearch}/wx/sip.pyi %{buildroot}%{python3_sitearch}/wx/siplib.pyi +ln -s sip %{buildroot}%{_bindir}/python3-sip +mkdir -p %{buildroot}%{python3_sitearch}/__pycache__/exclude_rpm_hack + +install %{SOURCE10} %{buildroot}%{_bindir}/sip-pyqt4 +install %{SOURCE10} %{buildroot}%{_bindir}/sip-pyqt5 +install %{SOURCE10} %{buildroot}%{_bindir}/sip-wx sed -i -e 's|@SIP_MODULE@|PyQt4.sip|g' %{buildroot}%{_bindir}/sip-pyqt4 sed -i -e 's|@SIP_MODULE@|PyQt5.sip|g' %{buildroot}%{_bindir}/sip-pyqt5 -install -d %{buildroot}%{_datadir}/sip +sed -i -e 's|@SIP_MODULE@|wx.siplib|g' %{buildroot}%{_bindir}/sip-wx + +mkdir -p %{buildroot}%{_datadir}/sip install -D -p -m644 %{SOURCE1} %{buildroot}%{rpm_macros_dir}/macros.sip +pushd doc +find html/ -type f -exec install -m0644 -D {} %{buildroot}%{_pkgdocdir}/{} \; +popd + %files %doc README LICENSE LICENSE-GPL2 LICENSE-GPL3 %{_bindir}/sip +# sip-wrappers %{_bindir}/sip-pyqt4 %{_bindir}/sip-pyqt5 +%{_bindir}/sip-wx +# compat symlink %{_bindir}/python3-sip %dir %{_datadir}/sip/ %{rpm_macros_dir}/macros.sip +%files doc +%{_pkgdocdir}/html + %files -n python3-sip-devel -%{python3_inc}/sip.h +%{PYINCLUDE}/sip.h %{python3_sitearch}/sipconfig.py* %{python3_sitearch}/sipdistutils.py* %{python3_sitearch}/__pycache__/* @@ -144,15 +201,26 @@ install -D -p -m644 %{SOURCE1} %{buildroot}%{rpm_macros_dir}/macros.sip %files -n python3-pyqt4-sip %doc NEWS README LICENSE LICENSE-GPL2 LICENSE-GPL3 +%dir %{python3_sitearch}/PyQt4/ %{python3_sitearch}/PyQt4/sip.* %{python3_sitearch}/PyQt4_sip-%{version}.dist-info/ %files -n python3-pyqt5-sip %doc NEWS README LICENSE LICENSE-GPL2 LICENSE-GPL3 +%dir %{python3_sitearch}/PyQt5/ %{python3_sitearch}/PyQt5/sip.* %{python3_sitearch}/PyQt5_sip-%{version}.dist-info/ +%files -n python3-wx-siplib +%doc NEWS README LICENSE LICENSE-GPL2 LICENSE-GPL3 +%dir %{python3_sitearch}/wx/ +%{python3_sitearch}/wx/siplib.* +%{python3_sitearch}/wx_siplib-%{version}.dist-info/ + %changelog +* Sat Jan 29 2022 chenchen - 4.19.25-1 +- update to 4.19.25 + * Tue Jan 05 2021 maminjie - 4.19.12-12 - resolve installation conflicts of sub-packages - fix license diff --git a/sip.yaml b/sip.yaml index 07665570c0f547cd708bf0d13ec0ddacee49e7f3..e91d1bd9181ae4ba1786d3fea0df1576ce0bc0f0 100644 --- a/sip.yaml +++ b/sip.yaml @@ -1,4 +1,4 @@ version_control: hg src_repo: https://www.riverbankcomputing.com/hg/sip tag_prefix: ^ -seperator: . +separator: .