Accepting request 1078530 from home:krop:branches:Base:System

RFC:

Add a Qt6 flavor to build Qt6 bindings. Needed by the KDE CI and future KDE releases.

About the Leap failures with the qt6 flavor:
The default compiler is too old in Leap. For the build to succeed, it would require setting CC / CXX to a more recent one
(we use gcc10 for Qt6 packages in 15.4 and 15.5)

But... since the cpp bindings are deleted when building the qt flavors, would that causes issues?
(we'd have libqgpgmeqt6.so* built with a different compiler than libgpgme.so*)

OBS-URL: https://build.opensuse.org/request/show/1078530
OBS-URL: https://build.opensuse.org/package/show/Base:System/gpgme?expand=0&rev=148
This commit is contained in:
Dirk Mueller 2023-04-15 18:18:19 +00:00 committed by Git OBS Bridge
parent bea38e90ad
commit 272c779f8c
3 changed files with 81 additions and 14 deletions

View File

@ -1,3 +1,4 @@
<multibuild>
<package>qt</package>
<package>qt6</package>
</multibuild>

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Apr 11 22:15:02 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Add a Qt6 flavor to build Qt6 bindings
- Use %ldconfig_scriptlets
-------------------------------------------------------------------
Mon Mar 20 15:46:55 UTC 2023 - Pedro Monreal <pmonreal@suse.com>

View File

@ -21,11 +21,17 @@
%define psuffix %{nil}
%bcond_without python3
%bcond_with qt
%else
%endif
%if "%{flavor}" == "qt"
%define psuffix qt
%bcond_with python3
%bcond_without qt
%endif
%if "%{flavor}" == "qt6"
%define psuffix qt6
%bcond_with python3
%bcond_without qt6
%endif
Name: gpgme%{psuffix}
Version: 1.19.0
Release: 0
@ -60,6 +66,10 @@ BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Test)
%endif
%if %{with qt6}
BuildRequires: pkgconfig(Qt6Core) >= 6.4.0
BuildRequires: pkgconfig(Qt6Test)
%endif
%if 0%{?suse_version} >= 1550
# TW: generate subpackages for every python3 flavor
%define python_subpackage_only 1
@ -166,7 +176,7 @@ This package contains the bindings to use the library from Python 3 applications
%endif
%package -n libqgpgme15
Summary: Programmatic Qt library interface to GnuPG
Summary: Programmatic Qt 5 library interface to GnuPG
Group: System/Libraries
Requires: gpg2
@ -176,10 +186,10 @@ easier for applications. It provides a high-level crypto API for
encryption, decryption, signing, signature verification, and key
management.
This package contains the Qt bindings.
This package contains the Qt 5 bindings.
%package -n libqgpgme-devel
Summary: Development files for libqgpgme, a Qt library for accessing GnuPG
Summary: Development files for libqgpgme, a Qt 5 library for accessing GnuPG
Group: Development/Libraries/C and C++
Requires: libgpgme-devel = %{version}
Requires: libgpgmepp-devel = %{version}
@ -191,7 +201,37 @@ easier for applications. It provides a high-level crypto API for
encryption, decryption, signing, signature verification, and key
management.
This package contains the bindings to use the library in Qt C++ applications.
This package contains the bindings to use the library in Qt 5 C++ applications.
%package -n libqgpgmeqt6-15
Summary: Programmatic Qt 6 library interface to GnuPG
Group: System/Libraries
Requires: gpg2
%description -n libqgpgmeqt6-15
GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
easier for applications. It provides a high-level crypto API for
encryption, decryption, signing, signature verification, and key
management.
This package contains the Qt 6 bindings.
%package -n libqgpgmeqt6-devel
Summary: Development files for libqgpgmeqt6, a Qt library for accessing GnuPG
Group: Development/Libraries/C and C++
Requires: libgpgme-devel = %{version}
Requires: libgpgmepp-devel = %{version}
Requires: libqgpgmeqt6-15 = %{version}
# The include folders have the same name in both libqgpgme-devel and libqgpgmeqt6-devel
Conflicts: libqgpgme-devel
%description -n libqgpgmeqt6-devel
GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
easier for applications. It provides a high-level crypto API for
encryption, decryption, signing, signature verification, and key
management.
This package contains the bindings to use the library in Qt 6 C++ applications.
%prep
%autosetup -p1 -n gpgme-%{version}
@ -209,6 +249,10 @@ languages="${languages} python"
languages="cpp qt"
%endif
%if %{with qt6}
languages="cpp qt6"
%endif
%configure \
--disable-silent-rules \
--disable-static \
@ -222,7 +266,7 @@ languages="cpp qt"
find %{buildroot} -type f -name "*.la" -delete -print
chmod -x %{buildroot}%{_libdir}/cmake/Gpgmepp/*.cmake
%if %{with qt}
%if %{with qt} || %{with qt6}
rm -r %{buildroot}%{_bindir}
rm -r %{buildroot}%{_datadir}/aclocal/gpgme*
rm -r %{buildroot}%{_includedir}/gpgme*
@ -238,18 +282,19 @@ GPGME_DEBUG=2:mygpgme.log %make_build check skip=%{?qt_skip:%{qt_skip}} || cat $
%endif
%if %{with qt}
%post -n libqgpgme15 -p /sbin/ldconfig
%postun -n libqgpgme15 -p /sbin/ldconfig
%ldconfig_scriptlets -n libqgpgme15
%endif
%if !%{with qt}
%post -n libgpgme11 -p /sbin/ldconfig
%postun -n libgpgme11 -p /sbin/ldconfig
%post -n libgpgmepp6 -p /sbin/ldconfig
%postun -n libgpgmepp6 -p /sbin/ldconfig
%if %{with qt6}
%ldconfig_scriptlets -n libqgpgmeqt6-15
%endif
%if !%{with qt}
%if !%{with qt} && !%{with qt6}
%ldconfig_scriptlets -n libgpgme11
%ldconfig_scriptlets -n libgpgmepp6
%endif
%if !%{with qt} && !%{with qt6}
%files
%license COPYING COPYING.LESSER LICENSES
%doc AUTHORS ChangeLog ChangeLog-2011 README NEWS THANKS TODO VERSION
@ -307,4 +352,19 @@ GPGME_DEBUG=2:mygpgme.log %make_build check skip=%{?qt_skip:%{qt_skip}} || cat $
%{_libdir}/libqgpgme.so
%endif
%if %{with qt6}
%files -n libqgpgmeqt6-15
%license COPYING COPYING.LESSER LICENSES
%{_libdir}/libqgpgmeqt6.so.*
%files -n libqgpgmeqt6-devel
%license COPYING COPYING.LESSER LICENSES
%{_includedir}/qgpgme/
%{_includedir}/QGpgME/
%dir %{_libdir}/cmake
%dir %{_libdir}/cmake/QGpgmeQt6
%{_libdir}/cmake/QGpgmeQt6/*.cmake
%{_libdir}/libqgpgmeqt6.so
%endif
%changelog