1
0

Accepting request 874295 from home:bnavigator:pyqt

- update to version 0.1
- Add PyQt6 support
- Add link to wiki in macros file
- Remove python-rpm-macros interpreter workaround. The
  inconsistency never made it into a released package.

OBS-URL: https://build.opensuse.org/request/show/874295
OBS-URL: https://build.opensuse.org/package/show/KDE:Qt5/python-pyqt-rpm-macros?expand=0&rev=10
This commit is contained in:
Benjamin Greiner 2021-02-22 11:28:23 +00:00 committed by Git OBS Bridge
parent 4fece45155
commit e40fff8e07
3 changed files with 29 additions and 9 deletions

View File

@ -1,9 +1,17 @@
# Documentation: https://en.opensuse.org/openSUSE:Packaging_PyQt_and_SIP
%sip4_only() %{?use_sip4:%{**}} %sip4_only() %{?use_sip4:%{**}}
%sip5_only() %{?!use_sip4:%{**}} %sip5_only() %{?!use_sip4:%{**}}
%pyqt5_sipdir %{?use_sip4:%_datadir/sip/PyQt5-%python_bin_suffix}%{?!use_sip4:%python_sitearch/PyQt5/bindings} %pyqt5_sipdir %{?use_sip4:%_datadir/sip/PyQt5-%python_bin_suffix}%{?!use_sip4:%python_sitearch/PyQt5/bindings}
%pyqt6_sipdir %{python_sitearch}/PyQt6/bindings
%_pyqt_datadir %{?pyqt_build_for_qt6:%{_qt6_datadir}}%{!?pyqt_build_for_qt6:%{_libqt5_datadir}}
%_pyqt_qmake %{?pyqt_build_for_qt6:%{__qt6_qmake}}%{!?pyqt_build_for_qt6:%{_libqt5_qmake}}
%pyqt_build(c:m:s:v) \ %pyqt_build(c:m:s:v) \
export CXXFLAGS="%{optflags}" \ export CXXFLAGS="%{optflags}" \
export CFLAGS="%{optflags}" \ export CFLAGS="%{optflags}" \
@ -24,9 +32,9 @@ export CFLAGS="%{optflags}" \
%else \ %else \
sip-build-%{$python_bin_suffix} \\\ sip-build-%{$python_bin_suffix} \\\
--verbose \\\ --verbose \\\
--api-dir %{_libqt5_datadir}/qsci/api/python_%{$python_bin_suffix}/ \\\ --api-dir %{_pyqt_datadir}/qsci/api/python_%{$python_bin_suffix}/ \\\
--no-make \\\ --no-make \\\
--qmake=%{_libqt5_qmake} \\\ --qmake=%{_pyqt_qmake} \\\
--qmake-setting "QMAKE_CFLAGS += ${CFLAGS} ${CPPFLAGS}" \\\ --qmake-setting "QMAKE_CFLAGS += ${CFLAGS} ${CPPFLAGS}" \\\
--qmake-setting "QMAKE_CXXFLAGS += ${CXXFLAGS} ${CPPFLAGS}" \\\ --qmake-setting "QMAKE_CXXFLAGS += ${CXXFLAGS} ${CPPFLAGS}" \\\
%{-s*} \ %{-s*} \
@ -41,6 +49,7 @@ popd \
%{python_expand pushd build \ %{python_expand pushd build \
%make_install INSTALL_ROOT=%{buildroot} \ %make_install INSTALL_ROOT=%{buildroot} \
popd \ popd \
# move some files when installing PyQt5 packages built with SIP v4\
%if 0%{?use_sip4} \ %if 0%{?use_sip4} \
[ -d %{buildroot}%{_libqt5_datadir}/qsci/api/python ] \\\ [ -d %{buildroot}%{_libqt5_datadir}/qsci/api/python ] \\\
&& mv -T %{buildroot}%{_libqt5_datadir}/qsci/api/python \\\ && mv -T %{buildroot}%{_libqt5_datadir}/qsci/api/python \\\
@ -48,8 +57,12 @@ popd \
[ -d %{buildroot}/%{_datadir}/sip/PyQt5 ] \\\ [ -d %{buildroot}/%{_datadir}/sip/PyQt5 ] \\\
&& mv -T %{buildroot}/%{_datadir}/sip/PyQt5 %{buildroot}/%{_datadir}/sip/PyQt5-%{$python_bin_suffix} \ && mv -T %{buildroot}/%{_datadir}/sip/PyQt5 %{buildroot}/%{_datadir}/sip/PyQt5-%{$python_bin_suffix} \
%endif \ %endif \
# rename PyQt5 plugins, if any \
find %{buildroot}%{_libqt5_plugindir} -name '*pyqt5*.so' \\\ find %{buildroot}%{_libqt5_plugindir} -name '*pyqt5*.so' \\\
| while read f; do mv ${f} ${f/pyqt5/py%{$python_bin_suffix}qt5}; done \ | while read f; do mv ${f} ${f/pyqt5/py%{$python_bin_suffix}qt5}; done \
# rename PyQt6 plugins, if any \
find %{buildroot}%{_qt6_pluginsdir} -name '*pyqt6*.so' \\\
| while read f; do mv ${f} ${f/pyqt6/py%{$python_bin_suffix}qt6}; done \
} \ } \
%{nil} %{nil}
@ -58,9 +71,7 @@ find %{buildroot}%{_libqt5_plugindir} -name '*pyqt5*.so' \\\
exdir=%{buildroot}%{_docdir}/%{$python_prefix}-%{1} \ exdir=%{buildroot}%{_docdir}/%{$python_prefix}-%{1} \
mkdir -p $exdir \ mkdir -p $exdir \
cp -r examples $exdir/ \ cp -r examples $exdir/ \
# Fix shebang. Depending on version of python-rpm-macros, expanded python could be basename or full path. \ find $exdir -name "*.py" -exec sed -i "1 s|^#!%{_bindir}/env python.*$|#!%{_bindir}/$python|" {} \\; \
python_exec=$(which $python) \
find $exdir -name "*.py" -exec sed -i "1 s|^#!%{_bindir}/env python.*$|#!${python_exec}|" {} \\; \
%fdupes $exdir \ %fdupes $exdir \
} \ } \
%{nil} %{nil}

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Fri Feb 19 23:54:52 UTC 2021 - Ben Greiner <code@bnavigator.de>
- update to version 0.1
- Add PyQt6 support
- Add link to wiki in macros file
- Remove python-rpm-macros interpreter workaround. The
inconsistency never made it into a released package.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Dec 2 16:55:14 UTC 2020 - Benjamin Greiner <code@bnavigator.de> Wed Dec 2 16:55:14 UTC 2020 - Benjamin Greiner <code@bnavigator.de>

View File

@ -1,7 +1,7 @@
# #
# spec file for package python-pyqt-rpm-macros # spec file for package python-pyqt-rpm-macros
# #
# Copyright (c) 2020 SUSE LLC # Copyright (c) 2021 SUSE LLC
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -17,11 +17,11 @@
Name: python-pyqt-rpm-macros Name: python-pyqt-rpm-macros
Version: 0.0.3 Version: 0.1
Release: 0 Release: 0
Summary: RPM macros for building PyQt packages Summary: RPM macros for building PyQt packages
License: WTFPL License: WTFPL
URL: https://en.opensuse.org/openSUSE:Packaging_PyQt5_and_SIP URL: https://en.opensuse.org/openSUSE:Packaging_PyQt_and_SIP
Source0: macros.pyqt Source0: macros.pyqt
Source1: LICENSE Source1: LICENSE
Requires: fdupes Requires: fdupes
@ -31,7 +31,7 @@ Requires: (python-sip-devel or python3-sip-devel)
BuildArch: noarch BuildArch: noarch
%description %description
This package provides some macros for using SIP4 or SIP5 to build PyQt5 packages This package provides some macros for using SIP v[456] to build PyQt[56] packages
%prep %prep
cp %{SOURCE1} . cp %{SOURCE1} .