1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python3_{5,6} )
7 if [[ "${PV}" == "9999" ]]; then
8 EGIT_REPO_URI="https://github.com/KhronosGroup/Vulkan-Tools.git"
12 EGIT_COMMIT="9bbdd552f0fd62741aa1f1e02ab3eafc45cf3c1e"
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"
27 DEPEND="${PYTHON_DEPS}
28 cube? ( dev-util/glslang:=[${MULTILIB_USEDEP}] )
29 dev-util/vulkan-headers
30 media-libs/vulkan-loader:=[${MULTILIB_USEDEP},wayland?,X?]
31 wayland? ( dev-libs/wayland:=[${MULTILIB_USEDEP}] )
33 x11-libs/libX11:=[${MULTILIB_USEDEP}]
34 x11-libs/libXrandr:=[${MULTILIB_USEDEP}]
37 # Vulkaninfo does not support wayland
38 REQUIRED_USE="|| ( X wayland )
42 MULTILIB_CHOST_TOOLS=()
44 if use vulkaninfo; then
45 MULTILIB_CHOST_TOOLS+=( /usr/bin/vulkaninfo )
49 MULTILIB_CHOST_TOOLS+=(
55 python-any-r1_pkg_setup
58 multilib_src_configure() {
60 -DCMAKE_SKIP_RPATH=True
61 -DBUILD_CUBE=$(usex cube)
62 -DBUILD_VULKANINFO=$(usex vulkaninfo)
63 -DBUILD_WSI_WAYLAND_SUPPORT=$(usex wayland)
64 -DBUILD_WSI_XCB_SUPPORT=$(usex X)
65 -DBUILD_WSI_XLIB_SUPPORT=$(usex X)
66 -DGLSLANG_INSTALL_DIR="/usr"
67 -DVULKAN_HEADERS_INSTALL_DIR="/usr"
70 # Upstream only supports one window system at a time
71 # If X is set at all, even if wayland is set, use X
73 # If -cube and/or -vulkaninfo is set, the flags we set
74 # are ignored, so we don't need to consider that
77 -DCUBE_WSI_SELECTION="XCB"
81 if ! use X && use wayland; then
83 -DCUBE_WSI_SELECTION="WAYLAND"
87 cmake-utils_src_configure
90 multilib_src_install() {
91 cmake-utils_src_install