Blame mingw-python-qt5.spec

0626210
%{?mingw_package_header}
0626210
0626210
# Disable debuginfo subpackages and debugsource packages for now to use old logic
0626210
%undefine _debugsource_packages
0626210
%undefine _debuginfo_subpackages
0626210
0626210
# Override the __debug_install_post argument as this package
0626210
# contains both native as well as cross compiled binaries
0626210
%global __debug_install_post %%{mingw_debug_install_post}; %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%%{?buildsubdir}" %{nil}
0626210
0626210
0626210
%global native_dir %{_builddir}/native-%{name}-%{version}-%{release}
0626210
%global win64_dir %{_builddir}/mingw64-%{name}-%{version}-%{release}
0626210
0626210
%global pkgname python-qt5
4c54140
%global qt_ver 5.11.1
a6aec6a
a2040db
#define pre dev1805251538
0626210
0626210
Name:           mingw-%{pkgname}
0626210
Summary:        MinGW Windows PyQt5
a2040db
Version:        5.11.2
a2040db
Release:        1%{?pre:.%pre}%{?dist}
0626210
0626210
# GPLv2 exceptions(see GPL_EXCEPTIONS*.txt)
0626210
License:        (GPLv3 or GPLv2 with exceptions) and BSD
0626210
Url:            http://www.riverbankcomputing.com/software/pyqt/
a6aec6a
%if 0%{?pre:1}
a6aec6a
Source0: http://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt5_gpl-%{version}.%{pre}.tar.gz
a6aec6a
%else
a6aec6a
Source0: http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-%{version}/PyQt5_gpl-%{version}.tar.gz
a6aec6a
%endif
a2040db
# Don't see why enum34 should be required
a2040db
Patch0:         PyQt5_enum.patch
a2040db
# Don't see how "from PyQt5 import sip" could ever work
a2040db
Patch1:         PyQt5_sip.patch
a2040db
# Fix broken mk_distinfo install prefix handling (just took the mk_distinfo from sip which works)
a2040db
Patch2:         PyQt5_mkdistinfo.patch
0626210
# Hack in WS_WIN instead of WS_X11 in sip-flags
a2040db
Patch3:         PyQt5_wswin.patch
a2040db
# Tweak configure for cross build
a2040db
Patch4:         PyQt5_configure.patch
a6aec6a
0626210
77495c7
BuildRequires:  gcc-c++
77495c7
BuildRequires:  make
0626210
BuildRequires:  python2-devel
0626210
BuildRequires:  sip-devel
77495c7
0626210
BuildRequires:  qt5-qtbase-devel >= %{qt_ver}
6dd818e
BuildRequires:  qt5-qtlocation-devel >= %{qt_ver}
6dd818e
BuildRequires:  qt5-qtmultimedia-devel >= %{qt_ver}
6dd818e
BuildRequires:  qt5-qtsensors-devel >= %{qt_ver}
a2040db
BuildRequires:  qt5-qtserialport-devel >= %{qt_ver}
0626210
BuildRequires:  qt5-qtsvg-devel >= %{qt_ver}
0626210
BuildRequires:  qt5-qttools-devel >= %{qt_ver}
b0f6fb3
BuildRequires:  qt5-qtwebkit-devel
0626210
BuildRequires:  qt5-qtxmlpatterns-devel >= %{qt_ver}
0626210
004cf8b
BuildRequires:  mingw32-filesystem >= 102
0626210
BuildRequires:  mingw32-gcc-c++
0626210
BuildRequires:  mingw32-python2
0626210
BuildRequires:  mingw32-qt5-qtbase >= %{qt_ver}
6dd818e
BuildRequires:  mingw32-qt5-qtlocation >= %{qt_ver}
6dd818e
BuildRequires:  mingw32-qt5-qtmultimedia >= %{qt_ver}
6dd818e
BuildRequires:  mingw32-qt5-qtsensors >= %{qt_ver}
a2040db
BuildRequires:  mingw32-qt5-qtserialport >= %{qt_ver}
0626210
BuildRequires:  mingw32-qt5-qtsvg >= %{qt_ver}
0626210
BuildRequires:  mingw32-qt5-qttools >= %{qt_ver}
b0f6fb3
BuildRequires:  mingw32-qt5-qtwebkit
0626210
BuildRequires:  mingw32-qt5-qtxmlpatterns >= %{qt_ver}
0626210
BuildRequires:  mingw32-sip
0626210
004cf8b
BuildRequires:  mingw64-filesystem >= 102
0626210
BuildRequires:  mingw64-gcc-c++
0626210
BuildRequires:  mingw64-python2
0626210
BuildRequires:  mingw64-qt5-qtbase >= %{qt_ver}
6dd818e
BuildRequires:  mingw64-qt5-qtlocation >= %{qt_ver}
6dd818e
BuildRequires:  mingw64-qt5-qtmultimedia >= %{qt_ver}
6dd818e
BuildRequires:  mingw64-qt5-qtsensors >= %{qt_ver}
a2040db
BuildRequires:  mingw64-qt5-qtserialport >= %{qt_ver}
0626210
BuildRequires:  mingw64-qt5-qtsvg >= %{qt_ver}
0626210
BuildRequires:  mingw64-qt5-qttools >= %{qt_ver}
b0f6fb3
BuildRequires:  mingw64-qt5-qtwebkit
0626210
BuildRequires:  mingw64-qt5-qtxmlpatterns >= %{qt_ver}
0626210
BuildRequires:  mingw64-sip
0626210
0626210
%description
0626210
MinGW Windows PyQt5
0626210
0626210
%package -n mingw32-python2-qt5
0626210
Summary:       MinGW Windows Python2-Qt5
0626210
Requires:      qt5-qtbase = %{qt_ver}
0626210
Requires:      sip
0626210
Requires:      mingw32-qt5-qtbase >= %{qt_ver}
0626210
Requires:      mingw32-qt5-qttools >= %{qt_ver}
0626210
Requires:      mingw32-sip
0626210
0626210
%description -n mingw32-python2-qt5
0626210
MinGW Windows Python2-Qt5
0626210
0626210
0626210
%package -n mingw64-python2-qt5
0626210
Summary:       MinGW Windows Python2-Qt5
0626210
Requires:      qt5-qtbase = %{qt_ver}
0626210
Requires:      sip
0626210
Requires:      mingw64-qt5-qtbase >= %{qt_ver}
0626210
Requires:      mingw64-qt5-qttools >= %{qt_ver}
0626210
Requires:      mingw64-sip
0626210
0626210
%description -n mingw64-python2-qt5
0626210
MinGW Windows Python2-Qt5
0626210
0626210
0626210
%{?mingw_debug_package}
0626210
0626210
0626210
%prep
a6aec6a
%setup -q -n PyQt5_gpl-%{version}%{?pre:.%pre}
a2040db
%patch0 -p1
a2040db
%patch1 -p1
a6aec6a
%patch2 -p1
0626210
rm -rf %{native_dir}
0626210
cp -a . %{native_dir}
0626210
pushd %{native_dir}
a2040db
%patch3 -p1
0626210
popd
0626210
a2040db
%patch4 -p1
0626210
rm -rf %{win64_dir}
0626210
cp -a . %{win64_dir}
0626210
0626210
%build
0626210
PREFIX=%{mingw32_prefix} mingw32-python configure.py \
0626210
  --assume-shared \
0626210
  --confirm-license \
0626210
  --sip=/usr/bin/mingw32-sip \
0626210
  --qmake=%{mingw32_qmake_qt5} \
0626210
  --no-qsci-api \
0626210
  --verbose
0626210
0626210
%mingw32_make %{?_smp_mflags}
0626210
0626210
(
0626210
cd %{win64_dir}
0626210
PREFIX=%{mingw64_prefix} mingw64-python configure.py \
0626210
  --assume-shared \
0626210
  --confirm-license \
0626210
  --sip=/usr/bin/mingw64-sip \
0626210
  --qmake=%{mingw64_qmake_qt5} \
0626210
  --no-qsci-api \
0626210
  --verbose
0626210
0626210
%mingw64_make %{?_smp_mflags}
0626210
)
0626210
0626210
(
0626210
cd %{native_dir}
0626210
%{__python2} configure.py \
0626210
  --assume-shared \
0626210
  --confirm-license \
0626210
  --qmake=%{_qt5_qmake} \
0626210
  --no-qsci-api \
0626210
  --verbose
0626210
0626210
%make_build
0626210
)
0626210
0626210
0626210
%install
0626210
%mingw32_make install INSTALL_ROOT=%{buildroot}
0626210
%mingw32_make install INSTALL_ROOT=%{buildroot} -C %{win64_dir}
0626210
%mingw32_make install INSTALL_ROOT=%{buildroot} -C %{native_dir}
0626210
0626210
# Remove Python 3 code from Python 2.x directory
0626210
rm -rf %{buildroot}%{mingw32_python2_sitearch}/PyQt5/uic/port_v3/
0626210
rm -rf %{buildroot}%{mingw64_python2_sitearch}/PyQt5/uic/port_v3/
0626210
rm -rf %{buildroot}%{python2_sitearch}/PyQt5/uic/port_v3/
0626210
0626210
# Move native build to host libs
0626210
find %{buildroot}%{python2_sitearch}/PyQt5/ -type f -name '*.so' -exec chmod +x {} \;
0626210
mkdir -p %{buildroot}%{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/
0626210
mkdir -p %{buildroot}%{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/
0626210
cp -a %{buildroot}%{python2_sitearch}/PyQt5 %{buildroot}%{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/PyQt5
0626210
cp -a %{buildroot}%{python2_sitearch}/PyQt5 %{buildroot}%{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/PyQt5
0626210
0626210
# Remove pylupdate, pyuic and pyrcc shell scripts
0626210
rm -f %{buildroot}%{mingw32_bindir}/py{lupdate,rcc,uic}5
0626210
rm -f %{buildroot}%{mingw64_bindir}/py{lupdate,rcc,uic}5
0626210
0626210
# Remove unused stuff
0626210
rm -rf %{buildroot}%{_libdir}
0626210
rm -rf %{buildroot}%{_bindir}
0626210
rm -rf %{buildroot}%{_datadir}
0626210
004cf8b
# Exclude debug files from the main files (note: the debug files are only created after %%install, so we can't search for them directly)
004cf8b
find %{buildroot}%{mingw32_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw32-%{pkgname}.debugfiles
004cf8b
find %{buildroot}%{mingw64_prefix} | grep -E '.(exe|dll|pyd)$' | sed 's|^%{buildroot}\(.*\)$|%%exclude \1.debug|' > mingw64-%{pkgname}.debugfiles
0626210
0626210
004cf8b
%files -n mingw32-python2-qt5 -f mingw32-%{pkgname}.debugfiles
0626210
%license LICENSE
0626210
%{_prefix}/%{mingw32_target}/lib/python2.7/site-packages/PyQt5/
0626210
%{mingw32_python2_sitearch}/PyQt5/
a2040db
%{mingw32_python2_sitearch}/PyQt5-%{version}.dist-info/
0626210
%{mingw32_libdir}/qt5/plugins/designer/pyqt5.dll
0626210
%{mingw32_libdir}/qt5/plugins/PyQt5/
0626210
%{mingw32_datadir}/sip/PyQt5
0626210
0626210
004cf8b
%files -n mingw64-python2-qt5 -f mingw64-%{pkgname}.debugfiles
0626210
%license LICENSE
0626210
%{_prefix}/%{mingw64_target}/lib/python2.7/site-packages/PyQt5/
0626210
%{mingw64_python2_sitearch}/PyQt5/
a2040db
%{mingw64_python2_sitearch}/PyQt5-%{version}.dist-info/
0626210
%{mingw64_libdir}/qt5/plugins/designer/pyqt5.dll
0626210
%{mingw64_libdir}/qt5/plugins/PyQt5/
0626210
%{mingw64_datadir}/sip/PyQt5
0626210
0626210
0626210
%changelog
a2040db
* Fri Jul 20 2018 Sandro Mani <manisandro@gmail.com> - 5.11.2-1
a2040db
- Update to 5.11.2
a2040db
- Enable qtserialport bindings
a2040db
ef16c37
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.10.2-0.3.dev1805251538
ef16c37
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
ef16c37
4c54140
* Thu Jun 21 2018 Sandro Mani <manisandro@gmail.com> - 5.10.2-0.2.dev1805251538
4c54140
- Rebuild for qt5-5.11.1
4c54140
a6aec6a
* Fri Jun 01 2018 Sandro Mani <manisandro@gmail.com> - 5.10.2-0.1.dev1805251538
a6aec6a
- Update to 5.10.2.dev1805251538
a6aec6a
2b15a68
* Wed Mar 07 2018 Sandro Mani <manisandro@gmail.com> - 5.10.1-1
2b15a68
- Update to 5.10.1
2b15a68
77495c7
* Mon Feb 19 2018 Sandro Mani <manisandro@gmail.com> - 5.10-5
77495c7
- Add missing BR: gcc-c++, make
77495c7
1e09c4b
* Sat Feb 17 2018 Sandro Mani <manisandro@gmail.com> - 5.10-4
1e09c4b
- Bump qt_ver to 5.10.1
1e09c4b
a5becfe
* Fri Feb 16 2018 Sandro Mani <manisandro@gmail.com> - 5.10-3
a5becfe
- Rebuild for qt5-5.10.1
a5becfe
f384eef
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.10-2
f384eef
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f384eef
3d083b6
* Wed Jan 24 2018 Sandro mani <manisandro@gmail.com> - 5.10-1
3d083b6
- Update to 5.10
3d083b6
cc2fa8b
* Mon Jan 08 2018 Sandro Mani <manisandro@gmail.com> - 5.9.2-3
cc2fa8b
- Support Qt5 newer than just 5.9.3 (+5.9.4,5.10.0,5.10.1)
cc2fa8b
196ea0f
* Thu Dec 21 2017 Sandro Mani <manisandro@gmail.com> - 5.9.2-2
196ea0f
- Rebuild for qt5-5.10.0
196ea0f
56f6d41
* Mon Nov 27 2017 Sandro Mani <manisandro@gmail.com> - 5.9.2-1
56f6d41
- Update to 5.9.2
56f6d41
b8ee76d
* Sat Nov 04 2017 Sandro Mani <manisandro@gmail.com> - 5.9.1-1
b8ee76d
- Update to 5.9.1
b8ee76d
6dd818e
* Wed Oct 11 2017 Sandro Mani <manisandro@gmail.com> - 5.9-6
6dd818e
- Also build qtlocation, qtmultimedia and qtsensor bindings
6dd818e
d2a6a34
* Wed Oct 11 2017 Jan Grulich <jgrulich@redhat.com> - 5.9-5
d2a6a34
- Bump qt_ver to 5.9.2
d2a6a34
004cf8b
* Tue Sep 19 2017 Sandro Mani <manisandro@gmail.com> - 5.9-4
004cf8b
- Rebuild (mingw-filesystem)
004cf8b
0626210
* Tue Sep 05 2017 Sandro Mani <manisandro@gmail.com> - 5.9-3
0626210
- Require mingw{32,64}-qt5-qttools for directory ownership
0626210
0626210
* Wed Aug 09 2017 Sandro Mani <manisandro@gmail.com> - 5.9-2
0626210
- Bump qt_ver to 5.9.1
0626210
0626210
* Tue Jul 11 2017 Sandro Mani <manisandro@gmail.com> - 5.9-1
0626210
- Update to 5.9
0626210
0626210
* Sat May 06 2017 Sandro Mani <manisandro@gmail.com> - 5.8.2-1
0626210
- Initial package