From 37308b9c8b036882204c7b16b8496d8f62df8b5adda01dcec1026320f65a8098 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Thu, 13 Jul 2023 13:25:08 +0000 Subject: [PATCH 1/3] Accepting request 1098538 from home:gladiac:mailman - Set pythons for Leap and Tumbleweed OBS-URL: https://build.opensuse.org/request/show/1098538 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/meson?expand=0&rev=251 --- meson.changes | 5 +++ meson.spec | 98 +++++++++++++++++++++++++++++++++++---------------- 2 files changed, 73 insertions(+), 30 deletions(-) diff --git a/meson.changes b/meson.changes index 67ef4d9..74ecf67 100644 --- a/meson.changes +++ b/meson.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jun 29 07:26:32 UTC 2023 - Andreas Schneider + +- Set pythons for Leap and Tumbleweed + ------------------------------------------------------------------- Tue Jun 6 18:22:01 UTC 2023 - Dominique Leuenberger diff --git a/meson.spec b/meson.spec index 9aa833e..3d77504 100644 --- a/meson.spec +++ b/meson.spec @@ -16,6 +16,12 @@ # +%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 +%global pythons python311 +%else +%global pythons python3 +%endif + %global flavor @BUILD_FLAVOR@%{nil} %if "%{flavor}" == "test" %define name_ext -test @@ -44,31 +50,39 @@ Patch0: meson-test-installed-bin.patch 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 pip} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: python3-base >= 3.7 %if %{with setuptools} -BuildRequires: python3-setuptools +BuildRequires: %{python_module setuptools} Requires: python3-setuptools %endif %if "%{flavor}" != "test" Requires: ninja >= 1.8.2 -Requires: python3-base >= 3.7 # meson-gui was last used in openSUSE Leap 42.1. Provides: meson-gui = %{version} Obsoletes: meson-gui < %{version} BuildArch: noarch %else ExclusiveArch: %{ix86} x86_64 +BuildRequires: %{python_module devel} BuildRequires: bison -BuildRequires: clang +BuildRequires: clang >= 15 BuildRequires: cups-devel BuildRequires: distribution-release BuildRequires: flex -BuildRequires: gcc-c++ -BuildRequires: gcc-fortran -BuildRequires: gcc-obj-c++ -BuildRequires: gcc-objc +%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 BuildRequires: gettext BuildRequires: git BuildRequires: gmock @@ -77,7 +91,11 @@ BuildRequires: googletest-devel BuildRequires: itstool BuildRequires: java-headless BuildRequires: libboost_log-devel +# This will be required to build to python311 BuildRequires: libboost_python3-devel +BuildRequires: %{python_module devel} +BuildRequires: %{python_module gobject} +BuildRequires: %{python_module pytest-xdist} BuildRequires: libboost_system-devel BuildRequires: libboost_test-devel BuildRequires: libboost_thread-devel @@ -90,9 +108,6 @@ BuildRequires: llvm-devel BuildRequires: meson = %{version} BuildRequires: ninja BuildRequires: pkgconfig -BuildRequires: python3-devel -BuildRequires: python3-gobject -BuildRequires: python3-pytest-xdist BuildRequires: rust BuildRequires: wxWidgets-any-devel BuildRequires: zlib-devel-static @@ -114,6 +129,7 @@ BuildRequires: libboost_python-devel # Leap / SLE 15.x BuildRequires: python2-PyYAML BuildRequires: python2-devel +BuildRequires: python3-devel %endif %if %{with mono} BuildRequires: mono(csharp) @@ -158,27 +174,31 @@ Vim/NeoVim. %patch2 -p1 %endif -# We do not have appleframeworks available at this moment - can't run the test suite for it -# boost is currently borked too -rm -r "test cases/frameworks/1 boost" \ - "test cases/objc/2 nsstring" - +%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 # AddressSanitizer fails here because of ulimit. sed -i "/def test_generate_gir_with_address_sanitizer/{ s/$/\n raise unittest.SkipTest('ulimit')/; - }" run_unittests.py + }" unittests/linuxliketests.py + +# Expects modern glibc with pthread symbols in libc.so +rm -rf test\ cases/rust/17\ staticlib\ link\ staticlib +%endif # Remove hashbang from non-exec script sed -i '1{/\/usr\/bin\/env/d;}' \ ./mesonbuild/rewriter.py \ ./mesonbuild/scripts/cmake_run_ctgt.py +# We do not have appleframeworks available at this moment - can't run the test suite for it +# boost is currently borked too +rm -r "test cases/frameworks/1 boost" \ + "test cases/objc/2 nsstring" # remove gtest check that actually works because our gtest has .pc files rm -rf test\ cases/failing/85\ gtest\ dependency\ with\ version %build -%if !%{with test} -%python3_build +%if %{without test} +%pyproject_wheel %else # Ensure we have no mesonbuild / meson in CWD, thus guaranteeing we use meson in $PATH rm -r meson.py mesonbuild @@ -186,9 +206,9 @@ rm -r meson.py mesonbuild %install # If this is the test suite, we don't need anything else but the meson package -%if !%{with test} -%python3_install -%fdupes %{buildroot}%{python3_sitelib} +%if %{without test} +%pyproject_install +%fdupes %{buildroot}%{python_sitelib} install -Dpm 0644 data/macros.meson \ %{buildroot}%{_rpmconfigdir}/macros.d/macros.meson @@ -204,21 +224,19 @@ install -Dpm 0644 data/syntax-highlighting/vim/syntax/meson.vim \ %if !%{with setuptools} mkdir -p %{buildroot}%{_bindir} echo """#!%{_bindir}/python3 -import sys 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}%{python3_sitelib}/*.egg-info -cp -r meson.egg-info %{buildroot}%{python3_sitelib}/meson-%{version}-py%{python3_version}.egg-info # Fix missing data files with distutils while read line; do if [[ "$line" = %{_name}/* ]]; then [[ "$line" = *.py ]] && continue - cp "$line" "%{buildroot}%{python3_sitelib}/$line" + cp "$line" "%{buildroot}%{python_sitelib}/$line" fi done < meson.egg-info/SOURCES.txt %endif @@ -226,17 +244,37 @@ done < meson.egg-info/SOURCES.txt %if %{with test} %check + +%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 +export PATH="$(pwd)/bin:${PATH}" +c++ --version + +# Fix shebang in test cases getting executed by ninja +%python_expand find test\ cases -type f -name "*.py" -exec sed -i "1s@#!.*python.*@#!$(realpath %{_bindir}/$python)@" {} + +%endif + export LANG=C.UTF-8 export MESON_EXE=%{_bindir}/meson -python3 run_tests.py --failfast +export PYTHONDONTWRITEBYTECODE=1 + +# See prep section for removed tests +%python_flavored_alternatives \ +%python_expand $python run_tests.py --failfast %endif %files %license COPYING %if !%{with test} %{_bindir}/meson -%{python3_sitelib}/%{_name}/ -%{python3_sitelib}/meson-* +%{python_sitelib}/%{_name}/ +%{python_sitelib}/meson-* %dir %{_datadir}/polkit-1/ %dir %{_datadir}/polkit-1/actions/ %{_datadir}/polkit-1/actions/com.mesonbuild.install.policy From a86c3422a550f2e1b2de1ce16689d5fcceb7490a4d4658e811e8f4fb5ed81cc1 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 14 Jul 2023 10:04:47 +0000 Subject: [PATCH 2/3] Accepting request 1098647 from GNOME:Next - Be leaner with the build deps: + Do not buildrequire python-pip and -wheel: being part of ring0 we have to be extra careful. + Use python_build/python_install instead of pyproject_wheel/pyproject_install. OBS-URL: https://build.opensuse.org/request/show/1098647 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/meson?expand=0&rev=252 --- meson.changes | 9 +++++++++ meson.spec | 14 ++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/meson.changes b/meson.changes index 74ecf67..754445a 100644 --- a/meson.changes +++ b/meson.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Jul 14 10:01:09 UTC 2023 - Dominique Leuenberger + +- Be leaner with the build deps: + + Do not buildrequire python-pip and -wheel: being part of ring0 + we have to be extra careful. + + Use python_build/python_install instead of + pyproject_wheel/pyproject_install. + ------------------------------------------------------------------- Thu Jun 29 07:26:32 UTC 2023 - Andreas Schneider diff --git a/meson.spec b/meson.spec index 3d77504..12f8da0 100644 --- a/meson.spec +++ b/meson.spec @@ -50,8 +50,6 @@ Patch0: meson-test-installed-bin.patch 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 pip} -BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros %if %{with setuptools} @@ -198,7 +196,7 @@ rm -rf test\ cases/failing/85\ gtest\ dependency\ with\ version %build %if %{without test} -%pyproject_wheel +%python_build %else # Ensure we have no mesonbuild / meson in CWD, thus guaranteeing we use meson in $PATH rm -r meson.py mesonbuild @@ -207,8 +205,7 @@ rm -r meson.py mesonbuild %install # If this is the test suite, we don't need anything else but the meson package %if %{without test} -%pyproject_install -%fdupes %{buildroot}%{python_sitelib} +%python_install install -Dpm 0644 data/macros.meson \ %{buildroot}%{_rpmconfigdir}/macros.d/macros.meson @@ -230,7 +227,12 @@ import sys sys.exit(main()) """ > %{buildroot}%{_bindir}/%{name} chmod +x %{buildroot}%{_bindir}/%{name} -%{python_expand %{$python_fix_shebang}} +%{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 From 9cee08ac0262b7086ed16e70d45008367a848498727f974cc98850bf50708edb Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 14 Jul 2023 11:10:58 +0000 Subject: [PATCH 3/3] Accepting request 1098664 from GNOME:Next OBS-URL: https://build.opensuse.org/request/show/1098664 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/meson?expand=0&rev=253 --- meson.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.spec b/meson.spec index 12f8da0..2da344d 100644 --- a/meson.spec +++ b/meson.spec @@ -50,6 +50,7 @@ Patch0: meson-test-installed-bin.patch 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: fdupes BuildRequires: python-rpm-macros %if %{with setuptools}