Skip to content

Commit

Permalink
[vulkan] install required sdk parts (microsoft#35479)
Browse files Browse the repository at this point in the history
* Install vulkan.

* add gfxreconstruct

* format manifest and cr changes

* remove moltenvk

* fix ci part 1

* fix a dep

* more fixes

* remove vulkan failures from CI pipeline

* remove annoying stuff to deal with in static builds

* fix trailing ,

* remove vendored cmakelists

* force ci to be green

* format manifest

* Fix more ci issues

* fix hikogui

* make ci happier

* add jsoncpp dep

* only remove the debug folder if targeting windows

* bump port-version

* v db

* vulkan-loader add usage

* Rename vulkantools to lunarg-vulkantools

* Make VMA install headers platform dependent

* Remove vcpkg_check_linkage

* readd vulkan-validationlayers

* v db
  • Loading branch information
Neumann-A authored Dec 15, 2023
1 parent 209485d commit 50bffcc
Show file tree
Hide file tree
Showing 47 changed files with 462 additions and 98 deletions.
2 changes: 2 additions & 0 deletions ports/hikogui/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ vcpkg_from_github(
HEAD_REF main
)

set(ENV{VULKAN_SDK} "${CURRENT_INSTALLED_DIR}")

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
OPTIONS
Expand Down
7 changes: 7 additions & 0 deletions ports/hikogui/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
{
"name": "hikogui",
"version": "0.8.1",
"port-version": 1,
"maintainers": "@takev",
"description": "A portable, low latency, retained-mode GUI framework written in C++.",
"homepage": "https://github.com/hikogui/hikogui",
"license": "BSL-1.0",
"supports": "windows & x64",
"dependencies": [
{
"name": "glslang",
"features": [
"tools"
]
},
{
"name": "vcpkg-cmake",
"host": true
Expand Down
37 changes: 37 additions & 0 deletions ports/lunarg-vulkantools/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO LunarG/VulkanTools
REF "vulkan-sdk-${VERSION}"
SHA512 83be64eccb2841de4ae67f3936b6dd4433cdbd2b604329914a8bc43c1f7fc6dd2dba0eaf2f9527b231c6d54d3d390d79defc6de228baff5cba1add8c5ad6d9cd
HEAD_REF main
)

vcpkg_replace_string("${SOURCE_PATH}/via/CMakeLists.txt" "jsoncpp_static" "JsonCpp::JsonCpp")

x_vcpkg_get_python_packages(PYTHON_VERSION "3" PACKAGES jsonschema OUT_PYTHON_VAR PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DVULKAN_HEADERS_INSTALL_DIR=${CURRENT_INSTALLED_DIR}
-DBUILD_TESTS:BOOL=OFF
OPTIONS_RELEASE
-DVULKAN_LOADER_INSTALL_DIR=${CURRENT_INSTALLED_DIR}
OPTIONS_DEBUG
-DVULKAN_LOADER_INSTALL_DIR=${CURRENT_INSTALLED_DIR}/debug

)
vcpkg_cmake_install()

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")

vcpkg_copy_tools(TOOL_NAMES vkvia vkconfig AUTO_CLEAN )

if(VCPKG_TARGET_IS_WINDOWS)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
endif()

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

27 changes: 27 additions & 0 deletions ports/lunarg-vulkantools/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "lunarg-vulkantools",
"version": "1.3.268.0",
"description": "Vulkan header files and API registry",
"homepage": "https://github.com/KhronosGroup/Vulkan-Headers",
"license": null,
"supports": "!osx",
"dependencies": [
"jsoncpp",
"qt5-base",
"valijson",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
{
"name": "vcpkg-get-python-packages",
"host": true
},
"vulkan-loader",
"vulkan-utility-libraries"
]
}
9 changes: 5 additions & 4 deletions ports/spirv-cross/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/SPIRV-Cross
REF 2021-01-15
SHA512 f934ef61602223f6fe6d9c826ed5beb129beb7a30b18b389625d4fc0b1efa1b8df930a2a2d2a0b4f377ef2899e8e034239819a4c6629a78c666f72004464da93
REF vulkan-sdk-${VERSION}
SHA512 27cf3c1455c0edeba0a494ef7c8f23d3b22e3427ac7ce0681d3c15c8f1510cf449054a98793e6d3f3bbe7c6ef92f0203bb50b93f806e02676727a2cf38233547
HEAD_REF master
)

if(VCPKG_TARGET_IS_IOS)
message(STATUS "Using iOS trplet. Executables won't be created...")
message(STATUS "Using iOS triplet. Executables won't be created...")
set(BUILD_CLI OFF)
else()
set(BUILD_CLI ON)
Expand All @@ -25,6 +25,7 @@ vcpkg_cmake_configure(
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()

foreach(COMPONENT core c cpp glsl hlsl msl reflect util)
vcpkg_cmake_config_fixup(CONFIG_PATH share/spirv_cross_${COMPONENT}/cmake PACKAGE_NAME spirv_cross_${COMPONENT})
Expand All @@ -39,4 +40,4 @@ file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/share"
)

file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "copyright")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
3 changes: 1 addition & 2 deletions ports/spirv-cross/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "spirv-cross",
"version-date": "2021-01-15",
"port-version": 2,
"version": "1.3.268.0",
"description": "SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.",
"homepage": "https://github.com/KhronosGroup/SPIRV-Cross",
"dependencies": [
Expand Down
4 changes: 2 additions & 2 deletions ports/spirv-headers/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/SPIRV-Headers
REF "sdk-${VERSION}"
SHA512 436c6ce11d918091ce4a5ef2821f51af811c9a289e220b4a2b0bb4417b1f9f3b1f56a6366cfdf56848a9b1fb612ee3ba31d35c3d73d3d24de964ee05f96a7bbc
REF "vulkan-sdk-${VERSION}"
SHA512 3500c299a51dacc3e89066cfcfa8762cb6bc1be10ffff492fb3041831627e065cd836e3e0165df750dd22873a1772d916158e1e1c4701dc60efbb2edb17753ca
HEAD_REF master
)

Expand Down
2 changes: 1 addition & 1 deletion ports/spirv-headers/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spirv-headers",
"version": "1.3.246.1",
"version": "1.3.268.0",
"description": "Machine-readable files for the SPIR-V Registry",
"homepage": "https://github.com/KhronosGroup/SPIRV-Headers",
"dependencies": [
Expand Down
45 changes: 0 additions & 45 deletions ports/spirv-reflect/CMakeLists.txt

This file was deleted.

13 changes: 8 additions & 5 deletions ports/spirv-reflect/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/SPIRV-Reflect
REF sdk-1.3.236.0
SHA512 8ee0b88e46feac0ece478c6584e0ceb96b2ac976c2d1dc5813e0e26b20de8fa0264499cc9eea973bb3dd9a6877a421d00557f0fef7e323926df1db314373ea90
REF "vulkan-sdk-${VERSION}"
SHA512 fdc6d6fe707d21296c5c0a84388e8b9c687945264fb602e286e5ba399ac674e68bc89b25f4bb0a3fc4d59deb2dafe5fbe3e07b59162c420c25c9e923f3220849
HEAD_REF master
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS -DSPIRV_REFLECT_STATIC_LIB=ON
)

vcpkg_cmake_install()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/spirv-reflect" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)

vcpkg_copy_tools(TOOL_NAMES spirv-reflect-pp spirv-reflect AUTO_CLEAN)
2 changes: 1 addition & 1 deletion ports/spirv-reflect/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spirv-reflect",
"version": "1.3.236.0",
"version": "1.3.268.0",
"description": "SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications.",
"homepage": "https://github.com/KhronosGroup/SPIRV-Reflect",
"license": "Apache-2.0",
Expand Down
4 changes: 2 additions & 2 deletions ports/spirv-tools/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/SPIRV-Tools
REF "v${VERSION}"
SHA512 988f5e31508e3f19c1dd9d9a013c8e9ff89eba86207a769d7d804f9ee0201c794f412a874c860167b2c040b2c5e1fb1c835ae3684c70feaac86e47f90c1a5010
REF "vulkan-sdk-${VERSION}"
SHA512 317ce91ae229efddb98028840fbb6c9000c6a09aace2f04c2f59fdeb3a73b8fdb75048bf5a2189135a734a30b1ead57dc7dc5fcfd70a7267d17c743238a19899
PATCHES
cmake-config-dir.diff
spirv-tools-shared.diff
Expand Down
2 changes: 1 addition & 1 deletion ports/spirv-tools/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spirv-tools",
"version": "2023.2",
"version": "1.3.268.0",
"description": "API and commands for processing SPIR-V modules",
"homepage": "https://github.com/KhronosGroup/SPIRV-Tools",
"license": "Apache-2.0",
Expand Down
4 changes: 4 additions & 0 deletions ports/vsgxchange/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ vcpkg_copy_pdbs()
vcpkg_copy_tools(TOOL_NAMES vsgconv AUTO_CLEAN)
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/vsgconvd${VCPKG_TARGET_EXECUTABLE_SUFFIX}")

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
1 change: 1 addition & 0 deletions ports/vsgxchange/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "vsgxchange",
"version": "1.0.5",
"port-version": 1,
"description": "Utility library for converting 3rd party images, models and fonts formats to/from VulkanSceneGraph.",
"homepage": "https://github.com/vsg-dev/vsgXchange",
"license": "MIT",
Expand Down
5 changes: 3 additions & 2 deletions ports/vulkan-headers/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/Vulkan-Headers
REF "v${VERSION}"
SHA512 afd3a617fdd83d3e11559b4530e249dea4dbed66a44aba4fe1a39af2220ddcb8c45e49eaa087bbd62454709015b659eccfcdd6c3ad7950a2a7b1b674cf65e957
REF "vulkan-sdk-${VERSION}"
SHA512 adab4c97050aeb396445cd5352e4252b74d2a02856ffd369caa0df50ba544b8b8ab9e1630f30ce73c56751c987e2435263214547457b8ca9430c5ad2dadaabaf
HEAD_REF main
)

set(VCPKG_BUILD_TYPE release) # header-only port

vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_install()

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
2 changes: 1 addition & 1 deletion ports/vulkan-headers/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vulkan-headers",
"version": "1.3.260",
"version": "1.3.268.0",
"description": "Vulkan header files and API registry",
"homepage": "https://github.com/KhronosGroup/Vulkan-Headers",
"license": "Apache-2.0 OR MIT",
Expand Down
24 changes: 24 additions & 0 deletions ports/vulkan-loader/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
set(VCPKG_LIBRARY_LINKAGE dynamic)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/Vulkan-Loader
REF "vulkan-sdk-${VERSION}"
SHA512 15a326480e8d47f35a5e0c08ac915e047c90f2b99e8b6ac483bc1835e5b8bf2fd759b6fbf61dae9f89103e91067e60ff5f1817ce6aebecf95529bcc6d1326e66
HEAD_REF main
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTS:BOOL=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)
2 changes: 2 additions & 0 deletions ports/vulkan-loader/usage
Original file line number Diff line number Diff line change
@@ -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
19 changes: 19 additions & 0 deletions ports/vulkan-loader/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "vulkan-loader",
"version": "1.3.268.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"
]
}
11 changes: 10 additions & 1 deletion ports/vulkan-memory-allocator/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,17 @@ vcpkg_from_github(
HEAD_REF master
)

set(opts "")
if(VCPKG_TARGET_IS_WINDOWS)
set(opts "-DCMAKE_INSTALL_INCLUDEDIR=include/vma") # Vulkan SDK layout!
endif()

set(VCPKG_BUILD_TYPE release) # header-only port
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${opts}

)
vcpkg_cmake_install()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
2 changes: 1 addition & 1 deletion ports/vulkan-memory-allocator/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vulkan-memory-allocator",
"version": "3.0.1",
"port-version": 3,
"port-version": 4,
"description": "Easy to integrate Vulkan memory allocation library from GPUOpen",
"homepage": "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator",
"license": "MIT",
Expand Down
Loading

0 comments on commit 50bffcc

Please sign in to comment.