commit:     8bf0ace101e40ed165cb86bd0d1998da966a62bf
Author:     Nick Sarnie <commendsarnex <AT> gmail <DOT> com>
AuthorDate: Sat Nov 25 21:36:10 2017 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Mon Mar 12 17:41:02 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bf0ace1

media-libs/vulkan-loader: Add demos USE flag

USE=demos builds vulkaninfo and vulkan demos.

Bug: https://bugs.gentoo.org/619124
Closes: https://github.com/gentoo/gentoo/pull/6300
Signed-off-by: Nick Sarnie <commendsarnex <AT> gmail.com>

 .../vulkan-loader-9999-no-external-sources.patch   | 33 ++++++++++++++++++++++
 media-libs/vulkan-loader/metadata.xml              |  3 ++
 media-libs/vulkan-loader/vulkan-loader-9999.ebuild |  7 +++--
 3 files changed, 41 insertions(+), 2 deletions(-)

diff --git 
a/media-libs/vulkan-loader/files/vulkan-loader-9999-no-external-sources.patch 
b/media-libs/vulkan-loader/files/vulkan-loader-9999-no-external-sources.patch
new file mode 100644
index 00000000000..0100d1356c4
--- /dev/null
+++ 
b/media-libs/vulkan-loader/files/vulkan-loader-9999-no-external-sources.patch
@@ -0,0 +1,33 @@
+From 641052deaaa6a570a6c284d5407ac1bbd60d3d53 Mon Sep 17 00:00:00 2001
+From: Nick Sarnie <[email protected]>
+Date: Sun, 11 Mar 2018 11:18:25 -0400
+Subject: [PATCH] Do not require external sources to build
+
+Signed-off-by: Nick Sarnie <[email protected]>
+---
+ CMakeLists.txt | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 34e10dc3..5fb97b7c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -361,7 +361,6 @@ add_custom_target(generate_helper_files DEPENDS
+     vk_dispatch_table_helper.h
+     vk_extension_helper.h
+     vk_typemap_helper.h
+-    spirv_tools_commit_id.h
+     )
+ set_target_properties(generate_helper_files PROPERTIES FOLDER 
${LVL_TARGET_FOLDER})
+ 
+@@ -376,7 +375,6 @@ run_vk_xml_generate(helper_file_generator.py 
vk_enum_string_helper.h)
+ run_vk_xml_generate(helper_file_generator.py vk_object_types.h)
+ run_vk_xml_generate(helper_file_generator.py vk_extension_helper.h)
+ run_vk_xml_generate(helper_file_generator.py vk_typemap_helper.h)
+-run_external_revision_generate(${EXTERNAL_SOURCE_ROOT}/glslang/External/spirv-tools
 SPIRV_TOOLS_COMMIT_ID spirv_tools_commit_id.h)
+ 
+ 
+ 
+-- 
+2.16.2
+

diff --git a/media-libs/vulkan-loader/metadata.xml 
b/media-libs/vulkan-loader/metadata.xml
index 1c806f32b43..9e5a300d863 100644
--- a/media-libs/vulkan-loader/metadata.xml
+++ b/media-libs/vulkan-loader/metadata.xml
@@ -8,4 +8,7 @@
        <upstream>
                <remote-id 
type="github">KhronosGroup/Vulkan-LoaderAndValidationLayers</remote-id>
        </upstream>
+       <use>
+               <flag name="demos">Build vulkan demos and vulkaninfo</flag>
+       </use>
 </pkgmetadata>

diff --git a/media-libs/vulkan-loader/vulkan-loader-9999.ebuild 
b/media-libs/vulkan-loader/vulkan-loader-9999.ebuild
index c4fe082f078..cc127324a6b 100644
--- a/media-libs/vulkan-loader/vulkan-loader-9999.ebuild
+++ b/media-libs/vulkan-loader/vulkan-loader-9999.ebuild
@@ -7,6 +7,8 @@ PYTHON_COMPAT=( python3_{4,5,6} )
 if [[ "${PV}" == "9999" ]]; then
        
EGIT_REPO_URI="https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers.git";
        inherit git-r3
+
+       PATCHES=( "${FILESDIR}/${P}-no-external-sources.patch" )
 else
        KEYWORDS="~amd64"
        
SRC_URI="https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/archive/sdk-${PV}.tar.gz
 -> ${P}.tar.gz"
@@ -20,10 +22,11 @@ 
HOMEPAGE="https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers";
 
 LICENSE="Apache-2.0"
 SLOT="0"
-IUSE="wayland X"
+IUSE="demos wayland X"
 
 RDEPEND=""
 DEPEND="${PYTHON_DEPS}
+       demos? ( dev-util/glslang:=[${MULTILIB_USEDEP}] )
        wayland? ( dev-libs/wayland:=[${MULTILIB_USEDEP}] )
        X? ( x11-libs/libX11:=[${MULTILIB_USEDEP}] )"
 
@@ -32,7 +35,7 @@ multilib_src_configure() {
                -DCMAKE_SKIP_RPATH=True
                -DBUILD_TESTS=False
                -DBUILD_LAYERS=False
-               -DBUILD_DEMOS=False
+               -DBUILD_DEMOS=$(usex demos)
                -DBUILD_VKJSON=False
                -DBUILD_LOADER=True
                -DBUILD_WSI_MIR_SUPPORT=False

Reply via email to