ref:dc419367f34b10d2f52d6cbc01d082b1c04758fb

chore: Remove setuptools from glad dependencies (#5392)

SHA: dc419367f34b10d2f52d6cbc01d082b1c04758fb
Author: Dave Lane <42013603+ReenigneArcher@users.noreply.github.com>
Date: 2026-07-08 20:04
Parents: 0131793
7 files changed +11 -40
Type
cmake/dependencies/glad.cmake +9 −10
@@ -20,7 +20,7 @@
#
# GLAD_SKIP_PIP_INSTALL is a hard override for environments where Python dependency installs cannot run
# at all (e.g. Flatpak, Homebrew). When OFF (the default) the code below checks
# whether jinja2+setuptools are importable and installs them with uv if they are not.
# whether jinja2 is importable and installs it with uv if it is not.
# When ON the caller is responsible for supplying a Python that already has jinja2,
# typically via -DPython_EXECUTABLE=/path/to/venv/python.
option(GLAD_SKIP_PIP_INSTALL
@@ -104,11 +104,11 @@
unset(CMAKE_POLICY_VERSION_MINIMUM)
if(NOT GLAD_SKIP_PIP_INSTALL)
# Check whether jinja2 and pkg_resources (setuptools) are already importable.
# pkg_resources is provided by setuptools, which is no longer bundled with Python 3.12+
# on several distros (Debian Trixie, Arch Linux, COPR, FreeBSD, etc.).
# Check whether jinja2 is already importable. Supported Python versions use
# importlib.metadata and importlib.resources in glad, so setuptools' legacy
# pkg_resources module is not required by the generator.
execute_process(
COMMAND "${Python_EXECUTABLE}" -c "import jinja2; import pkg_resources"
COMMAND "${Python_EXECUTABLE}" -c "import jinja2"
RESULT_VARIABLE _glad_deps_import_result
OUTPUT_QUIET
ERROR_QUIET
@@ -118,13 +118,13 @@
find_program(UV_EXECUTABLE uv)
if(NOT UV_EXECUTABLE)
message(FATAL_ERROR
"glad: jinja2 or setuptools not found in ${Python_EXECUTABLE}, and uv is not available.\n"
"glad: jinja2 not found in ${Python_EXECUTABLE}, and uv is not available.\n"
"Install uv, or provide a Python interpreter with jinja2 installed and set "
"Install uv, or provide a Python interpreter with glad dependencies installed and set "
"-DGLAD_SKIP_PIP_INSTALL=ON.")
endif()
set(_glad_python_venv "${CMAKE_BINARY_DIR}/glad-python")
message(STATUS "glad: jinja2 not found in ${Python_EXECUTABLE}, installing via uv...")
message(STATUS "glad: jinja2 or setuptools not found in ${Python_EXECUTABLE}, installing via uv...")
execute_process(
COMMAND "${UV_EXECUTABLE}" venv
--python "${Python_EXECUTABLE}"
@@ -144,7 +144,6 @@
COMMAND "${UV_EXECUTABLE}" pip install
--python "${_glad_python_executable}"
--requirement "${CMAKE_SOURCE_DIR}/third-party/glad/requirements.txt"
"setuptools<81"
--quiet
COMMAND_ERROR_IS_FATAL ANY
)
@@ -154,7 +153,7 @@
set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE FILEPATH "Python interpreter for glad" FORCE)
else()
message(STATUS
"glad: jinja2 and setuptools already available in "
"glad: jinja2 already available in "
"${Python_EXECUTABLE}, skipping Python dependency install")
endif()
endif()
packaging/linux/Arch/PKGBUILD +0 −1
@@ -69,6 +69,5 @@
'nodejs'
'npm'
'python-jinja' # required by the glad OpenGL/EGL loader generator
'python-setuptools' # required for glad OpenGL/EGL loader generated, v2.0.0
'shaderc'
)
packaging/linux/copr/Sunshine.spec +1 −2
@@ -92,7 +92,6 @@
BuildRequires: npm
BuildRequires: python311
BuildRequires: python311-Jinja2
BuildRequires: python311-setuptools
%if !0%{?sle_version}
BuildRequires: shaderc
%endif
@@ -250,7 +249,7 @@
%endif
%if 0%{?suse_version}
# Use the Python interpreter that owns the python311-Jinja2 BuildRequires.
# Use the Python interpreter that owns the python311-Jinja2/python311-setuptools BuildRequires.
cmake_args+=("-DGLAD_SKIP_PIP_INSTALL=ON")
cmake_args+=("-DPython_EXECUTABLE=/usr/bin/python3.11")
%endif
packaging/sunshine.rb +0 −7
@@ -109,13 +109,6 @@
url "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz"
sha256 "0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"
end
# setuptools provides pkg_resources which glad's plugin.py imports at build time.
# setuptools >= 81 removed pkg_resources; this is the last release that still ships it.
resource "setuptools" do
url "https://files.pythonhosted.org/packages/76/95/faf61eb8363f26aa7e1d762267a8d602a1b26d4f3a1e758e92cb3cb8b054/setuptools-80.10.2.tar.gz"
sha256 "8b0e9d10c784bf7d262c4e5ec5d4ec94127ce206e8738f29a437945fbc219b70"
end
end
conflicts_with "sunshine-beta", because: "sunshine and sunshine-beta cannot be installed at the same time"
pyproject.toml +0 −3
@@ -21,9 +21,6 @@
# The platform marker limits this to Linux where the glad generator is actually used.
glad = [
"glad2",
# setuptools provides pkg_resources which glad's plugin.py imports.
# setuptools 82 removes pkg_resources; pin to the last series that includes it.
"setuptools<82",
]
flatpak = [
scripts/linux_build.sh +0 −3
@@ -299,7 +299,6 @@
'openssl'
'opus'
'python-jinja' # glad OpenGL/EGL loader generator
'python-setuptools' # glad OpenGL/EGL loader generated, v2.0.0
'qt6-base'
'qt6-svg'
'shaderc'
@@ -364,7 +363,6 @@
"ninja-build"
"npm" # web-ui
"python3-jinja2" # glad OpenGL/EGL loader generator
"python3-setuptools" # glad OpenGL/EGL loader generated, v2.0.0
"qt6-base-dev"
"systemd"
"udev"
@@ -470,7 +468,6 @@
"pipewire-devel"
"pulseaudio-libs-devel"
"python3-jinja2" # glad OpenGL/EGL loader generator
"python3-setuptools" # glad OpenGL/EGL loader generated, v2.0.0
"qt6-qtbase-devel"
"qt6-qtsvg-devel"
"rpm-build" # if you want to build an RPM binary package
uv.lock +1 −14
@@ -564,15 +564,6 @@
]
[[package]]
name = "setuptools"
version = "81.0.0"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/0d/1c/73e719955c59b8e424d015ab450f51c0af856ae46ea2da83eba51cc88de1/setuptools-81.0.0.tar.gz", hash = "sha256:487b53915f52501f0a79ccfd0c02c165ffe06631443a886740b91af4b7a5845a", size = 1198299, upload-time = "2026-02-06T21:10:39.601Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/e1/e3/c164c88b2e5ce7b24d667b9bd83589cf4f3520d97cad01534cd3c4f55fdb/setuptools-81.0.0-py3-none-any.whl", hash = "sha256:fdd925d5c5d9f62e4b74b30d6dd7828ce236fd6ed998a08d81de62ce5a6310d6", size = 1062021, upload-time = "2026-02-06T21:10:37.175Z" },
]
[[package]]
name = "six"
version = "1.17.0"
source = { registry = "https://pypi.org/simple" }
@@ -596,7 +587,6 @@
]
glad = [
{ name = "glad2" },
{ name = "setuptools" },
]
[package.metadata]
@@ -607,10 +597,7 @@
{ name = "flatpak-node-generator", directory = "packaging/linux/flatpak/deps/flatpak-builder-tools/node" },
{ name = "flatpak-pip-generator", directory = "packaging/linux/flatpak/deps/flatpak-builder-tools/pip" },
]
glad = [
glad = [{ name = "glad2", directory = "third-party/glad" }]
{ name = "glad2", directory = "third-party/glad" },
{ name = "setuptools", specifier = "<82" },
]
[[package]]
name = "yarl"