mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-07-16 16:47:12 +02:00
chore: Remove setuptools from glad dependencies (#5392)
This commit is contained in:
@@ -20,7 +20,7 @@ include_guard(GLOBAL)
|
||||
#
|
||||
# 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 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/glad/cmake" glad2-cmake)
|
||||
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 @@ if(NOT GLAD_SKIP_PIP_INSTALL)
|
||||
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"
|
||||
"Install uv, or provide a Python interpreter with glad dependencies installed and set "
|
||||
"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 "
|
||||
"-DGLAD_SKIP_PIP_INSTALL=ON.")
|
||||
endif()
|
||||
|
||||
set(_glad_python_venv "${CMAKE_BINARY_DIR}/glad-python")
|
||||
message(STATUS "glad: jinja2 or setuptools not found in ${Python_EXECUTABLE}, installing via uv...")
|
||||
message(STATUS "glad: jinja2 not found in ${Python_EXECUTABLE}, installing via uv...")
|
||||
execute_process(
|
||||
COMMAND "${UV_EXECUTABLE}" venv
|
||||
--python "${Python_EXECUTABLE}"
|
||||
@@ -144,7 +144,6 @@ if(NOT GLAD_SKIP_PIP_INSTALL)
|
||||
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 @@ if(NOT GLAD_SKIP_PIP_INSTALL)
|
||||
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()
|
||||
|
||||
@@ -69,7 +69,6 @@ makedepends=(
|
||||
'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'
|
||||
)
|
||||
|
||||
|
||||
@@ -92,7 +92,6 @@ BuildRequires: libpulse-devel
|
||||
BuildRequires: npm
|
||||
BuildRequires: python311
|
||||
BuildRequires: python311-Jinja2
|
||||
BuildRequires: python311-setuptools
|
||||
%if !0%{?sle_version}
|
||||
BuildRequires: shaderc
|
||||
%endif
|
||||
@@ -250,7 +249,7 @@ cmake_args+=("-DPython_EXECUTABLE=%{_builddir}/Sunshine/.venv/bin/python")
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
# Use the Python interpreter that owns the python311-Jinja2/python311-setuptools BuildRequires.
|
||||
# Use the Python interpreter that owns the python311-Jinja2 BuildRequires.
|
||||
cmake_args+=("-DGLAD_SKIP_PIP_INSTALL=ON")
|
||||
cmake_args+=("-DPython_EXECUTABLE=/usr/bin/python3.11")
|
||||
%endif
|
||||
|
||||
@@ -109,13 +109,6 @@ class Sunshine < Formula
|
||||
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"
|
||||
|
||||
@@ -21,9 +21,6 @@ dependencies = [
|
||||
# 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 = [
|
||||
|
||||
@@ -299,7 +299,6 @@ function add_arch_deps() {
|
||||
'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 @@ function add_debian_based_deps() {
|
||||
"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 @@ function add_fedora_deps() {
|
||||
"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
|
||||
|
||||
@@ -563,15 +563,6 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/bb/f9/15b44d5e4401b0013bbcefe3c09d7bfddcce28cc3d41b1d3077bcedf5b1f/requirements_parser-0.13.1-py3-none-any.whl", hash = "sha256:6e385663eb32589d16e5b22bb6e5251a57908e73803ffff438b53cd6ea2056e0", size = 14926, upload-time = "2026-06-18T07:52:24.171Z" },
|
||||
]
|
||||
|
||||
[[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"
|
||||
@@ -596,7 +587,6 @@ flatpak = [
|
||||
]
|
||||
glad = [
|
||||
{ name = "glad2" },
|
||||
{ name = "setuptools" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
@@ -607,10 +597,7 @@ flatpak = [
|
||||
{ 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 = [
|
||||
{ name = "glad2", directory = "third-party/glad" },
|
||||
{ name = "setuptools", specifier = "<82" },
|
||||
]
|
||||
glad = [{ name = "glad2", directory = "third-party/glad" }]
|
||||
|
||||
[[package]]
|
||||
name = "yarl"
|
||||
|
||||
Reference in New Issue
Block a user