File: Fix-shader-inclusion-order.patch

package info (click to toggle)
hyprland 0.52.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 53,660 kB
  • sloc: cpp: 73,083; xml: 4,094; sh: 235; makefile: 96
file content (28 lines) | stat: -rw-r--r-- 1,122 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From: Carl Keinath <carl.keinath@gmail.com>
Date: Sat, 22 Nov 2025 00:18:30 +0100
Subject: Fix shader inclusion order

Sort the shader files when generating Shaders.hpp. This makes `reprotest
--variations=+fileordering` happy.

Origin: Debian
Forwarded: no
Author: Chow Loong Jin <hyperair@debian.org>
---
 scripts/generateShaderIncludes.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/generateShaderIncludes.sh b/scripts/generateShaderIncludes.sh
index 20c78e9..0b6e9b6 100755
--- a/scripts/generateShaderIncludes.sh
+++ b/scripts/generateShaderIncludes.sh
@@ -12,7 +12,8 @@ echo '#pragma once' > ./src/render/shaders/Shaders.hpp
 echo '#include <map>' >> ./src/render/shaders/Shaders.hpp
 echo 'static const std::map<std::string, std::string> SHADERS = {' >> ./src/render/shaders/Shaders.hpp
 
-for filename in `ls ${SHADERS_SRC}`; do
+find "$SHADERS_SRC" -maxdepth 1 -type f | sort -fdi | while read -r filepath; do
+	filename=${filepath#"${SHADERS_SRC}"/}
 	echo "--	${filename}"
 	
 	{ echo 'R"#('; cat ${SHADERS_SRC}/${filename}; echo ')#"'; } > ./src/render/shaders/${filename}.inc