Use new-style RPM bconds

This commit is contained in:
Miro Hrončok 2024-10-15 18:16:01 +02:00
commit 7fc2da03e5

View file

@ -25,27 +25,16 @@ License: Python-2.0.1
# Conditionals controlling the build
# ==================================
# Note that the bcond macros are named for the CLI option they create.
# "%%bcond_without" means "ENABLE by default and create a --without option"
# Main Python, i.e. whether this is the main Python version in the distribution
# that owns /usr/bin/python3 and other unique paths
# This also means the built subpackages are called python3 rather than python3X
# By default, this is determined by the %%__default_python3_pkgversion value
%if "%{?__default_python3_pkgversion}" == "%{pybasever}"
%bcond_without main_python
%else
%bcond_with main_python
%endif
%bcond main_python %["%{?__default_python3_pkgversion}" == "%{pybasever}"]
# If this is *not* Main Python, should it contain `Provides: python(abi) ...`?
# In Fedora no package shall depend on an alternative Python via this tag, so we do not provide it.
# In ELN/RHEL/CentOS we want to allow building against alternative stacks, so the Provide is enabled.
%if 0%{?fedora}
%bcond_with python_abi_provides_for_alt_pythons
%else
%bcond_without python_abi_provides_for_alt_pythons
%endif
%bcond python_abi_provides_for_alt_pythons %{undefined fedora}
# When bootstrapping python3, we need to build python3-packaging.
# but packaging BR python3-devel and that brings in python3-rpm-generators;
@ -58,11 +47,11 @@ License: Python-2.0.1
# IMPORTANT: When bootstrapping, it's very likely python-pip-wheel is
# not available. Turn off the rpmwheels bcond until
# python-pip is built with a wheel to get around the issue.
%bcond_with bootstrap
%bcond bootstrap 0
# Whether to use RPM build wheels from the python-{pip,setuptools,wheel}-wheel packages
# Uses upstream bundled prebuilt wheels otherwise
%bcond_without rpmwheels
%bcond rpmwheels 1
# If the rpmwheels condition is disabled, we use the bundled wheel packages
# from Python with the versions below.
# This needs to be manually updated when we update Python.
@ -119,49 +108,45 @@ Provides: bundled(python3dist(packaging)) = 24
}
# Expensive optimizations (mainly, profile-guided optimizations)
%bcond_without optimizations
%bcond optimizations 1
# Run the test suite in %%check
%bcond_without tests
%bcond tests 1
# Extra build for debugging the interpreter or C-API extensions
# (the -debug subpackages)
%bcond_without debug_build
%bcond debug_build 1
# Extra build without GIL, the freethreading PEP 703 provisional way
# (the -freethreading subpackage)
%bcond_without freethreading_build
%bcond freethreading_build 1
# PEP 744: JIT Compilation
# Whether to build with the experimental JIT compiler
# We can only have this on Fedora 40+, where clang 18+ is available
# And only on certain architectures: https://peps.python.org/pep-0744/#support
# The freethreading build (when enabled) does not support JIT yet
%bcond_with jit
%ifarch x86_64 aarch64
%if 0%{?fedora} >= 40 || 0%{?rhel} >= 10
%bcond_without jit
%endif
%endif
%bcond jit %[(0%{?fedora} >= 40 || 0%{?rhel} >= 10) && ("%{_arch}" == "x86_64" || "%{_arch}" == "aarch64")]
%if %{with jit}
# When built with JIT, it still needs to be enabled on runtime via PYTHON_JIT=1
%global jit_flag --enable-experimental-jit=yes-off
%endif
# Support for the GDB debugger
%bcond_without gdb_hooks
%bcond gdb_hooks 1
# The dbm.gnu module (key-value database)
%bcond_without gdbm
%bcond gdbm 1
# Main interpreter loop optimization
%bcond_without computed_gotos
%bcond computed_gotos 1
# Support for the Valgrind debugger/profiler
# (no way to use %%ifarch as an expression)
%ifarch %{valgrind_arches}
%bcond_without valgrind
%bcond valgrind 1
%else
%bcond_with valgrind
%bcond valgrind 0
%endif
# =====================