From 9abc1268cffac8b0cc1baee934eb312fa7e6209a Mon Sep 17 00:00:00 2001 From: Thomas Schneider Date: Thu, 4 Apr 2024 15:34:24 +0200 Subject: Use bundled picojson and docopt-cpp on RHEL etc. --- termpaint.spec | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'termpaint.spec') diff --git a/termpaint.spec b/termpaint.spec index 015c9b6..8a7060c 100644 --- a/termpaint.spec +++ b/termpaint.spec @@ -17,11 +17,19 @@ BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: pkgconfig(fmt) BuildRequires: pkgconfig(catch2) -BuildRequires: picojson-static -BuildRequires: pkgconfig(docopt) BuildRequires: python3-sphinx Provides: bundled(valgrind) = 3.15 +%if 0%{?rhel} +Provides: bundled(picojson) = 1.3.0-0.20170306gita944d59 +Provides: bundled(docopt-cpp) = 0.6.2-0.20200214gitc8a63d5 +%global meson_use_system "disabled" +%else +BuildRequires: picojson-static +BuildRequires: pkgconfig(docopt) +%global meson_use_system "enabled" +%endif + %description Termpaint is a low level terminal interface library for character-cell terminals in the tradition of VT1xx (like xterm, etc). It is designed to be portable and @@ -39,11 +47,15 @@ software using termpaint, as well as the documentation. %prep %forgeautosetup -rm -rf third-party/{catch.hpp,docopt,format.cc,format.h,picojson.h,linux_syscall_support.h} +rm -rf third-party/{catch.hpp,format.cc,format.h,linux_syscall_support.h} +%if %{undefined rhel} +rm -rf third-party/{picojson.h,docopt} +%endif %build -%meson -Dsystem-docopt=enabled -Dsystem-fmt=enabled -Dsystem-catch2=enabled -Dsystem-picojson=enabled \ +%meson -Dsystem-fmt=enabled -Dsystem-catch2=enabled \ + -Dsystem-picojson=%{meson_use_system} -Dsystem-docopt=%{meson_use_system} \ -Dttyrescue-fexec-blob=false -Dttyrescue-path=%{_libdir}/termpaint/ \ -Dttyrescue-install=true -Dtools-path=%{_libdir}/termpaint/ %meson_build -- cgit v1.2.3