2023-10-24 15:35:54 +02:00
#
2023-10-24 10:43:04 +02:00
# spec file
#
# Copyright (c) 2023 SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
2023-11-20 12:47:24 +01:00
2023-07-13 15:25:08 +02:00
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000
%global pythons python311
%else
%global pythons python3
%endif
2019-01-16 12:19:24 +01:00
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define name_ext -test
%bcond_without test
2017-06-23 22:29:28 +02:00
%else
2018-03-21 22:15:11 +01:00
%define name_ext %{nil}
2019-01-16 12:19:24 +01:00
%bcond_with test
2017-06-23 22:29:28 +02:00
%endif
2017-09-18 15:20:48 +02:00
%define _name mesonbuild
2019-01-16 12:19:24 +01:00
%{!?vim_data_dir:%global vim_data_dir %{_datadir} /vim}
2023-02-25 20:36:29 +01:00
%bcond_with setuptools
%bcond_without mono
2018-03-21 22:15:11 +01:00
Name : meson%{name_ext}
2023-11-20 12:47:24 +01:00
Version : 1.3.0
2015-07-24 16:37:01 +02:00
Release : 0
2017-01-01 13:44:07 +01:00
Summary : Python-based build system
2015-07-24 16:37:01 +02:00
License : Apache-2.0
2015-08-21 11:26:36 +02:00
Group : Development/Tools/Building
2022-02-06 20:26:31 +01:00
URL : https://mesonbuild.com/
2017-06-23 22:29:28 +02:00
Source : https://github.com/%{_name}/meson/releases/download/%{version} /meson-%{version} .tar.gz
2020-01-25 15:32:34 +01:00
Source1 : https://github.com/%{_name}/meson/releases/download/%{version} /meson-%{version} .tar.gz.asc
2017-06-23 22:29:28 +02:00
Source2 : meson.keyring
2018-04-26 10:56:00 +02:00
# 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.
2022-04-27 09:57:10 +02:00
Patch0 : meson-test-installed-bin.patch
2022-10-12 14:26:08 +02:00
# PATCH-FIX-OPENSUSE give more time to testsuites that run emulated
Patch1 : extend-test-timeout-on-qemu-builds.patch
2022-04-27 09:57:10 +02:00
# PATCH-FIX-OPENSUSE meson-distutils.patch -- meson is ring0 and therefor setuptools is not available
2020-07-26 18:14:49 +02:00
Patch2 : meson-distutils.patch
2023-10-02 10:38:07 +02:00
2023-07-14 13:10:58 +02:00
BuildRequires : %{python_module base >= 3.7}
2019-01-16 12:19:24 +01:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
%if %{with setuptools}
2023-07-13 15:25:08 +02:00
BuildRequires : %{python_module setuptools}
2018-12-16 23:15:56 +01:00
Requires : python3-setuptools
2019-01-16 12:19:24 +01:00
%endif
2022-04-27 09:57:10 +02:00
%if "%{flavor}" != "test"
Requires : ninja >= 1.8.2
2018-12-16 23:15:56 +01:00
# meson-gui was last used in openSUSE Leap 42.1.
Provides : meson-gui = %{version}
Obsoletes : meson-gui < %{version}
2023-02-25 20:36:29 +01:00
BuildArch : noarch
2018-12-16 23:15:56 +01:00
%else
2023-11-20 12:47:24 +01:00
ExclusiveArch : x86_64
2023-07-13 15:25:08 +02:00
BuildRequires : %{python_module devel}
2015-07-24 16:37:01 +02:00
BuildRequires : bison
2023-07-13 15:25:08 +02:00
BuildRequires : clang >= 15
2023-11-20 12:47:24 +01:00
BuildRequires : clang-tools >= 15
2017-10-11 22:40:48 +02:00
BuildRequires : cups-devel
2022-02-06 20:26:31 +01:00
BuildRequires : distribution-release
2015-07-24 16:37:01 +02:00
BuildRequires : flex
2023-07-13 15:25:08 +02:00
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000
BuildRequires : gcc12-c++
BuildRequires : gcc12-fortran
BuildRequires : gcc12-obj-c++
BuildRequires : gcc12-objc
%else
BuildRequires : gcc-c++ >= 12
BuildRequires : gcc-fortran >= 12
BuildRequires : gcc-obj-c++ >= 12
BuildRequires : gcc-objc >= 12
%endif
2015-07-24 16:37:01 +02:00
BuildRequires : gettext
BuildRequires : git
2021-11-04 12:47:17 +01:00
BuildRequires : gmock
2017-06-23 22:29:28 +02:00
BuildRequires : gnustep-make
BuildRequires : googletest-devel
2016-11-22 18:18:39 +01:00
BuildRequires : itstool
2022-04-27 09:57:10 +02:00
BuildRequires : java-headless
BuildRequires : libboost_log-devel
2023-07-13 15:25:08 +02:00
# This will be required to build to python311
2022-04-27 09:57:10 +02:00
BuildRequires : libboost_python3-devel
2023-07-13 15:25:08 +02:00
BuildRequires : %{python_module devel}
BuildRequires : %{python_module gobject}
BuildRequires : %{python_module pytest-xdist}
2022-04-27 09:57:10 +02:00
BuildRequires : libboost_system-devel
BuildRequires : libboost_test-devel
BuildRequires : libboost_thread-devel
2018-03-13 00:03:07 +01:00
BuildRequires : libjpeg-devel
2017-08-15 18:57:45 +02:00
BuildRequires : libpcap-devel
2019-01-16 12:19:24 +01:00
BuildRequires : libqt5-qtbase-common-devel
2018-08-04 23:27:12 +02:00
BuildRequires : libqt5-qtbase-private-headers-devel
2018-02-06 10:16:50 +01:00
BuildRequires : libwmf-devel
2017-06-23 14:40:55 +02:00
BuildRequires : llvm-devel
2018-02-06 10:16:50 +01:00
BuildRequires : meson = %{version}
2015-07-24 16:37:01 +02:00
BuildRequires : ninja
2016-07-23 21:45:57 +02:00
BuildRequires : pkgconfig
2022-04-27 09:57:10 +02:00
BuildRequires : rust
BuildRequires : wxWidgets-any-devel
2018-02-06 10:16:50 +01:00
BuildRequires : zlib-devel-static
2017-06-23 22:29:28 +02:00
BuildRequires : cmake(Qt5Core)
BuildRequires : cmake(Qt5Gui)
2018-02-06 10:16:50 +01:00
BuildRequires : cmake(Qt5LinguistTools)
2017-06-23 22:29:28 +02:00
BuildRequires : cmake(Qt5Widgets)
2015-07-24 16:37:01 +02:00
BuildRequires : pkgconfig(glib-2.0)
BuildRequires : pkgconfig(gobject-introspection-1.0)
2017-06-23 22:29:28 +02:00
BuildRequires : pkgconfig(gtk+-3.0)
2019-01-16 12:19:24 +01:00
BuildRequires : pkgconfig(gtk-doc)
BuildRequires : pkgconfig(ncurses)
2017-06-23 22:29:28 +02:00
BuildRequires : pkgconfig(sdl2)
2019-01-16 12:19:24 +01:00
BuildRequires : pkgconfig(vapigen)
BuildRequires : pkgconfig(vulkan)
2015-07-24 16:37:01 +02:00
BuildRequires : pkgconfig(zlib)
2022-02-06 20:26:31 +01:00
%if 0%{?suse_version} < 1550
2023-02-25 20:36:29 +01:00
BuildRequires : libboost_python-devel
2022-04-27 09:57:10 +02:00
# Leap / SLE 15.x
BuildRequires : python2-PyYAML
BuildRequires : python2-devel
2023-07-13 15:25:08 +02:00
BuildRequires : python3-devel
2022-02-06 20:26:31 +01:00
%endif
2022-08-11 16:56:21 +02:00
%if %{with mono}
2018-12-16 23:15:56 +01:00
BuildRequires : mono(csharp)
2019-01-16 12:19:24 +01:00
%endif
2017-06-23 22:29:28 +02:00
%endif
2021-02-04 14:37:45 +01:00
# meson makes use of macros that were only defined with rpm 4.15
2021-08-03 12:04:16 +02:00
%if (0%{?suse_version} < 1550 && 0%{?sle_version} < 150400)
2021-02-04 14:37:45 +01:00
Conflicts : rpm-build < 4.15
2021-08-03 12:04:16 +02:00
%endif
2015-07-24 16:37:01 +02:00
%description
2017-01-01 13:44:07 +01:00
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.
2015-07-24 16:37:01 +02:00
2017-06-29 12:18:00 +02:00
%package vim
2023-01-05 13:06:56 +01:00
Summary : Vim syntax highlighting support for meson.build files
2017-06-29 12:18:00 +02:00
Group : Productivity/Text/Editors
Requires : vim
2021-11-04 12:47:17 +01:00
Supplements: (vim and %{name} )
2017-06-29 12:19:32 +02:00
BuildArch : noarch
2017-06-29 12:18:00 +02:00
%description vim
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.
2023-01-05 13:06:56 +01:00
This package provides meson.build syntax highlighting support for
Vim/NeoVim.
2017-06-29 12:18:00 +02:00
2015-07-24 16:37:01 +02:00
%prep
2017-06-23 22:29:28 +02:00
%setup -q -n meson-%{version}
2023-11-27 15:38:36 +01:00
%patch -P 0 -p1
%patch -P 1 -p1
2019-01-16 12:19:24 +01:00
%if !%{with setuptools}
2023-11-27 15:38:36 +01:00
%patch -P 2 -p1
2019-01-16 12:19:24 +01:00
%endif
2018-02-06 10:16:50 +01:00
2023-07-13 15:25:08 +02:00
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000
2018-09-28 17:49:38 +02:00
# AddressSanitizer fails here because of ulimit.
2023-01-05 13:06:56 +01:00
sed -i " / d e f t e s t _ g e n e r a t e _ g i r _ w i t h _ a d d r e s s _ s a n i t i z e r / {
s/$/\n raise unittest.SkipTest('ulimit' )/;
2023-07-13 15:25:08 +02:00
}" u n i t t e s t s / l i n u x l i k e t e s t s . p y
# Expects modern glibc with pthread symbols in libc.so
rm -rf test\ cases/rust/17\ staticlib\ link\ staticlib
%endif
2015-07-24 16:37:01 +02:00
2017-10-19 17:35:14 +02:00
# Remove hashbang from non-exec script
2023-01-05 13:06:56 +01:00
sed -i '1{/\/usr\/bin\/env/d;}' \
./mesonbuild/rewriter.py \
./mesonbuild/scripts/cmake_run_ctgt.py
2017-10-19 17:35:14 +02:00
2023-07-13 15:25:08 +02:00
# We do not have appleframeworks available at this moment - can't run the test suite for it
# boost is currently borked too
rm -r " t e s t c a s e s / f r a m e w o r k s / 1 b o o s t " \
" t e s t c a s e s / o b j c / 2 n s s t r i n g "
2019-01-16 12:19:24 +01:00
# remove gtest check that actually works because our gtest has .pc files
rm -rf test\ cases/failing/85\ gtest\ dependency\ with\ version
2015-07-24 16:37:01 +02:00
%build
2023-07-13 15:25:08 +02:00
%if %{without test}
2023-07-14 12:04:47 +02:00
%python_build
2017-06-23 22:29:28 +02:00
%else
2018-02-22 12:14:29 +01:00
# Ensure we have no mesonbuild / meson in CWD, thus guaranteeing we use meson in $PATH
2018-12-16 23:15:56 +01:00
rm -r meson.py mesonbuild
2017-06-23 22:29:28 +02:00
%endif
2015-07-24 16:37:01 +02:00
%install
2017-06-23 22:29:28 +02:00
# If this is the test suite, we don't need anything else but the meson package
2023-07-13 15:25:08 +02:00
%if %{without test}
2023-07-14 12:04:47 +02:00
%python_install
2016-05-07 11:25:18 +02:00
2017-06-23 22:29:28 +02:00
install -Dpm 0644 data/macros.meson \
%{buildroot} %{_rpmconfigdir} /macros.d/macros.meson
2017-06-29 12:18:00 +02:00
2018-02-06 10:16:50 +01:00
install -Dpm 0644 data/syntax-highlighting/vim/ftdetect/meson.vim \
2018-12-16 23:15:56 +01:00
-t %{buildroot} %{vim_data_dir} /site/ftdetect/
2018-02-06 10:16:50 +01:00
install -Dpm 0644 data/syntax-highlighting/vim/indent/meson.vim \
2018-12-16 23:15:56 +01:00
-t %{buildroot} %{vim_data_dir} /site/indent/
2018-02-06 10:16:50 +01:00
install -Dpm 0644 data/syntax-highlighting/vim/syntax/meson.vim \
2018-12-16 23:15:56 +01:00
-t %{buildroot} %{vim_data_dir} /site/syntax/
2019-01-16 12:19:24 +01:00
# entry points are not distutils-able
%if !%{with setuptools}
mkdir -p %{buildroot} %{_bindir}
echo " " " # ! %{_bindir} / p y t h o n 3
from mesonbuild.mesonmain import main
2023-07-13 15:25:08 +02:00
import sys
2022-04-27 09:57:10 +02:00
2019-01-16 12:19:24 +01:00
sys.exit(main())
" " " > %{buildroot} %{_bindir} / %{name}
chmod +x %{buildroot} %{_bindir} /%{name}
2023-07-14 12:04:47 +02:00
%{python_expand %{$python_fix_shebang}
# ensure egg-info is a directory
rm %{buildroot} %{$python_sitelib}/*.egg-info
cp -r meson.egg-info %{buildroot} %{$python_sitelib}/meson-%{version} -py%{$python_version}.egg-info
}
2019-01-17 13:16:42 +01:00
2022-04-27 09:57:10 +02:00
# Fix missing data files with distutils
while read line; do
if [[ " $ l i n e " = %{_name}/* ]]; then
[[ " $ l i n e " = *.py ]] && continue
2023-07-13 15:25:08 +02:00
cp " $ l i n e " " %{buildroot} %{python_sitelib} / $ l i n e "
2022-04-27 09:57:10 +02:00
fi
done < meson.egg-info/SOURCES.txt
2019-01-16 12:19:24 +01:00
%endif
2017-06-23 22:29:28 +02:00
%endif
2015-07-24 16:37:01 +02:00
2019-01-16 12:19:24 +01:00
%if %{with test}
2015-07-24 16:37:01 +02:00
%check
2023-07-13 15:25:08 +02:00
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000
# Use gcc-12 for clang-tidy
install -d -m 0755 bin
ln -s /usr/bin/cpp-12 bin/cpp
ln -s /usr/bin/g++-12 bin/c++
ln -s /usr/bin/g++-12 bin/g++
ln -s /usr/bin/gcc-12 bin/cc
ln -s /usr/bin/gcc-12 bin/gcc
2023-07-19 13:40:04 +02:00
export PATH=" $ { P W D } / b i n : $ { P A T H } "
2023-07-13 15:25:08 +02:00
c++ --version
# Fix shebang in test cases getting executed by ninja
2023-07-19 13:40:04 +02:00
%python_expand find test\ cases -type f -name " * . p y " \
-exec sed -i " 1 s @ # ! . * p y t h o n . * @ # ! $ ( r e a l p a t h %{_bindir} / $ p y t h o n ) @ " {} +
2023-07-13 15:25:08 +02:00
%endif
2017-06-23 22:29:28 +02:00
export LANG=C.UTF-8
2018-08-04 23:27:12 +02:00
export MESON_EXE=%{_bindir} /meson
2023-07-13 15:25:08 +02:00
export PYTHONDONTWRITEBYTECODE=1
# See prep section for removed tests
%python_flavored_alternatives \
%python_expand $python run_tests.py --failfast
2017-06-23 22:29:28 +02:00
%endif
2015-07-24 16:37:01 +02:00
%files
2018-03-06 21:13:47 +01:00
%license COPYING
2019-01-16 12:19:24 +01:00
%if !%{with test}
2017-06-23 22:29:28 +02:00
%{_bindir} /meson
2023-07-13 15:25:08 +02:00
%{python_sitelib} /%{_name}/
%{python_sitelib} /meson-*
2018-08-04 23:27:12 +02:00
%dir %{_datadir} /polkit-1/
%dir %{_datadir} /polkit-1/actions/
%{_datadir} /polkit-1/actions/com.mesonbuild.install.policy
2017-06-23 22:29:28 +02:00
%{_rpmconfigdir} /macros.d/macros.meson
%{_mandir} /man1/meson.1%{?ext_man}
2015-07-24 16:37:01 +02:00
2017-06-29 12:18:00 +02:00
%files vim
2018-02-06 10:16:50 +01:00
%doc data/syntax-highlighting/vim/README
2018-12-16 23:15:56 +01:00
%dir %{vim_data_dir} /
%dir %{vim_data_dir} /site/
%dir %{vim_data_dir} /site/ftdetect/
%dir %{vim_data_dir} /site/indent/
%dir %{vim_data_dir} /site/syntax/
2017-06-29 12:18:00 +02:00
%{vim_data_dir} /site/ftdetect/meson.vim
%{vim_data_dir} /site/indent/meson.vim
%{vim_data_dir} /site/syntax/meson.vim
%endif
2015-07-24 16:37:01 +02:00
%changelog