diff --git a/media-libs/vulkan-layers/Manifest b/media-libs/vulkan-layers/Manifest index ebc9df448199b..1c33d034ff28c 100644 --- a/media-libs/vulkan-layers/Manifest +++ b/media-libs/vulkan-layers/Manifest @@ -1 +1,2 @@ DIST vulkan-layers-1.3.224.tar.gz 4193501 BLAKE2B 84982d63339a2ef101cf9e1e9038e94415326a4a8a46b47d0a913bd0d35fa333dd35579f96536c6e147bf37ccdee0a8de12c1c13b74d3529f34645f8e10f0fa2 SHA512 c7d4f6df4bf0cbb970b36cff9197306769bf3f86ea98496b93e8c1779a905966f6b2303b04ba84099ce9c12e828633e2e0db22e49060393335312508b3540488 +DIST vulkan-layers-1.3.231.tar.gz 4408601 BLAKE2B 9b777559a540c34c5f86a93b15c42a223b8b7fd517f06e28d7bd0ba0fdc938063fd86126f7cdb43e692f3cc22296b5f8df924c2f39e3ead38325b2e1442bf3a6 SHA512 550ff2f5d718ab1a272977f3beb89f653107a7a2b89209408233cb3b969206d1d9383e0e8933343bc71fc920dd80e0cf62ad3baa588b671f24ce04cb93d4b606 diff --git a/media-libs/vulkan-layers/files/vulkan-layers-1.3.231-cmake-Cleanup-find_package-SPIRV-code.patch b/media-libs/vulkan-layers/files/vulkan-layers-1.3.231-cmake-Cleanup-find_package-SPIRV-code.patch new file mode 100644 index 0000000000000..bd17c69315e04 --- /dev/null +++ b/media-libs/vulkan-layers/files/vulkan-layers-1.3.231-cmake-Cleanup-find_package-SPIRV-code.patch @@ -0,0 +1,101 @@ +From 836a09267fe034ce783570e6920e1b638c0bd212 Mon Sep 17 00:00:00 2001 +From: Juan Ramos +Date: Fri, 21 Oct 2022 17:43:23 -0600 +Subject: [PATCH] cmake: Cleanup find_package SPIRV code + +- Use get_target_property instead of relying on passed in var +- Remove unused var +- Cleanup find_package(SPIRV-* code +--- + CMakeLists.txt | 55 +++++++++---------------------- + cmake/VVLGenerateSourceCode.cmake | 5 ++- + 2 files changed, 19 insertions(+), 41 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a7f01081415..23de46a1a22 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -204,52 +204,27 @@ if (USE_ROBIN_HOOD_HASHING) + endif() + + if(BUILD_LAYERS OR BUILD_TESTS) +- find_package(SPIRV-Headers CONFIG QUIET) +- if(SPIRV-Headers_FOUND) +- # Prefer the package if found. Note that if SPIRV_HEADERS_INSTALL_DIR points at an 'installed' +- # version of SPIRV-Headers, the package will be found. +- get_target_property(SPIRV_HEADERS_INCLUDE_DIR SPIRV-Headers::SPIRV-Headers INTERFACE_INCLUDE_DIRECTORIES) +- elseif(SPIRV_HEADERS_INCLUDE_DIR) +- # This is set by SPIRV-Tools (in parent scope!) and also some packages that include VVL with add_subdirectory +- if (NOT EXISTS "${SPIRV_HEADERS_INCLUDE_DIR}/spirv/unified1/spirv.h") +- message(FATAL_ERROR "Cannot find SPIRV-Headers from SPIRV_HEADERS_INCLUDE_DIR: ${SPIRV_HEADERS_INCLUDE_DIR}") +- endif() +- elseif(SPIRV_HEADERS_INSTALL_DIR) +- # This is our official variable for setting SPIRV-Headers location, but pointing at the raw source of SPIRV-Headers +- if (NOT EXISTS "${SPIRV_HEADERS_INSTALL_DIR}/include/spirv/unified1/spirv.h") +- message(FATAL_ERROR "Cannot find SPIRV-Headers from SPIRV_HEADERS_INSTALL_DIR: ${SPIRV_HEADERS_INSTALL_DIR}") +- endif() +- set(SPIRV_HEADERS_INCLUDE_DIR "${SPIRV_HEADERS_INSTALL_DIR}/include") +- endif() ++ find_package(SPIRV-Headers REQUIRED CONFIG QUIET) + +- # VVLGenerateSourceCode depends on spirv/unified1 + include(VVLGenerateSourceCode) + +- if (NOT TARGET SPIRV-Tools-opt) +- find_package(SPIRV-Tools-opt REQUIRED CONFIG) +- endif() +- +- if (NOT TARGET SPIRV-Tools) +- find_package(SPIRV-Tools REQUIRED CONFIG) +- # See https://github.com/KhronosGroup/SPIRV-Tools/issues/3909 for background on this. +- # The targets available from SPIRV-Tools change depending on how SPIRV_TOOLS_BUILD_STATIC is set. +- # Try to handle all possible combinations so that we work with externally built packages. +- if (TARGET SPIRV-Tools) +- set(SPIRV_TOOLS_TARGET "SPIRV-Tools") +- elseif(TARGET SPIRV-Tools-static) +- set(SPIRV_TOOLS_TARGET "SPIRV-Tools-static") +- elseif(TARGET SPIRV-Tools-shared) +- set(SPIRV_TOOLS_TARGET "SPIRV-Tools-shared") +- else() +- message(FATAL_ERROR "Cannot determine SPIRV-Tools target name") +- endif() ++ find_package(SPIRV-Tools-opt REQUIRED CONFIG QUIET) ++ ++ find_package(SPIRV-Tools REQUIRED CONFIG QUIET) ++ # See https://github.com/KhronosGroup/SPIRV-Tools/issues/3909 for background on this. ++ # The targets available from SPIRV-Tools change depending on how SPIRV_TOOLS_BUILD_STATIC is set. ++ # Try to handle all possible combinations so that we work with externally built packages. ++ if (TARGET SPIRV-Tools) ++ set(SPIRV_TOOLS_TARGET "SPIRV-Tools") ++ elseif(TARGET SPIRV-Tools-static) ++ set(SPIRV_TOOLS_TARGET "SPIRV-Tools-static") ++ elseif(TARGET SPIRV-Tools-shared) ++ set(SPIRV_TOOLS_TARGET "SPIRV-Tools-shared") ++ else() ++ message(FATAL_ERROR "Cannot determine SPIRV-Tools target name") + endif() + endif() + +-# Generate dependent helper files ------------------------------------------------------------------------------------------------ +- +-set(SCRIPTS_DIR "${PROJECT_SOURCE_DIR}/scripts") +- + # VkLayer_utils library ---------------------------------------------------------------------------------------------------------- + # For Windows, we use a static lib because the Windows loader has a fairly restrictive loader search path that can't be easily + # modified to point it to the same directory that contains the layers. TODO: This should not be a library -- in future, include +diff --git a/cmake/VVLGenerateSourceCode.cmake b/cmake/VVLGenerateSourceCode.cmake +index 43efdb8201c..13c81e38aca 100644 +--- a/cmake/VVLGenerateSourceCode.cmake ++++ b/cmake/VVLGenerateSourceCode.cmake +@@ -20,7 +20,10 @@ if(PYTHONINTERP_FOUND) + message(FATAL_ERROR "Unable to find vk.xml") + endif() + +- set(spirv_unified_include_dir "${SPIRV_HEADERS_INSTALL_DIR}/include/spirv/unified1/") ++ # Get the include directory of the SPIRV-Headers ++ get_target_property(SPIRV_HEADERS_INCLUDE_DIR SPIRV-Headers::SPIRV-Headers INTERFACE_INCLUDE_DIRECTORIES) ++ ++ set(spirv_unified_include_dir "${SPIRV_HEADERS_INCLUDE_DIR}/spirv/unified1/") + if (NOT IS_DIRECTORY ${spirv_unified_include_dir}) + message(FATAL_ERROR "Unable to find spirv/unified1") + endif() diff --git a/media-libs/vulkan-layers/vulkan-layers-1.3.231.ebuild b/media-libs/vulkan-layers/vulkan-layers-1.3.231.ebuild new file mode 100644 index 0000000000000..472f1a4f3a2f4 --- /dev/null +++ b/media-libs/vulkan-layers/vulkan-layers-1.3.231.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +MY_PN=Vulkan-ValidationLayers +PYTHON_COMPAT=( python3_{8..11} ) +inherit cmake-multilib python-any-r1 + +if [[ ${PV} == *9999* ]]; then + EGIT_REPO_URI="https://github.com/KhronosGroup/${MY_PN}.git" + EGIT_SUBMODULES=() + inherit git-r3 +else + SRC_URI="https://github.com/KhronosGroup/${MY_PN}/archive/sdk-${PV}.0.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86" + S="${WORKDIR}"/${MY_PN}-sdk-${PV}.0 +fi + +DESCRIPTION="Vulkan Validation Layers" +HOMEPAGE="https://github.com/KhronosGroup/Vulkan-ValidationLayers" + +LICENSE="Apache-2.0" +SLOT="0" +IUSE="wayland X" + +PATCHES=( "${FILESDIR}/${P}-cmake-Cleanup-find_package-SPIRV-code.patch" ) + +BDEPEND=">=dev-util/cmake-3.10.2" +RDEPEND="~dev-util/spirv-tools-${PV}:=[${MULTILIB_USEDEP}]" +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + >=dev-cpp/robin-hood-hashing-3.11.5 + ~dev-util/glslang-${PV}:=[${MULTILIB_USEDEP}] + ~dev-util/vulkan-headers-${PV} + wayland? ( dev-libs/wayland:=[${MULTILIB_USEDEP}] ) + X? ( + x11-libs/libX11:=[${MULTILIB_USEDEP}] + x11-libs/libXrandr:=[${MULTILIB_USEDEP}] + ) +" + +multilib_src_configure() { + local mycmakeargs=( + -DCMAKE_C_FLAGS="${CFLAGS} -DNDEBUG" + -DCMAKE_CXX_FLAGS="${CXXFLAGS} -DNDEBUG" + -DCMAKE_SKIP_RPATH=ON + -DBUILD_LAYER_SUPPORT_FILES=ON + -DBUILD_WSI_WAYLAND_SUPPORT=$(usex wayland) + -DBUILD_WSI_XCB_SUPPORT=$(usex X) + -DBUILD_WSI_XLIB_SUPPORT=$(usex X) + -DBUILD_TESTS=OFF + -DVulkanRegistry_DIR="${ESYSROOT}/usr/share/vulkan/registry" + ) + cmake_src_configure +} diff --git a/media-libs/vulkan-layers/vulkan-layers-9999.ebuild b/media-libs/vulkan-layers/vulkan-layers-9999.ebuild index c71475bdd6613..af73de9264b58 100644 --- a/media-libs/vulkan-layers/vulkan-layers-9999.ebuild +++ b/media-libs/vulkan-layers/vulkan-layers-9999.ebuild @@ -48,8 +48,7 @@ multilib_src_configure() { -DBUILD_WSI_XCB_SUPPORT=$(usex X) -DBUILD_WSI_XLIB_SUPPORT=$(usex X) -DBUILD_TESTS=OFF - -DCMAKE_INSTALL_INCLUDEDIR="${EPREFIX}/usr/include/" - -DSPIRV_HEADERS_INSTALL_DIR="${ESYSROOT}/usr/include/spirv" + -DVulkanRegistry_DIR="${ESYSROOT}/usr/share/vulkan/registry" ) cmake_src_configure }