use pyuic5.sh wrapper that supports both pythons

This commit is contained in:
Rex Dieter 2015-06-05 19:40:32 -05:00
parent d69b01a396
commit d52e9e9951
2 changed files with 21 additions and 3 deletions

View File

@ -24,6 +24,8 @@ Source0: http://www.riverbankcomputing.com/static/Downloads/PyQt5/PyQt-gpl-%{ver
Source0: http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-%{version}/PyQt-gpl-%{version}.tar.gz Source0: http://downloads.sourceforge.net/project/pyqt/PyQt5/PyQt-%{version}/PyQt-gpl-%{version}.tar.gz
%endif %endif
Source1: macros.pyqt5 Source1: macros.pyqt5
# wrapper, see https://bugzilla.redhat.com/show_bug.cgi?id=1193107#c9
Source2: pyuic5.sh
## upstream patches ## upstream patches
@ -99,8 +101,6 @@ Summary: Python 3 bindings for Qt5
Requires: python3-qt5%{?_isa} = %{version}-%{release} Requires: python3-qt5%{?_isa} = %{version}-%{release}
Requires: qt5-qtbase-devel Requires: qt5-qtbase-devel
Requires: python3-sip-devel Requires: python3-sip-devel
# FIXME: -devel scripts require base/python(2) runtime, https://bugzilla.redhat.com/1193107
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: python3-PyQt5-devel = %{version}-%{release} Provides: python3-PyQt5-devel = %{version}-%{release}
%description -n python3-qt5-devel %description -n python3-qt5-devel
Files needed to build other bindings for C++ classes that inherit from any Files needed to build other bindings for C++ classes that inherit from any
@ -191,6 +191,17 @@ sed -i \
-e "s|@@EVR@@|%{?epoch:%{epoch:}}%{version}-%{release}|g" \ -e "s|@@EVR@@|%{?epoch:%{epoch:}}%{version}-%{release}|g" \
%{buildroot}%{rpm_macros_dir}/macros.pyqt5 %{buildroot}%{rpm_macros_dir}/macros.pyqt5
%if 0%{?_with_python3}
# install pyuic5 wrapper to handle both/either python2/python3
rm -fv %{buildroot}%{_bindir}/pyuic5
install -p -m755 -D %{SOURCE2} \
%{buildroot}%{_bindir}/pyuic5
sed -i \
-e "s|@PYTHON3@|%{__python3}|g" \
-e "s|@PYTHON2@|%{__python2}|g" \
%{buildroot}%{_bindir}/pyuic5
%endif
%if 0%{?with_python2} %if 0%{?with_python2}
%files %files
@ -305,7 +316,7 @@ sed -i \
%changelog %changelog
* Fri Jun 05 2015 Rex Dieter <rdieter@fedoraproject.org> - 5.4.1-5 * Fri Jun 05 2015 Rex Dieter <rdieter@fedoraproject.org> - 5.4.1-5
- -devel: Requires: python-qt5 (#1193107) - wrong python release used in pyuic5 launch script (#1193107)
- -doc: add qsci doc QyQt5.api content - -doc: add qsci doc QyQt5.api content
- enable Qt5WebChannel/Qt5WebSockets support - enable Qt5WebChannel/Qt5WebSockets support

7
pyuic5.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/sh
@PYTHON3@ -c "import PyQt5" &> /dev/null
if [ $? -eq 0 ]; then
exec @PYTHON3@ -m PyQt5.uic.pyuic ${1+"$@"}
else
exec @PYTHON2@ -m PyQt5.uic.pyuic ${1+"$@"}
fi