Accepting request 1238473 from devel:tools:building

- Drop the bcond on setuptools, its primary flavor will live in Ring 0.
- Drop patch meson-distutils.patch, not required.
- Instruct autosetup macro to apply all patches.

OBS-URL: https://build.opensuse.org/request/show/1238473
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/meson?expand=0&rev=120
This commit is contained in:
Dominique Leuenberger 2025-01-18 12:18:09 +00:00 committed by Git OBS Bridge
commit 1a4292995b
3 changed files with 10 additions and 80 deletions

View File

@ -1,41 +0,0 @@
Index: b/setup.py
===================================================================
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ if sys.version_info < (3, 7):
raise SystemExit('ERROR: Tried to install Meson with an unsupported Python version: \n{}'
'\nMeson requires Python 3.7.0 or greater'.format(sys.version))
-from setuptools import setup
+from distutils.core import setup
data_files = []
if sys.platform != 'win32':
@@ -28,4 +28,16 @@ if sys.platform != 'win32':
data_files = [('share/man/man1', ['man/meson.1']),
('share/polkit-1/actions', ['data/com.mesonbuild.install.policy'])]
-setup(data_files=data_files,)
+# Since distutils does not understand the find: directive in setup.cfg, and
+# therefore doesn't expand it, we need to do it directly
+import os
+packages=[
+ root.replace('/', '.')
+ for root, dirs, files in os.walk('mesonbuild')
+ if '__init__.py' in files]
+
+setup(
+ packages=packages,
+ package_data={'mesonbuild.dependencies.data': ['mesonbuild/dependencies/data/*.txt']},
+ data_files=data_files,
+)
Index: b/MANIFEST.in
===================================================================
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -17,3 +17,5 @@ include run_unittests.py
include run_meson_command_tests.py
include run_project_tests.py
include meson.py
+
+include mesonbuild/dependencies/data/*.txt

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Jan 16 04:16:31 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Drop the bcond on setuptools, its primary flavor will live in Ring 0.
- Drop patch meson-distutils.patch, not required.
- Instruct autosetup macro to apply all patches.
-------------------------------------------------------------------
Tue Dec 17 07:21:30 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package meson
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2024 Andreas Stieger <Andreas.Stieger@gmx.de>
#
# All modifications and additions to the file contributed by third parties
@ -33,7 +33,6 @@
%endif
%define _name mesonbuild
%{!?vim_data_dir:%global vim_data_dir %{_datadir}/vim}
%bcond_with setuptools
%bcond_without mono
Name: meson%{name_ext}
Version: 1.6.1
@ -49,16 +48,11 @@ Source2: meson.keyring
Patch0: meson-test-installed-bin.patch
# PATCH-FIX-OPENSUSE give more time to testsuites that run emulated
Patch1: extend-test-timeout-on-qemu-builds.patch
# PATCH-FIX-OPENSUSE meson-distutils.patch -- meson is ring0 and therefor setuptools is not available
Patch2: meson-distutils.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with setuptools}
BuildRequires: %{python_module setuptools}
Requires: python3-setuptools
%endif
%if "%{flavor}" != "test"
Requires: ninja >= 1.8.2
# meson-gui was last used in openSUSE Leap 42.1.
@ -182,12 +176,7 @@ This package provides meson.build syntax highlighting support for
Vim/NeoVim.
%prep
%autosetup -N -n meson-%{version}
%patch -P 0 -p1
%patch -P 1 -p1
%if !%{with setuptools}
%patch -P 2 -p1
%endif
%autosetup -p1 -n meson-%{version}
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000
# AddressSanitizer fails here because of ulimit.
@ -234,31 +223,6 @@ install -Dpm 0644 data/syntax-highlighting/vim/indent/meson.vim \
install -Dpm 0644 data/syntax-highlighting/vim/syntax/meson.vim \
-t %{buildroot}%{vim_data_dir}/site/syntax/
# entry points are not distutils-able
%if !%{with setuptools}
mkdir -p %{buildroot}%{_bindir}
echo """#!%{_bindir}/python3
from mesonbuild.mesonmain import main
import sys
sys.exit(main())
""" > %{buildroot}%{_bindir}/%{name}
chmod +x %{buildroot}%{_bindir}/%{name}
%{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
}
# Fix missing data files with distutils
while read line; do
if [[ "$line" = %{_name}/* ]]; then
[[ "$line" = *.py ]] && continue
cp "$line" "%{buildroot}%{python_sitelib}/$line"
fi
done < meson.egg-info/SOURCES.txt
%endif
%endif
%if %{with test}