dev-util/vulkan-tools: Make USE cube USE requirements explicit
authorAndreas Sturmlechner <asturm@gentoo.org>
Wed, 11 Mar 2020 19:46:54 +0000 (20:46 +0100)
committerMatt Turner <mattst88@gentoo.org>
Sun, 15 Mar 2020 21:28:39 +0000 (14:28 -0700)
Do not enable cube by default (mitigating strict REQUIRED_USE constraint)
Fix QA issue (unused cmake variables with USE=-cube)

Package-Manager: Portage-2.3.93, Repoman-2.3.20
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Signed-off-by: Matt Turner <mattst88@gentoo.org>
dev-util/vulkan-tools/vulkan-tools-9999.ebuild

index e4065eb7f9cb46bf23f1be9a373c17bb50e171f1..1d6d8e74d61e022f03dc0b4b45d979784fa73459 100644 (file)
@@ -23,9 +23,10 @@ HOMEPAGE="https://github.com/KhronosGroup/Vulkan-Tools"
 
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE="+cube wayland +X"
+IUSE="cube wayland +X"
 
-REQUIRED_USE="|| ( X wayland )"
+# Cube demo only supports one window system at a time
+REQUIRED_USE="!cube? ( || ( X wayland ) ) cube? ( ^^ ( X wayland ) )"
 
 BDEPEND="${PYTHON_DEPS}
        >=dev-util/cmake-3.10.2
@@ -48,12 +49,10 @@ pkg_setup() {
                /usr/bin/vulkaninfo
        )
 
-       if use cube; then
-               MULTILIB_CHOST_TOOLS+=(
-                       /usr/bin/vkcube
-                       /usr/bin/vkcubepp
-               )
-       fi
+       use cube && MULTILIB_CHOST_TOOLS+=(
+               /usr/bin/vkcube
+               /usr/bin/vkcubepp
+       )
 
        python-any-r1_pkg_setup
 }
@@ -66,26 +65,13 @@ multilib_src_configure() {
                -DBUILD_WSI_WAYLAND_SUPPORT=$(usex wayland)
                -DBUILD_WSI_XCB_SUPPORT=$(usex X)
                -DBUILD_WSI_XLIB_SUPPORT=$(usex X)
-               -DGLSLANG_INSTALL_DIR="${EPREFIX}/usr"
                -DVULKAN_HEADERS_INSTALL_DIR="${EPREFIX}/usr"
        )
 
-       # Upstream only supports one window system at a time
-       # If X is set at all, even if wayland is set, use X
-       #
-       # If -cube is set, the flags we set are ignored,
-       # so we don't need to consider that
-       if use X; then
-               mycmakeargs+=(
-                       -DCUBE_WSI_SELECTION="XCB"
-               )
-       fi
-
-       if ! use X && use wayland; then
-               mycmakeargs+=(
-                       -DCUBE_WSI_SELECTION="WAYLAND"
-               )
-       fi
+       use cube && mycmakeargs+=(
+               -DGLSLANG_INSTALL_DIR="${EPREFIX}/usr"
+               -DCUBE_WSI_SELECTION=$(usex X XCB WAYLAND)
+       )
 
        cmake_src_configure
 }