From a3e24163aa63c70a586d599806fd4a107f8ac646 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sat, 6 Jul 2024 06:26:46 -0600 Subject: [PATCH] Meta: Add overlay port for vulkan-loader In order to pass the proper pkg-config on aarch64 linux, we need to patch this port to use vcpkg's own find_tool infrastructure. --- .../vulkan-loader/portfile.cmake | 29 +++++++++++++++++++ .../vcpkg/overlay-ports/vulkan-loader/usage | 2 ++ .../overlay-ports/vulkan-loader/vcpkg.json | 19 ++++++++++++ vcpkg-configuration.json | 3 +- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 Meta/CMake/vcpkg/overlay-ports/vulkan-loader/portfile.cmake create mode 100644 Meta/CMake/vcpkg/overlay-ports/vulkan-loader/usage create mode 100644 Meta/CMake/vcpkg/overlay-ports/vulkan-loader/vcpkg.json diff --git a/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/portfile.cmake b/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/portfile.cmake new file mode 100644 index 00000000000..128973eb606 --- /dev/null +++ b/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/portfile.cmake @@ -0,0 +1,29 @@ +set(VCPKG_LIBRARY_LINKAGE dynamic) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KhronosGroup/Vulkan-Loader + REF "vulkan-sdk-${VERSION}" + SHA512 8ec98e0da867f829e048e100a97d7b94a3c40f56f858e3eb81f11f6f58e20e59da6ca8785a9642958ff3b698c618b9968407028cc66dfa0ad296576bf9db45ca + HEAD_REF main +) + +vcpkg_find_acquire_program(PKGCONFIG) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_TESTS:BOOL=OFF + -DPKG_CONFIG_EXECUTABLE="${PKGCONFIG}" + #-DBUILD_WSI_XCB_SUPPORT=OFF + #-DBUILD_WSI_XLIB_SUPPORT=OFF +) +vcpkg_cmake_install() +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/VulkanLoader" PACKAGE_NAME VulkanLoader) + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") + +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) + +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY) diff --git a/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/usage b/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/usage new file mode 100644 index 00000000000..e6f32865fd0 --- /dev/null +++ b/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/usage @@ -0,0 +1,2 @@ +The package @PORT@ provides the vulkan loader. +Please be aware of https://github.com/KhronosGroup/Vulkan-Loader/blob/main/docs/LoaderApplicationInterface.md#bundling-the-loader-with-an-application diff --git a/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/vcpkg.json b/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/vcpkg.json new file mode 100644 index 00000000000..711e349ad58 --- /dev/null +++ b/Meta/CMake/vcpkg/overlay-ports/vulkan-loader/vcpkg.json @@ -0,0 +1,19 @@ +{ + "name": "vulkan-loader", + "version": "1.3.280.0", + "description": "Vulkan Development Tools", + "homepage": "https://github.com/KhronosGroup/Vulkan-Loader", + "license": null, + "supports": "!android", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, + "vulkan-headers" + ] +} diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 5274e2d59e6..5a3e2e91908 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -5,5 +5,6 @@ "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", "name": "microsoft" } - ] + ], + "overlay-ports": [ "Meta/CMake/vcpkg/overlay-ports" ] }