From d2618baf88b5af82effc90148384076a7a13a4bd Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Jul 29 2018 21:30:14 +0000 Subject: Rename packages, add PyQt5 private sip modules --- diff --git a/mingw-sip.spec b/mingw-sip.spec index 7ac544a..a1004fd 100644 --- a/mingw-sip.spec +++ b/mingw-sip.spec @@ -17,7 +17,7 @@ Name: mingw-%{pkgname} Summary: MinGW Windows SIP Version: 4.19.12 -Release: 1%{?pre:.%pre}%{?dist} +Release: 2%{?pre:.%pre}%{?dist} # sipgen/parser.{c.h} is GPLv3+ with exceptions (bison) License: GPLv2 or GPLv3 and (GPLv3+ with exceptions) @@ -57,19 +57,39 @@ BuildRequires: mingw64-qt5-qtbase %description MinGW Windows SIP. -%package -n mingw32-%{pkgname} +%package -n mingw32-python2-%{pkgname} Summary: MinGW Windows SIP +Obsoletes: mingw32-%{pkgname} < 4.19.12-2 +Provides: mingw32-%{pkgname} = %{version}-%{release} Requires: mingw32-python2 -%description -n mingw32-%{pkgname} +%description -n mingw32-python2-%{pkgname} MinGW Windows SIP. -%package -n mingw64-%{pkgname} +%package -n mingw32-python2-%{pkgname}-PyQt5 +Summary: MinGW Windows SIP module for PyQt5 +Requires: mingw32-python2-%{pkgname} + +%description -n mingw32-python2-%{pkgname}-PyQt5 +MinGW Windows SIP. + + +%package -n mingw64-python2-%{pkgname} Summary: MinGW Windows SIP +Obsoletes: mingw64-%{pkgname} < 4.19.12-2 +Provides: mingw64-%{pkgname} = %{version}-%{release} Requires: mingw64-python2 -%description -n mingw64-%{pkgname} +%description -n mingw64-python2-%{pkgname} +MinGW Windows SIP. + + +%package -n mingw64-python2-%{pkgname}-PyQt5 +Summary: MinGW Windows SIP module for PyQt5 +Requires: mingw64-python2-%{pkgname} + +%description -n mingw64-python2-%{pkgname}-PyQt5 MinGW Windows SIP. @@ -81,38 +101,65 @@ MinGW Windows SIP. cp -a %{SOURCE5} specs/mingw-win32-g++ cp -a %{SOURCE6} specs/mingw-win64-g++ -rm -rf %{win32_dir} -rm -rf %{win64_dir} -rm -rf %{win32_host_dir} -rm -rf %{win64_host_dir} -cp -a . %{win32_dir} -cp -a . %{win64_dir} -cp -a . %{win32_host_dir} -cp -a . %{win64_host_dir} - %build -pushd %{win32_host_dir} -%{__python2} configure.py --configuration=%{SOURCE1} -d %{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/ \ +mkdir build_mingw32_host +pushd build_mingw32_host +%{__python2} ../configure.py --configuration=%{SOURCE1} -d %{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/ \ CXXFLAGS="%{optflags} -I/usr/include/python2.7" CFLAGS="%{optflags} -I/usr/include/python2.7" LFLAGS="%{?__global_ldflags} -lpython2.7" %make_build popd -pushd %{win64_host_dir} -%{__python2} configure.py --configuration=%{SOURCE2} -d %{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/ \ +mkdir build_mingw64_host +pushd build_mingw64_host +%{__python2} ../configure.py --configuration=%{SOURCE2} -d %{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/ \ CXXFLAGS="%{optflags} -I/usr/include/python2.7" CFLAGS="%{optflags} -I/usr/include/python2.7" LFLAGS="%{?__global_ldflags} -lpython2.7" %make_build popd -pushd %{win32_dir} -mingw32-python configure.py --configuration=%{SOURCE3} --use-qmake --no-stubs -p mingw-win32-g++ \ +mkdir build_mingw32 +pushd build_mingw32 +mingw32-python ../configure.py --configuration=%{SOURCE3} --use-qmake --no-stubs -p mingw-win32-g++ \ CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}" %mingw32_qmake_qt5 sip.pro %mingw32_make %{?_smp_mflags} popd -pushd %{win64_dir} -mingw64-python configure.py --configuration=%{SOURCE4} --use-qmake --no-stubs -p mingw-win64-g++ \ +mkdir build_mingw64 +pushd build_mingw64 +mingw64-python ../configure.py --configuration=%{SOURCE4} --use-qmake --no-stubs -p mingw-win64-g++ \ + CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}" +%mingw64_qmake_qt5 sip.pro +%mingw64_make %{?_smp_mflags} +popd + + +# Private module for PyQt5 +mkdir build_mingw32_host_pyqt5 +pushd build_mingw32_host_pyqt5 +%{__python2} ../configure.py --configuration=%{SOURCE1} -d %{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/ --sip-module PyQt5.sip --no-tools \ + CXXFLAGS="%{optflags} -I/usr/include/python2.7" CFLAGS="%{optflags} -I/usr/include/python2.7" LFLAGS="%{?__global_ldflags} -lpython2.7" +%make_build +popd + +mkdir build_mingw64_host_pyqt5 +pushd build_mingw64_host_pyqt5 +%{__python2} ../configure.py --configuration=%{SOURCE2} -d %{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/ --sip-module PyQt5.sip --no-tools \ + CXXFLAGS="%{optflags} -I/usr/include/python2.7" CFLAGS="%{optflags} -I/usr/include/python2.7" LFLAGS="%{?__global_ldflags} -lpython2.7" +%make_build +popd + +mkdir build_mingw32_pyqt5 +pushd build_mingw32_pyqt5 +mingw32-python ../configure.py --configuration=%{SOURCE3} --use-qmake --no-stubs -p mingw-win32-g++ --sip-module PyQt5.sip --no-tools \ + CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}" +%mingw32_qmake_qt5 sip.pro +%mingw32_make %{?_smp_mflags} +popd + +mkdir build_mingw64_pyqt5 +pushd build_mingw64_pyqt5 +mingw64-python ../configure.py --configuration=%{SOURCE4} --use-qmake --no-stubs -p mingw-win64-g++ --sip-module PyQt5.sip --no-tools \ CXXFLAGS="%{optflags}" CFLAGS="%{optflags}" LFLAGS="%{?__global_ldflags}" %mingw64_qmake_qt5 sip.pro %mingw64_make %{?_smp_mflags} @@ -120,10 +167,14 @@ popd %install -%make_install -C %{win32_host_dir} -%make_install -C %{win64_host_dir} -%mingw32_make INSTALL_ROOT=%{buildroot} -C %{win32_dir} install -%mingw64_make INSTALL_ROOT=%{buildroot} -C %{win64_dir} install +%make_install -C build_mingw32_host +%make_install -C build_mingw64_host +%mingw32_make INSTALL_ROOT=%{buildroot} -C build_mingw32 install +%mingw64_make INSTALL_ROOT=%{buildroot} -C build_mingw64 install +%make_install -C build_mingw32_host_pyqt5 +%make_install -C build_mingw64_host_pyqt5 +%mingw32_make INSTALL_ROOT=%{buildroot} -C build_mingw32_pyqt5 install +%mingw64_make INSTALL_ROOT=%{buildroot} -C build_mingw64_pyqt5 install mkdir -p %{buildroot}%{mingw32_datadir}/sip mkdir -p %{buildroot}%{mingw64_datadir}/sip @@ -133,34 +184,48 @@ ln -s %{_prefix}/%{mingw32_target}/bin/sip %{buildroot}%{_bindir}/mingw32-sip ln -s %{_prefix}/%{mingw64_target}/bin/sip %{buildroot}%{_bindir}/mingw64-sip # Exclude debug files from the main files (note: the debug files are only created after %%install, so we can't search for them directly) -find %{buildroot}%{mingw32_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw32-%{pkgname}.debugfiles -find %{buildroot}%{mingw64_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw64-%{pkgname}.debugfiles +find %{buildroot}%{mingw32_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw32-python2-%{pkgname}.debugfiles +find %{buildroot}%{mingw64_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw64-python2-%{pkgname}.debugfiles -%files -n mingw32-%{pkgname} -f mingw32-%{pkgname}.debugfiles +%files -n mingw32-python2-%{pkgname} -f mingw32-python2-%{pkgname}.debugfiles %license LICENSE LICENSE-GPL2 LICENSE-GPL3 %{_prefix}/%{mingw32_target}/bin/sip %{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/* +%exclude %{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/PyQt5* %{_bindir}/mingw32-sip %{mingw32_bindir}/sip.exe %{mingw32_python2_sitearch}/* -%exclude %{mingw32_python2_sitearch}/*.debug +%exclude %{mingw32_python2_sitearch}/PyQt5* %{mingw32_includedir}/python2.7/sip.h %dir %{mingw32_datadir}/sip -%files -n mingw64-%{pkgname} -f mingw64-%{pkgname}.debugfiles +%files -n mingw32-python2-%{pkgname}-PyQt5 +%{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/PyQt5* +%{mingw32_python2_sitearch}/PyQt5* + +%files -n mingw64-python2-%{pkgname} -f mingw64-python2-%{pkgname}.debugfiles %license LICENSE LICENSE-GPL2 LICENSE-GPL3 %{_prefix}/%{mingw64_target}/bin/sip %{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/* +%exclude %{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/PyQt5* %{_bindir}/mingw64-sip %{mingw64_bindir}/sip.exe %{mingw64_python2_sitearch}/* -%exclude %{mingw64_python2_sitearch}/*.debug +%exclude %{mingw64_python2_sitearch}/PyQt5* %{mingw64_includedir}/python2.7/sip.h %dir %{mingw64_datadir}/sip +%files -n mingw64-python2-%{pkgname}-PyQt5 +%{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/PyQt5* +%{mingw64_python2_sitearch}/PyQt5* + %changelog +* Sun Jul 29 2018 Sandro Mani - 4.19.12-2 +- Rename mingw{32,64}-sip to mingw{32,64}-python2-sip +- Add PyQt5 private sip modules (Sigh...) + * Wed Jul 11 2018 Sandro Mani - 4.19.12-1 - Update to 4.19.12 diff --git a/sip-4.19-config.patch b/sip-4.19-config.patch index 9d1d8e5..c299dae 100644 --- a/sip-4.19-config.patch +++ b/sip-4.19-config.patch @@ -1,6 +1,6 @@ diff -rupN sip-4.19.12/configure.py sip-4.19.12-new/configure.py --- sip-4.19.12/configure.py 2018-07-05 11:55:19.000000000 +0200 -+++ sip-4.19.12-new/configure.py 2018-07-13 00:04:28.873900831 +0200 ++++ sip-4.19.12-new/configure.py 2018-07-29 22:19:03.828858076 +0200 @@ -271,8 +271,8 @@ def create_config(module, template, macr "sip_inc_dir": sip_inc_dir, "sip_root_dir": sip_root_dir, @@ -46,7 +46,15 @@ diff -rupN sip-4.19.12/configure.py sip-4.19.12-new/configure.py # Note that mk_distinfo.py won't exist if we are building from the # repository. if opts.distinfo and os.path.isfile(mk_distinfo): -@@ -409,7 +413,7 @@ def create_makefiles(macros): +@@ -364,6 +368,7 @@ def create_makefiles(macros): + if opts.use_qmake: + sipconfig.inform("Creating sip code generator .pro file...") + ++ os.makedirs("sipgen") + pro = open(os.path.join("sipgen", "sipgen.pro"), "w") + + pro.write("TEMPLATE = app\n") +@@ -409,7 +414,7 @@ def create_makefiles(macros): # The code generator installs. if not opts.no_tools: sip_dir, sip_exe = os.path.split(cfg.sip_bin) @@ -55,7 +63,7 @@ diff -rupN sip-4.19.12/configure.py sip-4.19.12-new/configure.py sip_exe += '.exe' all_installs.append((sip_exe, sip_dir)) -@@ -427,7 +431,7 @@ def create_makefiles(macros): +@@ -427,12 +432,13 @@ def create_makefiles(macros): all_installs.extend(module_installs) if not opts.no_module: @@ -64,7 +72,13 @@ diff -rupN sip-4.19.12/configure.py sip-4.19.12-new/configure.py all_installs.append(('sip' + mod_ext, cfg.sip_module_dir)) if opts.use_qmake: -@@ -458,7 +462,8 @@ def create_makefiles(macros): + sipconfig.inform("Creating sip module .pro file...") + ++ os.makedirs("siplib") + pro = open(os.path.join("siplib", "siplib.pro"), "w") + + pro.write("TEMPLATE = lib\n") +@@ -458,7 +464,8 @@ def create_makefiles(macros): if not opts.static: # These only need to be correct for Windows. debug_suffix = "_d" if opts.debug else "" @@ -74,7 +88,7 @@ diff -rupN sip-4.19.12/configure.py sip-4.19.12-new/configure.py pro.write(""" win32 { -@@ -482,7 +487,7 @@ QMAKE_POST_LINK = $(COPY_FILE) $$PY_MODU +@@ -482,7 +489,7 @@ QMAKE_POST_LINK = $(COPY_FILE) $$PY_MODU target.CONFIG = no_check_exist target.files = $$PY_MODULE