From 7ffd7a5fa15316f126831c239ceb7cb6d26bce12 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Tue, 7 Jun 2022 15:51:06 +0000 Subject: [PATCH] highlight: allow dropping qt5 build dep Building with '--without=qt' removes qt build deps, and also results in not building the -gui package --- highlight.spec | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/highlight.spec b/highlight.spec index 774ae46..308ed0f 100644 --- a/highlight.spec +++ b/highlight.spec @@ -1,12 +1,17 @@ Name: highlight Summary: Universal source code to formatted text converter Version: 4.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3 URL: http://www.andre-simon.de/ Source0: http://www.andre-simon.de/zip/%{name}-%{version}.tar.bz2 + +%bcond qt 1 + BuildRequires: gcc-c++ +%if %{with qt} BuildRequires: qt5-qtbase-devel +%endif BuildRequires: lua-devel, boost-devel BuildRequires: desktop-file-utils BuildRequires: make @@ -26,12 +31,14 @@ Language descriptions are configurable and support regular expressions. The utility offers indentation and reformatting capabilities. It is easily possible to create new language definitions and colour themes. +%if %{with qt} %package gui Summary: GUI for the highlight source code formatter Requires: %{name} = %{version}-%{release} %description gui A Qt-based GUI for the highlight source code formatter source. +%endif %prep %autosetup @@ -43,7 +50,15 @@ LDFLAGS="$LDFLAGS %{?__global_ldflags}"; export LDFLAGS # disabled paralell builds to fix FTBFS on rawhide & highlight 3.52+ #make_build all gui CFLAGS="${CFLAGS}" \ - %{__make} all gui CFLAGS="${CFLAGS}" \ + %{__make} all CFLAGS="${CFLAGS}" \ + CXXFLAGS="${CXXFLAGS}" \ + LDFLAGS="${LDFLAGS}" \ + LFLAGS="-Wl,-O1 ${LDFLAGS}" \ + PREFIX="%{_prefix}" \ + conf_dir="%{_sysconfdir}/highlight/" + +%if %{with qt} + %{__make} gui CFLAGS="${CFLAGS}" \ CXXFLAGS="${CXXFLAGS}" \ LDFLAGS="${LDFLAGS}" \ LFLAGS="-Wl,-O1 ${LDFLAGS}" \ @@ -51,13 +66,16 @@ LDFLAGS="$LDFLAGS %{?__global_ldflags}"; export LDFLAGS conf_dir="%{_sysconfdir}/highlight/" \ QMAKE="%{_qt5_qmake}" \ QMAKE_STRIP= +%endif %install %make_install PREFIX="%{_prefix}" conf_dir="%{_sysconfdir}/highlight/" mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps +%if %{with qt} make install-gui DESTDIR=$RPM_BUILD_ROOT PREFIX="%{_prefix}" conf_dir="%{_sysconfdir}/highlight/" +%endif rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}/ @@ -75,13 +93,20 @@ desktop-file-install \ %doc ChangeLog* AUTHORS README* extras/ %license COPYING + %if %{with qt} %files gui %{_bindir}/highlight-gui %{_datadir}/applications/highlight.desktop %{_datadir}/icons/hicolor/256x256/apps/highlight.png +%else +%exclude %{_datadir}/applications/highlight.desktop +%endif %changelog +* Tue Sep 6 2022 Amit Shah - 4.2-2 +- Allow disabling Qt deps + * Thu Aug 25 2022 Filipe Rosset - 4.2-1 - Update to 4.2