summaryrefslogtreecommitdiff
path: root/dev-util/SPIRV-Tools/SPIRV-Tools-scm.ebuild
blob: 6be89f366d6bcd7bd5f6782cf4a78eba30bde58b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6
PYTHON_COMPAT=( python3_{4,5,6} )

inherit python-any-r1 cmake-multilib

DESCRIPTION="GLSL reference compiler."
HOMEPAGE="https://github.com/KhronosGroup/SPIRV-Tools"

SRC_URI=""
EGIT_REPO_URI="https://github.com/KhronosGroup/SPIRV-Tools"
inherit git-r3
KEYWORDS=

LICENSE="spirv-tools"
SLOT="0/${PV}"
IUSE=""

DEPEND="${PYTHON_DEPS}"
RDEPEND="${DEPEND}"



src_unpack() {
	git-r3_src_unpack
	git-r3_fetch "https://github.com/KhronosGroup/SPIRV-Headers.git" \
			"refs/heads/master"
	git-r3_checkout "https://github.com/KhronosGroup/SPIRV-Headers.git" \
			${S}/external/spirv-headers
}

src_prepare() {
	default

	# Stolen from vulkan-loader
	python ${FILESDIR}/external_revision_generator.py \
		${S} SPIRV_TOOLS_COMMIT_ID include/spirv-tools/spirv_tools_commit_id.h || die failed to generate commit_id header

	# Hack to install generated id header
	sed -i \
		-e '/linker\.hpp/a \${CMAKE_CURRENT_SOURCE_DIR}\/include\/spirv-tools\/spirv_tools_commit_id\.h' \
		CMakeLists.txt || die sed failed
}