Allow building without Qt dependencies

Compiling with --without=qt will not pull in Qt dependencies, and will
also not produce the -qt subpackages.
This commit is contained in:
Amit Shah 2022-06-08 09:37:50 +00:00
parent 7234b6a9a7
commit 1578ced83e

View File

@ -5,7 +5,7 @@
Summary: Utilities to generate, maintain and access the AppStream database
Name: appstream
Version: 0.15.5
Release: 1%{?dist}
Release: 2%{?dist}
# lib LGPLv2+, tools GPLv2+
License: GPLv2+ and LGPLv2+
@ -13,6 +13,8 @@ License: GPLv2+ and LGPLv2+
URL: https://github.com/ximion/appstream
Source0: http://www.freedesktop.org/software/appstream/releases/AppStream-%{version}.tar.xz
%bcond qt 1
## upstream patches (lookaside cache)
## upstreamable patches
@ -40,11 +42,15 @@ BuildRequires: pkgconfig(lmdb)
BuildRequires: pkgconfig(packagekit-glib2)
BuildRequires: pkgconfig(pango)
BuildRequires: pkgconfig(protobuf-lite)
%if %{with qt}
BuildRequires: pkgconfig(Qt5Core)
%endif
BuildRequires: pkgconfig(xmlb)
BuildRequires: pkgconfig(yaml-0.1)
# lrelease
%if %{with qt}
BuildRequires: qt5-linguist
%endif
BuildRequires: sed
BuildRequires: vala
BuildRequires: xmlto
@ -77,6 +83,7 @@ Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description compose-devel
%{summary}.
%if %{with qt}
%package qt
Summary: Qt5 bindings for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -89,6 +96,7 @@ Requires: %{name}-qt%{?_isa} = %{version}-%{release}
Requires: pkgconfig(Qt5Core)
%description qt-devel
%{summary}.
%endif
%prep
@ -98,7 +106,9 @@ Requires: pkgconfig(Qt5Core)
%build
%{meson} \
-Dcompose=true \
%if %{with qt}
-Dqt=true \
%endif
-Dvapi=%{?vala:true}%{!?vala:false}
%{meson_build}
@ -192,6 +202,7 @@ mv %{buildroot}%{_datadir}/metainfo/*.xml \
%dir %{_datadir}/gtk-doc/html/
%{_datadir}/gtk-doc/html/appstream-compose
%if %{with qt}
%ldconfig_scriptlets qt
%files qt
@ -202,9 +213,13 @@ mv %{buildroot}%{_datadir}/metainfo/*.xml \
%{_includedir}/AppStreamQt/
%{_libdir}/cmake/AppStreamQt/
%{_libdir}/libAppStreamQt.so
%endif
%changelog
* Tue Sep 6 2022 Amit Shah <amitshah@fedoraproject.org> - 0.15.5-2
- Make qt deps and builds conditional
* Fri Sep 02 2022 Rex Dieter <rdieter@gmail.com> - 0.15.5-1
- 0.15.5