From e855a27bc9c1fbb0b263522977394bc2d03f5b89 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Mon, 10 Jun 2024 19:32:30 -0400 Subject: [PATCH] Add a patchelf build conditional - Add a comment briefly explaining what this does, where, and why. This does not change what is built by default in each place (Fedora, EPEL, RHEL), but it ties related conditional sections together and makes everything easier to test. [skip changelog] --- python-meson-python.spec | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/python-meson-python.spec b/python-meson-python.spec index b2e36bb..d8625db 100644 --- a/python-meson-python.spec +++ b/python-meson-python.spec @@ -2,6 +2,12 @@ # The python-pytest-mock dependency is unwanted on RHEL; we can omit it and # still run most of the tests. %bcond pytest_mock %{undefined rhel} +# RHEL will not have patchelf (which is used for adjusting RPATH in shared +# libraries bundled in wheels); that is OK because the package is +# buildroot-only there and the packages built with python-meson-python will not +# bundle shared libraries. In Fedora and EPEL, we must depend on patchelf to +# ship a full-featured package. +%bcond patchelf %{expr:%{undefined rhel} || %{defined epel}} Name: python-meson-python Summary: Meson Python build backend (PEP 517) @@ -42,7 +48,7 @@ Summary: %{summary} # When patchelf is not in the PATH, mesonpy.get_requires_for_build_wheel() adds # https://pypi.org/project/patchelf/ to the dependencies. We always want to use # the system patchelf. -%if 0%{?epel} || !0%{?rhel} +%if %{with patchelf} BuildRequires: /usr/bin/patchelf Requires: /usr/bin/patchelf %endif @@ -57,7 +63,7 @@ Requires: /usr/bin/patchelf %setup -n meson_python-%{version} -q %patch 0 -p1 %patch 1 -p1 -%if !0%{?epel} && 0%{?rhel} +%if %{without patchelf} %patch 2 -p1 %endif # build: used only by skipped PEP 518 test @@ -92,7 +98,7 @@ ignore="${ignore-} --ignore=tests/test_pep518.py" k="${k-}${k+ and }not test_invalid_build_dir" k="${k-}${k+ and }not test_use_ansi_colors" %endif -%if !0%{?epel} && 0%{?rhel} +%if %{without patchelf} k="${k-}${k+ and }not test_contents" k="${k-}${k+ and }not test_local_lib" k="${k-}${k+ and }not test_rpath"