1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_6 )
7 if [[ "${PV}" == "9999" ]]; then
8 EGIT_REPO_URI="https://github.com/KhronosGroup/Vulkan-Tools.git"
12 EGIT_COMMIT="2abb69904b9ad017d39d3da1e7fc3dec1a584cd8"
14 SRC_URI="https://github.com/KhronosGroup/Vulkan-Tools/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
15 S="${WORKDIR}/Vulkan-Tools-${EGIT_COMMIT}"
18 inherit python-any-r1 cmake-multilib
20 DESCRIPTION="Official Vulkan Tools and Utilities for Windows, Linux, Android, and MacOS"
21 HOMEPAGE="https://github.com/KhronosGroup/Vulkan-Tools"
25 IUSE="+cube +vulkaninfo +X wayland"
26 COMMON_DEPEND="media-libs/vulkan-loader:=[${MULTILIB_USEDEP},wayland?,X?]
27 wayland? ( dev-libs/wayland:=[${MULTILIB_USEDEP}] )
29 x11-libs/libX11:=[${MULTILIB_USEDEP}]
30 x11-libs/libXrandr:=[${MULTILIB_USEDEP}]
33 BDEPEND="${PYTHON_DEPS}
34 cube? ( dev-util/glslang:=[${MULTILIB_USEDEP}] )"
35 DEPEND="<dev-util/vulkan-headers-1.1.125
37 RDEPEND="${COMMON_DEPEND}"
39 # Vulkaninfo does not support wayland
40 REQUIRED_USE="|| ( X wayland )
44 MULTILIB_CHOST_TOOLS=()
46 if use vulkaninfo; then
47 MULTILIB_CHOST_TOOLS+=( /usr/bin/vulkaninfo )
51 MULTILIB_CHOST_TOOLS+=(
57 python-any-r1_pkg_setup
60 multilib_src_configure() {
62 -DCMAKE_SKIP_RPATH=True
63 -DBUILD_CUBE=$(usex cube)
64 -DBUILD_VULKANINFO=$(usex vulkaninfo)
65 -DBUILD_WSI_WAYLAND_SUPPORT=$(usex wayland)
66 -DBUILD_WSI_XCB_SUPPORT=$(usex X)
67 -DBUILD_WSI_XLIB_SUPPORT=$(usex X)
68 -DGLSLANG_INSTALL_DIR="/usr"
69 -DVULKAN_HEADERS_INSTALL_DIR="/usr"
72 # Upstream only supports one window system at a time
73 # If X is set at all, even if wayland is set, use X
75 # If -cube and/or -vulkaninfo is set, the flags we set
76 # are ignored, so we don't need to consider that
79 -DCUBE_WSI_SELECTION="XCB"
83 if ! use X && use wayland; then
85 -DCUBE_WSI_SELECTION="WAYLAND"
89 cmake-utils_src_configure
92 multilib_src_install() {
93 cmake-utils_src_install