summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/shaderc
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:31:53 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-11-07 13:31:53 +0000
commit8c22ff0d8b70d9b12f0487ef696a7e915b9e3173 (patch)
treeefdc32587159d0050a69009bdf2330a531727d95 /meta/recipes-graphics/shaderc
parentd412d2747595c1cc4a5e3ca975e3adc31b2f7891 (diff)
downloadpoky-8c22ff0d8b70d9b12f0487ef696a7e915b9e3173.tar.gz
The poky repository master branch is no longer being updated.
You can either: a) switch to individual clones of bitbake, openembedded-core, meta-yocto and yocto-docs b) use the new bitbake-setup You can find information about either approach in our documentation: https://docs.yoctoproject.org/ Note that "poky" the distro setting is still available in meta-yocto as before and we continue to use and maintain that. Long live Poky! Some further information on the background of this change can be found in: https://lists.openembedded.org/g/openembedded-architecture/message/2179 Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/shaderc')
-rw-r--r--meta/recipes-graphics/shaderc/files/0001-cmake-disable-building-external-dependencies.patch106
-rw-r--r--meta/recipes-graphics/shaderc/files/0002-libshaderc_util-fix-glslang-header-file-location.patch25
-rw-r--r--meta/recipes-graphics/shaderc/shaderc_2025.3.bb28
3 files changed, 0 insertions, 159 deletions
diff --git a/meta/recipes-graphics/shaderc/files/0001-cmake-disable-building-external-dependencies.patch b/meta/recipes-graphics/shaderc/files/0001-cmake-disable-building-external-dependencies.patch
deleted file mode 100644
index 77b81635b6..0000000000
--- a/meta/recipes-graphics/shaderc/files/0001-cmake-disable-building-external-dependencies.patch
+++ /dev/null
@@ -1,106 +0,0 @@
1From 3db09ee0d0bf6390eb3dcd835bd4ef786188bf16 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sat, 13 Feb 2021 00:45:56 +0000
4Subject: [PATCH] cmake: disable building external dependencies
5
6- add cmake option to disable the build of the third_party dependencies
7- change the update_build_version.py to use pkg-config when third_party dependencies not found
8
9Upstream-Status: Inappropriate [OE-core specific]
10
11Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
12---
13 CMakeLists.txt | 13 ++++++++++---
14 utils/update_build_version.py | 22 +++++++++++++++-------
15 2 files changed, 25 insertions(+), 10 deletions(-)
16
17diff --git a/CMakeLists.txt b/CMakeLists.txt
18index 06f5395..39b8869 100644
19--- a/CMakeLists.txt
20+++ b/CMakeLists.txt
21@@ -72,6 +72,7 @@ else()
22 endif()
23
24 option(SHADERC_ENABLE_WERROR_COMPILE "Enable passing -Werror to compiler, if available" ON)
25+option(BUILD_EXTERNAL "Build external dependencies in /third_party" ON)
26
27 set (CMAKE_CXX_STANDARD 17)
28
29@@ -129,8 +130,14 @@ endif(MSVC)
30
31
32 # Configure subdirectories.
33-# We depend on these for later projects, so they should come first.
34-add_subdirectory(third_party)
35+if(BUILD_EXTERNAL)
36+ # We depend on these for later projects, so they should come first.
37+ add_subdirectory(third_party)
38+else()
39+ find_package(PkgConfig REQUIRED)
40+ pkg_check_modules (PKG_CHECK REQUIRED SPIRV-Tools)
41+ pkg_check_modules (PKG_CHECK REQUIRED glslang)
42+endif()
43
44 add_subdirectory(libshaderc_util)
45 add_subdirectory(libshaderc)
46@@ -142,7 +149,7 @@ endif()
47 add_custom_target(build-version
48 ${Python_EXECUTABLE}
49 ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py
50- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc
51+ ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR}
52 COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).")
53
54 function(define_pkg_config_file NAME LIBS)
55diff --git a/utils/update_build_version.py b/utils/update_build_version.py
56index b7ce5b8..95b34c5 100755
57--- a/utils/update_build_version.py
58+++ b/utils/update_build_version.py
59@@ -30,6 +30,7 @@ import re
60 import subprocess
61 import sys
62 import time
63+import itertools
64
65 def mkdir_p(directory):
66 """Make the directory, and all its ancestors as required. Any of the
67@@ -121,25 +122,32 @@ def get_version_string(project, directory):
68 directory, which consists of software version string and git description
69 string."""
70 detailed_version_string_lst = [project]
71- if project != 'glslang':
72- detailed_version_string_lst.append(deduce_software_version(directory))
73- detailed_version_string_lst.append(describe(directory).replace('"', '\\"'))
74+ if isinstance(directory, str) and os.path.isdir(directory):
75+ if project != 'glslang':
76+ detailed_version_string_lst.append(deduce_software_version(directory))
77+ detailed_version_string_lst.append(describe(directory).replace('"', '\\"'))
78+ else:
79+ if project == 'spirv-tools':
80+ project = 'SPIRV-Tools'
81+ pkgconfig = ['pkg-config', '--modversion', project]
82+ version = subprocess.run(pkgconfig, capture_output=True, text=True).stdout.rstrip()
83+ detailed_version_string_lst.append(version)
84 return ' '.join(detailed_version_string_lst)
85
86
87 def main():
88- if len(sys.argv) != 5:
89- print(('usage: {} <shaderc-dir> <spirv-tools-dir> <glslang-dir> <output-file>'.format(
90+ if len(sys.argv) < 3:
91+ print(('usage: {} <output-file> <shaderc-dir> [spirv-tools-dir] [glslang-dir]'.format(
92 sys.argv[0])))
93 sys.exit(1)
94
95 projects = ['shaderc', 'spirv-tools', 'glslang']
96 new_content = ''.join([
97 '"{}\\n"\n'.format(get_version_string(p, d))
98- for (p, d) in zip(projects, sys.argv[1:])
99+ for (p, d) in itertools.zip_longest(projects, sys.argv[2:])
100 ])
101
102- output_file = sys.argv[4]
103+ output_file = sys.argv[1]
104 mkdir_p(os.path.dirname(output_file))
105
106 if os.path.isfile(output_file):
diff --git a/meta/recipes-graphics/shaderc/files/0002-libshaderc_util-fix-glslang-header-file-location.patch b/meta/recipes-graphics/shaderc/files/0002-libshaderc_util-fix-glslang-header-file-location.patch
deleted file mode 100644
index 429b53c308..0000000000
--- a/meta/recipes-graphics/shaderc/files/0002-libshaderc_util-fix-glslang-header-file-location.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1From 4797642a6394ad7e5a23aaa3bdf8e2d011f69adf Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <quaresma.jose@gmail.com>
3Date: Sat, 13 Feb 2021 00:45:56 +0000
4Subject: [PATCH] libshaderc_util: fix glslang header file location
5
6Upstream-Status: Pending
7
8Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
9---
10 libshaderc_util/src/compiler.cc | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc
14index 9bf9a43..dc0efd2 100644
15--- a/libshaderc_util/src/compiler.cc
16+++ b/libshaderc_util/src/compiler.cc
17@@ -20,7 +20,7 @@
18 #include <thread>
19 #include <tuple>
20
21-#include "SPIRV/GlslangToSpv.h"
22+#include "glslang/SPIRV/GlslangToSpv.h"
23 #include "libshaderc_util/format.h"
24 #include "libshaderc_util/io_shaderc.h"
25 #include "libshaderc_util/message.h"
diff --git a/meta/recipes-graphics/shaderc/shaderc_2025.3.bb b/meta/recipes-graphics/shaderc/shaderc_2025.3.bb
deleted file mode 100644
index 692e85e56c..0000000000
--- a/meta/recipes-graphics/shaderc/shaderc_2025.3.bb
+++ /dev/null
@@ -1,28 +0,0 @@
1SUMMARY = "A collection of tools, libraries and tests for shader compilation"
2DESCRIPTION = "The Shaderc library provides an API for compiling GLSL/HLSL \
3source code to SPIRV modules. It has been shipping in the Android NDK since version r12b."
4SECTION = "graphics"
5HOMEPAGE = "https://github.com/google/shaderc"
6LICENSE = "Apache-2.0"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
8
9SRCREV = "eb0bc20d0c31320fe834e4ee8eb02807292b9703"
10SRC_URI = "git://github.com/google/shaderc.git;protocol=https;branch=main;tag=v${PV} \
11 file://0001-cmake-disable-building-external-dependencies.patch \
12 file://0002-libshaderc_util-fix-glslang-header-file-location.patch \
13 "
14UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>\d+(\.\d+)+)$"
15
16inherit cmake python3native pkgconfig
17
18DEPENDS = "spirv-headers spirv-tools glslang"
19
20EXTRA_OECMAKE = " \
21 -DCMAKE_BUILD_TYPE=Release \
22 -DBUILD_EXTERNAL=OFF \
23 -DSHADERC_SKIP_TESTS=ON \
24 -DSHADERC_SKIP_EXAMPLES=ON \
25 -DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
26"
27
28BBCLASSEXTEND = "native nativesdk"