SHA256
1
0
forked from pool/meson
meson/meson-testsuite.spec

149 lines
4.6 KiB
RPMSpec

#
# spec file for package meson-testsuite
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define testsuite 1
%if %{testsuite}
%define name_ext -testsuite
%else
%define name_ext %nil
%endif
%define _name mesonbuild
Name: meson%{name_ext}
Version: 0.41.1
Release: 0
Summary: Python-based build system
License: Apache-2.0
Group: Development/Tools/Building
Url: http://mesonbuild.com/
Source: https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz
Source1: https://github.com/%{_name}/meson/releases/download/%{version}/meson-%{version}.tar.gz.asc
Source2: meson.keyring
# PATCH-FIX-OPENSUSE meson-suse-ify-macros.patch dimstar@opensuse.org -- Make the macros non-RedHat specific: so far there are no separate {C,CXX,F}FLAGS.
Patch0: meson-suse-ify-macros.patch
# PATCH-FIX-OPENSUSE meson-fix-gcc48.patch sor.alexei@meowr.ru -- Fix GCC 4.8 handling for openSUSE Leap 42.x.
Patch1: meson-fix-gcc48.patch
# PATCH-FIX-OPENSUSE meson-test-installed-bin.patch dimstar@opensuse.org -- We want the test suite to run against /usr/bin/meson coming from our meson package
Patch100: meson-test-installed-bin.patch
BuildRequires: python3 >= 3.4
%if %{testsuite}
BuildRequires: bison
BuildRequires: boost-devel
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: gcc-fortran
BuildRequires: gcc-obj-c++
BuildRequires: gcc-objc
BuildRequires: gettext
BuildRequires: git
BuildRequires: gnustep-make
BuildRequires: googletest-devel
BuildRequires: gtk-doc
BuildRequires: itstool
BuildRequires: llvm-devel
BuildRequires: meson
BuildRequires: ncurses-devel
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: python3-devel
BuildRequires: python3-gobject
BuildRequires: python3-setuptools
BuildRequires: vala
BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5Gui)
BuildRequires: cmake(Qt5Widgets)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(sdl2)
BuildRequires: pkgconfig(zlib)
%else
Requires: ninja
# meson-gui was last used in openSUSE Leap 42.1.
Provides: meson-gui = %{version}
Obsoletes: meson-gui < %{version}
%endif
BuildArch: noarch
%description
Meson is a build system designed to optimise programmer productivity.
It aims to do this by providing support for software development
tools and practices, such as unit tests, coverage reports, Valgrind,
CCache and the like. Supported languages include C, C++, Fortran,
Java, Rust. Build definitions are written in a non-turing complete
Domain Specific Language.
%prep
%setup -q -n meson-%{version}
%patch0 -p1
%patch1 -p1
%patch100 -p1
# We do not have gmock available at this moment - can't run the test suite for it
rm -rf "test cases/frameworks/3 gmock" \
"test cases/objc/2 nsstring"
%build
# If this is the test suite, we don't need anything else but the meson package
%if ! %{testsuite}
python3 setup.py build
%else
# When running the test suite, we want to be sure to use the installed meson version
rm -rf meson.py mesonbuild
%endif
%install
# If this is the test suite, we don't need anything else but the meson package
%if ! %{testsuite}
python3 setup.py install \
--root=%{buildroot} --prefix=%{_prefix}
install -Dpm 0644 data/macros.meson \
%{buildroot}%{_rpmconfigdir}/macros.d/macros.meson
%endif
%if %{testsuite}
%check
export LANG=C.UTF-8
export MESON_PRINT_TEST_OUTPUT=1
export SUSE_ASNEEDED=0
python3 run_tests.py
%endif
%files
%defattr(-,root,root)
%doc contributing.txt COPYING
%if !%{testsuite}
%{_bindir}/meson
%{_bindir}/mesonconf
%{_bindir}/mesonintrospect
%{_bindir}/mesontest
%{_bindir}/wraptool
%{python3_sitelib}/%{_name}/
%{python3_sitelib}/meson-*
%{_rpmconfigdir}/macros.d/macros.meson
%{_mandir}/man1/meson.1%{?ext_man}
%{_mandir}/man1/mesonconf.1%{?ext_man}
%{_mandir}/man1/mesonintrospect.1%{?ext_man}
%{_mandir}/man1/mesontest.1%{?ext_man}
%{_mandir}/man1/wraptool.1%{?ext_man}
%endif
%changelog