Fix building as a flatpak module

This fixes building for /app prefix that flatpak uses.
This commit is contained in:
Kalev Lember 2020-01-26 18:15:41 +01:00
parent 440aed62c8
commit 1a465c9ac2

View File

@ -32,18 +32,12 @@
# see also https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/JQQ66XJSIT2FGTK2YQY7AXMEH5IXMPUX/ # see also https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/JQQ66XJSIT2FGTK2YQY7AXMEH5IXMPUX/
%undefine _strict_symbol_defs_build %undefine _strict_symbol_defs_build
# flatpak hacks go here
%if 0%{?flatpak}
%global python2_sip_incdir --sip-incdir %{_prefix}/include/python%{python2_version}
%global python3_sip_incdir --sip-incdir /usr/include/python%{python3_version}
%endif
#global snap dev1808131157 #global snap dev1808131157
Summary: PyQt5 is Python bindings for Qt5 Summary: PyQt5 is Python bindings for Qt5
Name: python-qt5 Name: python-qt5
Version: 5.13.2 Version: 5.13.2
Release: 3%{?dist} Release: 4%{?dist}
License: GPLv3 License: GPLv3
Url: http://www.riverbankcomputing.com/software/pyqt/ Url: http://www.riverbankcomputing.com/software/pyqt/
@ -289,10 +283,9 @@ pushd %{_target_platform}
--qmake=%{_qt5_qmake} \ --qmake=%{_qt5_qmake} \
%{!?with_python3:--no-qsci-api}%{?with_python3:--qsci-api --qsci-api-destdir=%{_qt5_datadir}/qsci} \ %{!?with_python3:--no-qsci-api}%{?with_python3:--qsci-api --qsci-api-destdir=%{_qt5_datadir}/qsci} \
--verbose \ --verbose \
%{?python2_sip_incdir} \ --dbus=%{_includedir}/dbus-1.0/ \
--dbus=/usr/include/dbus-1.0/ \
QMAKE_CFLAGS_RELEASE="%{optflags}" \ QMAKE_CFLAGS_RELEASE="%{optflags}" \
QMAKE_CXXFLAGS_RELEASE="%{optflags} -I/usr/%{_lib}/dbus-1.0/include/" \ QMAKE_CXXFLAGS_RELEASE="%{optflags} `pkg-config --cflags dbus-python`" \
QMAKE_LFLAGS_RELEASE="%{?__global_ldflags}" QMAKE_LFLAGS_RELEASE="%{?__global_ldflags}"
%make_build %make_build
@ -312,10 +305,9 @@ pushd %{_target_platform}-python3
%{?py3_sip:--sip=%{_bindir}/python3-sip} \ %{?py3_sip:--sip=%{_bindir}/python3-sip} \
%{?py3_sipdir:--sipdir=%{py3_sipdir}} \ %{?py3_sipdir:--sipdir=%{py3_sipdir}} \
--verbose \ --verbose \
%{?python3_sip_incdir} \ --dbus=%{_includedir}/dbus-1.0/ \
--dbus=/usr/include/dbus-1.0/ \
QMAKE_CFLAGS_RELEASE="%{optflags}" \ QMAKE_CFLAGS_RELEASE="%{optflags}" \
QMAKE_CXXFLAGS_RELEASE="%{optflags} -I/usr/%{_lib}/dbus-1.0/include/" \ QMAKE_CXXFLAGS_RELEASE="%{optflags} `pkg-config --cflags dbus-python`" \
QMAKE_LFLAGS_RELEASE="%{?__global_ldflags}" QMAKE_LFLAGS_RELEASE="%{?__global_ldflags}"
%make_build %make_build
@ -344,6 +336,10 @@ if [ "%{_prefix}" != "/usr" ]; then
rm -rf %{buildroot}/usr/* rm -rf %{buildroot}/usr/*
fi fi
# Explicitly byte compile as the automagic byte compilation doesn't work for
# /app prefix in flatpak builds
%py_byte_compile %{__python3} %{buildroot}%{python3_sitearch}/PyQt5
# ensure .so modules are executable for proper -debuginfo extraction # ensure .so modules are executable for proper -debuginfo extraction
find %{buildroot} -type f -name '*.so' | xargs chmod a+rx find %{buildroot} -type f -name '*.so' | xargs chmod a+rx
#for i in %%{buildroot}%%{python3_sitearch}/PyQt5/*.so %%{buildroot}%%{python3_dbus_dir}/pyqt5.so ; do #for i in %%{buildroot}%%{python3_sitearch}/PyQt5/*.so %%{buildroot}%%{python3_dbus_dir}/pyqt5.so ; do
@ -556,6 +552,9 @@ sed -i \
%changelog %changelog
* Sun Jan 26 2020 Kalev Lember <klember@redhat.com> - 5.13.2-4
- Fix building as a flatpak module
* Mon Dec 09 2019 Jan Grulich <jgrulich@redhat.com> - 5.13.2-3 * Mon Dec 09 2019 Jan Grulich <jgrulich@redhat.com> - 5.13.2-3
- rebuild (qt5) - rebuild (qt5)