Switch from autotools to meson; enable the tests, since the meson build system permits us to use a shared boost library

This commit is contained in:
Benjamin A. Beasley 2021-02-11 14:28:52 -05:00
parent 041b27b60d
commit d221d0f049

View File

@ -1,12 +1,15 @@
%global so_version 1
%global apiver 1.0
%bcond_without autoreconf
# “Let mm-common-get copy some files to untracked/”, i.e., replace scripts from
# the tarball with those from mm-common. This is (potentially) required if
# building an autotools-generated tarball with meson, or vice versa.
%bcond_without maintainer_mode
Name: cairomm
Summary: C++ API for the cairo graphics library
Version: 1.14.2
Release: 2%{?dist}
Release: 3%{?dist}
URL: https://www.cairographics.org
License: LGPLv2+
@ -28,21 +31,32 @@ BuildRequires: gcc-c++
BuildRequires: make
BuildRequires: pkgconfig
%if %{with autoreconf}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
BuildRequires: autoconf-archive
%endif
BuildRequires: meson
# mm-common-get
BuildRequires: mm-common
BuildRequires: cairo-devel
BuildRequires: libsigc++20-devel
BuildRequires: perl-interpreter
BuildRequires: perl(Getopt::Long)
BuildRequires: doxygen
# dot
BuildRequires: graphviz
# xsltproc
BuildRequires: libxslt
# For tests:
BuildRequires: boost-devel
BuildRequires: fontconfig
BuildRequires: pkgconfig(cairo-ft)
BuildRequires: pkgconfig(cairo-pdf)
BuildRequires: pkgconfig(cairo-png)
BuildRequires: pkgconfig(cairo-ps)
BuildRequires: pkgconfig(cairo-svg)
BuildRequires: pkgconfig(cairo-xlib)
BuildRequires: pkgconfig(cairo-xlib-xrender)
BuildRequires: pkgconfig(mm-common-libstdc++)
BuildRequires: pkgconfig(sigc++-2.0)
%description
This library provides a C++ interface to cairo.
@ -89,29 +103,26 @@ rm untracked/docs/reference/%{name}-%{apiver}.tag \
%build
%if %{with autoreconf}
# Update obsolete Boost m4 macros
cp -vp %{_datadir}/aclocal/ax_boost_base.m4 \
%{_datadir}/aclocal/ax_boost_unit_test_framework.m4 \
build/
NOCONFIGURE=1 ./autogen.sh
%endif
%configure \
--enable-maintainer-mode \
--disable-static
%make_build
%meson \
-Dmaintainer-mode=%{?with_maintainer_mode:true}%{?!with_maintainer_mode:false} \
-Dbuild-documentation=true \
-Dbuild-examples=false \
-Dbuild-tests=true \
-Dboost-shared=true \
-Dwarnings=max
%meson_build
%install
%make_install
%meson_install
find %{buildroot} -type f -name '*.la' -print -delete
install -t %{buildroot}%{_datadir}/doc/%{name}-%{apiver} -m 0644 -p \
AUTHORS ChangeLog MAINTAINERS NEWS README
# Currently, we cannot run the tests because they require a static boost-test
# library.
%check
%meson_test
%files
@ -135,6 +146,10 @@ install -t %{buildroot}%{_datadir}/doc/%{name}-%{apiver} -m 0644 -p \
%changelog
* Thu Feb 11 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.14.2-3
- Switch from autotools to meson; enable the tests, since the meson build system
permits us to use a shared boost library
* Thu Feb 11 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.14.2-2
- Restore removal of pre-built documentation with its minified JS bundle