Skip to content

Commit d9ab2b7

Browse files
neatnoiseReenigneArcher
authored andcommitted
fix: use find_program for shader compiler, fix packaging deps
- Replace find_package(Vulkan COMPONENTS glslc) with find_program() so shader compiler detection works without system Vulkan headers - Move glslc BuildRequires to Fedora-only, add shaderc for OpenSUSE - Add shaderc dependency to Homebrew formula
1 parent 3a6ae3f commit d9ab2b7

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

cmake/compile_definitions/linux.cmake

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ if(${SUNSHINE_ENABLE_VULKAN})
134134
endif()
135135

136136
# prefer glslc, fall back to glslangValidator
137-
find_package(Vulkan QUIET COMPONENTS glslc)
138-
if(NOT TARGET Vulkan::glslc)
139-
find_package(Vulkan QUIET COMPONENTS glslangValidator)
137+
find_program(GLSLC_EXECUTABLE glslc)
138+
if(NOT GLSLC_EXECUTABLE)
139+
find_program(GLSLANG_EXECUTABLE glslangValidator)
140140
endif()
141-
if(NOT TARGET Vulkan::glslc AND NOT TARGET Vulkan::glslangValidator)
141+
if(NOT GLSLC_EXECUTABLE AND NOT GLSLANG_EXECUTABLE)
142142
message(FATAL_ERROR "Vulkan shader compiler not found (need glslc or glslangValidator)")
143143
endif()
144144

@@ -157,17 +157,17 @@ if(${SUNSHINE_ENABLE_VULKAN})
157157

158158
file(MAKE_DIRECTORY "${VULKAN_SHADER_DIR}")
159159

160-
if(TARGET Vulkan::glslc)
160+
if(GLSLC_EXECUTABLE)
161161
add_custom_command(
162162
OUTPUT "${VULKAN_SHADER_SPV}"
163-
COMMAND Vulkan::glslc -O "${VULKAN_SHADER_SOURCE}" -o "${VULKAN_SHADER_SPV}"
163+
COMMAND ${GLSLC_EXECUTABLE} -O "${VULKAN_SHADER_SOURCE}" -o "${VULKAN_SHADER_SPV}"
164164
DEPENDS "${VULKAN_SHADER_SOURCE}"
165165
COMMENT "Compiling Vulkan shader rgb2yuv.comp (glslc)"
166166
VERBATIM)
167167
else()
168168
add_custom_command(
169169
OUTPUT "${VULKAN_SHADER_SPV}"
170-
COMMAND Vulkan::glslangValidator -V -o "${VULKAN_SHADER_SPV}" "${VULKAN_SHADER_SOURCE}"
170+
COMMAND ${GLSLANG_EXECUTABLE} -V -o "${VULKAN_SHADER_SPV}" "${VULKAN_SHADER_SOURCE}"
171171
DEPENDS "${VULKAN_SHADER_SOURCE}"
172172
COMMENT "Compiling Vulkan shader rgb2yuv.comp (glslangValidator)"
173173
VERBATIM)

packaging/linux/copr/Sunshine.spec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ BuildRequires: libXinerama-devel
4141
BuildRequires: libXrandr-devel
4242
BuildRequires: libXtst-devel
4343
BuildRequires: openssl-devel
44-
BuildRequires: glslc
4544
BuildRequires: pipewire-devel
4645
BuildRequires: rpm-build
4746
BuildRequires: systemd-rpm-macros
@@ -53,6 +52,7 @@ BuildRequires: which
5352
# Fedora-specific BuildRequires
5453
BuildRequires: appstream
5554
# BuildRequires: boost-devel >= 1.86.0
55+
BuildRequires: glslc
5656
BuildRequires: libappstream-glib
5757
%if 0%{fedora} > 43
5858
# needed for npm from nvm
@@ -93,6 +93,7 @@ BuildRequires: npm
9393
BuildRequires: python311
9494
BuildRequires: python311-Jinja2
9595
BuildRequires: python311-setuptools
96+
BuildRequires: shaderc
9697
BuildRequires: udev
9798
# for unit tests
9899
BuildRequires: xvfb-run

packaging/sunshine.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ class Sunshine < Formula
9696
depends_on "pango"
9797
depends_on "pipewire"
9898
depends_on "pulseaudio"
99+
depends_on "shaderc"
99100
depends_on "systemd"
100101
depends_on "vulkan-loader"
101102
depends_on "wayland"

0 commit comments

Comments
 (0)