summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/vk-gl-cts/files
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-graphics/vk-gl-cts/files')
-rw-r--r--meta-oe/recipes-graphics/vk-gl-cts/files/0001-Fix-missing-include-cstdint-causing-build-failures.patch47
-rw-r--r--meta-oe/recipes-graphics/vk-gl-cts/files/0001-cmake-Define-WAYLAND_SCANNER-and-WAYLAND_PROTOCOLS_D.patch22
-rw-r--r--meta-oe/recipes-graphics/vk-gl-cts/files/0001-use-library-sonames-for-linking.patch123
-rw-r--r--meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkan-cts-include-missing-cstdint.patch34
-rw-r--r--meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkancts-Include-missing-cstdint.patch32
-rw-r--r--meta-oe/recipes-graphics/vk-gl-cts/files/fix-clang-private-operator.patch2
-rw-r--r--meta-oe/recipes-graphics/vk-gl-cts/files/fix-musl.patch4
-rw-r--r--meta-oe/recipes-graphics/vk-gl-cts/files/gen-framework-path.patch20
-rwxr-xr-xmeta-oe/recipes-graphics/vk-gl-cts/files/generate-srcuri.py131
9 files changed, 315 insertions, 100 deletions
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-Fix-missing-include-cstdint-causing-build-failures.patch b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-Fix-missing-include-cstdint-causing-build-failures.patch
new file mode 100644
index 0000000000..44632bc74f
--- /dev/null
+++ b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-Fix-missing-include-cstdint-causing-build-failures.patch
@@ -0,0 +1,47 @@
1From 1d80b54aefd1f5f361990b1223c6fe308a8d3085 Mon Sep 17 00:00:00 2001
2From: Ricardo Garcia <rgarcia@igalia.com>
3Date: Mon, 21 Apr 2025 12:30:05 +0200
4Subject: [PATCH] Fix missing #include <cstdint> causing build failures
5
6Tested on Fedora 42 with clang.
7
8Upstream-Status: Submitted [https://github.com/google/amber/pull/1092]
9
10Fixes:
11http://errors.yoctoproject.org/Errors/Details/852849/
12
13In file included from TOPDIR/tmp/work/core2-64-oe-linux/vulkan-cts/1.4.1.0/git/external/amber/src/src/type.cc:15:
14TOPDIR/tmp/work/core2-64-oe-linux/vulkan-cts/1.4.1.0/git/external/amber/src/src/type.h:56:39: error: 'uint32_t' has not been declared
15 56 | static bool IsInt8(FormatMode mode, uint32_t num_bits) {
16 | ^~~~~~~~
17
18Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
19---
20 src/tokenizer.h | 1 +
21 src/type.h | 1 +
22 2 files changed, 2 insertions(+)
23
24diff --git a/src/tokenizer.h b/src/tokenizer.h
25index 53efec60..ea4f19df 100644
26--- a/src/tokenizer.h
27+++ b/src/tokenizer.h
28@@ -16,6 +16,7 @@
29 #define SRC_TOKENIZER_H_
30
31 #include <cstdlib>
32+#include <cstdint>
33 #include <memory>
34 #include <string>
35
36diff --git a/src/type.h b/src/type.h
37index c63779ba..97720f29 100644
38--- a/src/type.h
39+++ b/src/type.h
40@@ -16,6 +16,7 @@
41 #define SRC_TYPE_H_
42
43 #include <cassert>
44+#include <cstdint>
45 #include <memory>
46 #include <string>
47 #include <vector>
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-cmake-Define-WAYLAND_SCANNER-and-WAYLAND_PROTOCOLS_D.patch b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-cmake-Define-WAYLAND_SCANNER-and-WAYLAND_PROTOCOLS_D.patch
index f659e36066..9eef9a702e 100644
--- a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-cmake-Define-WAYLAND_SCANNER-and-WAYLAND_PROTOCOLS_D.patch
+++ b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-cmake-Define-WAYLAND_SCANNER-and-WAYLAND_PROTOCOLS_D.patch
@@ -15,15 +15,15 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 15
16--- a/framework/platform/CMakeLists.txt 16--- a/framework/platform/CMakeLists.txt
17+++ b/framework/platform/CMakeLists.txt 17+++ b/framework/platform/CMakeLists.txt
18@@ -73,8 +73,9 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS) 18@@ -83,8 +83,9 @@ if (NOT DEFINED TCUTIL_PLATFORM_SRCS)
19 add_definitions(-DDEQP_SUPPORT_WAYLAND=1) 19 configure_file(${WAYLAND_XDG_SHELL_SRC_DIR}/xdg-shell.c ${DEQP_XDG_SHELL_GEN_OUTPUTS_DIR}/xdg-shell.c COPYONLY)
20 include_directories(lnx/wayland) 20 configure_file(${WAYLAND_XDG_SHELL_SRC_DIR}/xdg-shell.h ${DEQP_XDG_SHELL_GEN_OUTPUTS_DIR}/xdg-shell.h COPYONLY)
21 21 else ()
22- pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) 22- pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
23- 23-
24+ if (NOT WAYLAND_PROTOCOLS_DIR) 24+ if (NOT WAYLAND_PROTOCOL_DIR)
25+ pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) 25+ pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
26+ endif() 26+ endif()
27 if (NOT WAYLAND_SCANNER) 27 if (NOT WAYLAND_SCANNER)
28 pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner) 28 pkg_get_variable(WAYLAND_SCANNER wayland-scanner wayland_scanner)
29 endif() 29 endif()
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-use-library-sonames-for-linking.patch b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-use-library-sonames-for-linking.patch
new file mode 100644
index 0000000000..5e19ed2db3
--- /dev/null
+++ b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-use-library-sonames-for-linking.patch
@@ -0,0 +1,123 @@
1From acd25c4b8d5b7e420a7a89bdfd6551c70de828b3 Mon Sep 17 00:00:00 2001
2From: Trevor Woerner <twoerner@gmail.com>
3Date: Thu, 23 Sep 2021 19:36:43 -0400
4Subject: [PATCH] use library sonames for linking
5
6The recommended "best practices" for applications is to link to library
7sonames (e.g. libGL.so.1) instead of library names (e.g. libGL.so). This
8ensures that applications don't try to use libraries if an incompatible ABI
9change occurs.
10
11Upstream-Status: Denied [https://github.com/KhronosGroup/VK-GL-CTS/pull/288]
12Signed-off-by: Trevor Woerner <twoerner@gmail.com>
13---
14 framework/egl/egluGLContextFactory.cpp | 4 ++--
15 framework/egl/wrapper/eglwLibrary.cpp | 2 +-
16 framework/platform/android/tcuAndroidPlatform.cpp | 2 +-
17 framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp | 2 +-
18 .../platform/lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp | 2 +-
19 framework/platform/surfaceless/tcuSurfacelessPlatform.cpp | 6 +++---
20 6 files changed, 9 insertions(+), 9 deletions(-)
21
22--- a/framework/egl/egluGLContextFactory.cpp
23+++ b/framework/egl/egluGLContextFactory.cpp
24@@ -63,7 +63,7 @@ using std::vector;
25 #if (DE_OS == DE_OS_WIN32)
26 #define DEQP_GLES2_LIBRARY_PATH "libGLESv2.dll"
27 #else
28-#define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so"
29+#define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so.2"
30 #endif
31 #endif
32
33@@ -75,7 +75,7 @@ using std::vector;
34 #if (DE_OS == DE_OS_WIN32)
35 #define DEQP_OPENGL_LIBRARY_PATH "opengl32.dll"
36 #else
37-#define DEQP_OPENGL_LIBRARY_PATH "libGL.so"
38+#define DEQP_OPENGL_LIBRARY_PATH "libGL.so.1"
39 #endif
40 #endif
41
42--- a/framework/egl/wrapper/eglwLibrary.cpp
43+++ b/framework/egl/wrapper/eglwLibrary.cpp
44@@ -145,7 +145,7 @@ DefaultLibrary::~DefaultLibrary(void)
45 const char *DefaultLibrary::getLibraryFileName(void)
46 {
47 #if (DE_OS == DE_OS_ANDROID) || (DE_OS == DE_OS_UNIX)
48- return "libEGL.so";
49+ return "libEGL.so.1";
50 #elif (DE_OS == DE_OS_WIN32)
51 return "libEGL.dll";
52 #else
53--- a/framework/platform/android/tcuAndroidPlatform.cpp
54+++ b/framework/platform/android/tcuAndroidPlatform.cpp
55@@ -56,7 +56,7 @@ static const eglu::NativeWindow::Capabil
56 class NativeDisplay : public eglu::NativeDisplay
57 {
58 public:
59- NativeDisplay(void) : eglu::NativeDisplay(DISPLAY_CAPABILITIES), m_library("libEGL.so")
60+ NativeDisplay(void) : eglu::NativeDisplay(DISPLAY_CAPABILITIES), m_library("libEGL.so.1")
61 {
62 }
63 virtual ~NativeDisplay(void)
64@@ -223,7 +223,7 @@ class VulkanLibrary : public vk::Library
65 {
66 public:
67 VulkanLibrary(const char *libraryPath)
68- : m_library(libraryPath != nullptr ? libraryPath : "libvulkan.so")
69+ : m_library(libraryPath != nullptr ? libraryPath : "libvulkan.so.1")
70 , m_driver(m_library)
71 {
72 }
73--- a/framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp
74+++ b/framework/platform/lnx/X11/tcuLnxX11EglDisplayFactory.cpp
75@@ -77,7 +77,7 @@ using tcu::TextureLevel;
76 class Library : public eglw::DefaultLibrary
77 {
78 public:
79- Library(void) : eglw::DefaultLibrary("libEGL.so")
80+ Library(void) : eglw::DefaultLibrary("libEGL.so.1")
81 {
82 }
83
84--- a/framework/platform/lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp
85+++ b/framework/platform/lnx/wayland/tcuLnxWaylandEglDisplayFactory.cpp
86@@ -64,7 +64,7 @@ public:
87 Display(MovePtr<wayland::Display> waylandDisplay)
88 : NativeDisplay(CAPABILITIES, EGL_PLATFORM_WAYLAND_KHR, "EGL_KHR_platform_wayland")
89 , m_display(waylandDisplay)
90- , m_library("libEGL.so")
91+ , m_library("libEGL.so.1")
92 {
93 }
94
95--- a/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
96+++ b/framework/platform/surfaceless/tcuSurfacelessPlatform.cpp
97@@ -69,7 +69,7 @@ using std::vector;
98
99 // Default library names
100 #if !defined(DEQP_GLES2_LIBRARY_PATH)
101-#define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so"
102+#define DEQP_GLES2_LIBRARY_PATH "libGLESv2.so.2"
103 #endif
104
105 #if !defined(DEQP_GLES3_LIBRARY_PATH)
106@@ -77,7 +77,7 @@ using std::vector;
107 #endif
108
109 #if !defined(DEQP_OPENGL_LIBRARY_PATH)
110-#define DEQP_OPENGL_LIBRARY_PATH "libGL.so"
111+#define DEQP_OPENGL_LIBRARY_PATH "libGL.so.1"
112 #endif
113
114 #if !defined(DEQP_VULKAN_LIBRARY_PATH)
115@@ -258,7 +258,7 @@ glu::RenderContext *ContextFactory::crea
116
117 EglRenderContext::EglRenderContext(const glu::RenderConfig &config, const tcu::CommandLine &cmdLine,
118 const glu::RenderContext *sharedContext)
119- : m_egl("libEGL.so")
120+ : m_egl("libEGL.so.1")
121 , m_contextType(config.type)
122 , m_eglDisplay(EGL_NO_DISPLAY)
123 , m_eglContext(EGL_NO_CONTEXT)
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkan-cts-include-missing-cstdint.patch b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkan-cts-include-missing-cstdint.patch
deleted file mode 100644
index 0dd59713a1..0000000000
--- a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkan-cts-include-missing-cstdint.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From b07f6ecd6ab83b788301a555dc546b9a5c9dd8a2 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 25 Jan 2023 19:19:34 -0800
4Subject: [PATCH] Include missing <cstdint>
5
6This error is seen with gcc-13 where include headers are not implicitly
7included [1]
8
9Fixes errors e.g.
10error: 'uint32_t' does not name a type
11
12[1] https://www.gnu.org/software/gcc/gcc-13/porting_to.html
13
14Upstream-Status: Submitted [https://github.com/KhronosGroup/VK-GL-CTS/pull/378]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 framework/common/tcuDefs.hpp | 1 +
18 1 file changed, 1 insertion(+)
19
20diff --git a/framework/common/tcuDefs.hpp b/framework/common/tcuDefs.hpp
21index ad3d0736d..6dfac10fb 100644
22--- a/framework/common/tcuDefs.hpp
23+++ b/framework/common/tcuDefs.hpp
24@@ -26,6 +26,7 @@
25 #include "deDefs.hpp"
26 #include "qpTestLog.h"
27
28+#include <cstdint>
29 #include <string>
30 #include <stdexcept>
31
32--
332.39.1
34
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkancts-Include-missing-cstdint.patch b/meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkancts-Include-missing-cstdint.patch
deleted file mode 100644
index 40aea8f203..0000000000
--- a/meta-oe/recipes-graphics/vk-gl-cts/files/0001-vulkancts-Include-missing-cstdint.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1From 1b7646ced0f0b969f818084887885827ed1a4244 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 31 May 2021 17:31:33 -0700
4Subject: [PATCH] vulkancts: Include missing <cstdint>
5
6Fixes build with gcc-13
7
8../git/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp:2798:102: error: 'uintptr_t' in namespace 'std' does not name a type
9 2798 | BufferDataType type = static_cast<BufferDataType>(reinterpret_cast<std::uintptr_t>(expectedOutputs[resultIndex].getUserData()));
10 | ^~~~~~~~~
11
12Upstream-Status: Submitted [https://github.com/KhronosGroup/VK-GL-CTS/pull/378]
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 .../vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp | 1 +
16 1 file changed, 1 insertion(+)
17
18diff --git a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp
19index ab02be1dc..3d3ee4829 100644
20--- a/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp
21+++ b/external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmFloatControlsTests.cpp
22@@ -33,6 +33,7 @@
23 #include "deFloat16.h"
24 #include "vkQueryUtil.hpp"
25 #include "vkRefUtil.hpp"
26+#include <cstdint>
27 #include <cstring>
28 #include <vector>
29 #include <limits>
30--
312.39.1
32
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/fix-clang-private-operator.patch b/meta-oe/recipes-graphics/vk-gl-cts/files/fix-clang-private-operator.patch
index 4ecc371ca4..af59dd3e61 100644
--- a/meta-oe/recipes-graphics/vk-gl-cts/files/fix-clang-private-operator.patch
+++ b/meta-oe/recipes-graphics/vk-gl-cts/files/fix-clang-private-operator.patch
@@ -2,7 +2,7 @@ Upstream-Status: Pending
2 2
3--- a/external/glslang/src/glslang/Include/PoolAlloc.h 3--- a/external/glslang/src/glslang/Include/PoolAlloc.h
4+++ b/external/glslang/src/glslang/Include/PoolAlloc.h 4+++ b/external/glslang/src/glslang/Include/PoolAlloc.h
5@@ -240,8 +240,9 @@ protected: 5@@ -245,8 +245,9 @@ protected:
6 6
7 int numCalls; // just an interesting statistic 7 int numCalls; // just an interesting statistic
8 size_t totalBytes; // just an interesting statistic 8 size_t totalBytes; // just an interesting statistic
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/fix-musl.patch b/meta-oe/recipes-graphics/vk-gl-cts/files/fix-musl.patch
index 58dc1f24dd..717d489786 100644
--- a/meta-oe/recipes-graphics/vk-gl-cts/files/fix-musl.patch
+++ b/meta-oe/recipes-graphics/vk-gl-cts/files/fix-musl.patch
@@ -2,9 +2,9 @@ Upstream-Status: Pending
2 2
3--- a/framework/delibs/dethread/CMakeLists.txt 3--- a/framework/delibs/dethread/CMakeLists.txt
4+++ b/framework/delibs/dethread/CMakeLists.txt 4+++ b/framework/delibs/dethread/CMakeLists.txt
5@@ -42,6 +42,7 @@ if (DE_OS_IS_UNIX) 5@@ -41,6 +41,7 @@ if (DE_OS_IS_UNIX)
6 if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
6 add_definitions(-D__BSD_VISIBLE) 7 add_definitions(-D__BSD_VISIBLE)
7 add_definitions(-D_XOPEN_SOURCE=600)
8 endif () 8 endif ()
9+ add_definitions(-D_XOPEN_SOURCE=600) 9+ add_definitions(-D_XOPEN_SOURCE=600)
10 add_definitions(-D_GNU_SOURCE) 10 add_definitions(-D_GNU_SOURCE)
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/gen-framework-path.patch b/meta-oe/recipes-graphics/vk-gl-cts/files/gen-framework-path.patch
deleted file mode 100644
index 8a8d8d2c32..0000000000
--- a/meta-oe/recipes-graphics/vk-gl-cts/files/gen-framework-path.patch
+++ /dev/null
@@ -1,20 +0,0 @@
1Prepend instead of append to the module search path, as this script needs to use
2the local module build, not the host module build.
3
4Upstream-Status: Submitted
5Signed-off-by: Ross Burton <ross.burton@arm.com>
6
7diff --git a/external/vulkancts/scripts/gen_framework.py b/external/vulkancts/scripts/gen_framework.py
8index 83c5329ce..10e720910 100755
9--- a/external/vulkancts/scripts/gen_framework.py
10+++ b/external/vulkancts/scripts/gen_framework.py
11@@ -33 +33 @@ from collections import OrderedDict
12-sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "scripts"))
13+sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", "scripts"))
14diff --git a/external/vulkancts/scripts/gen_framework_c.py b/external/vulkancts/scripts/gen_framework_c.py
15index 95587e642..84b878cb2 100644
16--- a/external/vulkancts/scripts/gen_framework_c.py
17+++ b/external/vulkancts/scripts/gen_framework_c.py
18@@ -28 +28 @@ import re
19-sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "..", "scripts"))
20+sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "..", "scripts"))
diff --git a/meta-oe/recipes-graphics/vk-gl-cts/files/generate-srcuri.py b/meta-oe/recipes-graphics/vk-gl-cts/files/generate-srcuri.py
new file mode 100755
index 0000000000..c2756b592c
--- /dev/null
+++ b/meta-oe/recipes-graphics/vk-gl-cts/files/generate-srcuri.py
@@ -0,0 +1,131 @@
1#! /usr/bin/env python3
2
3import json
4import re
5import os
6import subprocess
7import sys
8import types
9import urllib.parse
10
11
12def resolve_commit(repo, ref):
13 # If it looks like a SHA, just return that
14 if re.match(r"[a-z0-9]{40}", ref):
15 return ref
16
17 # Otherwise it's probably a tag name so resolve it
18 cmd = ("git", "ls-remote", "--tags", "--exit-code", repo, ref)
19 ret = subprocess.run(cmd, check=True, text=True, capture_output=True)
20 sha = ret.stdout.split(maxsplit=1)[0]
21 assert len(sha) == 40
22 return sha
23
24
25def transform_git(repo_url, repo_ref, destination):
26 parts = urllib.parse.urlparse(repo_url)
27 protocol = parts.scheme
28 parts = parts._replace(scheme="git")
29 url = urllib.parse.urlunparse(parts)
30 # Resolve the commit reference to a SHA
31 sha = resolve_commit(repo_url, repo_ref)
32
33 return url + f";protocol={protocol};nobranch=1;destsuffix={destination};rev={sha}"
34
35
36def load_module(filename):
37 import importlib.util
38
39 spec = importlib.util.spec_from_file_location("fetchmodule", filename)
40 module = importlib.util.module_from_spec(spec)
41 spec.loader.exec_module(module)
42 return module
43
44
45def convert_fetch(basedir):
46 """
47 Convert the external/fetch_sources.py data
48 """
49 fetch = load_module(os.path.join(basedir, "fetch_sources.py"))
50 lines = []
51 for p in fetch.PACKAGES:
52 if isinstance(p, fetch.SourcePackage):
53 # Ignore these as so far we can use the system copies
54 pass
55 elif isinstance(p, fetch.SourceFile):
56 dest = "/".join(["git/external", p.baseDir, p.extractDir])
57 url = f"{p.url};subdir={dest};sha256sum={p.checksum}"
58 lines.append(f" {url} \\")
59 elif isinstance(p, fetch.GitRepo):
60 dest = "/".join(["git/external", p.baseDir, p.extractDir])
61 url = transform_git(p.httpsUrl, p.revision, dest)
62 lines.append(f" {url} \\")
63 else:
64 assert f"Unexpected {p=}"
65 return lines
66
67
68def convert_knowngood(basedir, destination):
69 """
70 Convert the """
71 filename = os.path.join(basedir, "vulkan-validationlayers/src/scripts/known_good.json")
72 try:
73 with open(filename) as fp:
74 data = json.load(fp, object_hook=lambda x: types.SimpleNamespace(**x))
75 except FileNotFoundError:
76 return []
77
78 lines = []
79 for repo in data.repos:
80 # Skip repositories that are not needed on Linux (TODO: assumes linux target)
81 if hasattr(repo, "build_platforms") and repo.build_platforms != "linux":
82 continue
83
84 # Switch the URL to use git: and save the original protocol
85 parts = urllib.parse.urlparse(repo.url)
86 protocol = parts.scheme
87 parts = parts._replace(scheme="git")
88 url = urllib.parse.urlunparse(parts)
89 # Resolve the commit reference to a SHA
90 sha = resolve_commit(repo.url, repo.commit)
91
92 destsuffix = destination + "/" + repo.sub_dir
93
94 url += f";protocol={protocol};nobranch=1;destsuffix={destsuffix};rev={sha}"
95 lines.append(f" {url} \\")
96 return lines
97
98
99def main():
100 pv = sys.argv[1]
101 basedir = sys.argv[2]
102
103 print("""
104#
105# Generated by generate-srcuri.py, don't update manually")
106#
107
108RECIPE_UPGRADE_EXTRA_TASKS += "do_refresh_srcuri"
109
110python __anonymous() {
111 if d.getVar("PV") != "%s":
112 bb.warn("-sources.inc out of date, run refresh_srcuri task")
113}
114""" % (pv))
115
116 print('SRC_URI += " \\')
117 lines = convert_fetch(basedir)
118 print("\n".join(lines))
119 print('"')
120
121 #lines = convert_knowngood(sys.argv[1], "git/external/validation")
122 #if lines:
123 # print('SRC_URI += " \\')
124 # print("\n".join(lines))
125 # print('"')
126 #else:
127 # print("# Re-run")
128
129
130if __name__ == "__main__":
131 main()