aboutsummaryrefslogtreecommitdiffstats
path: root/community/shaderc/APKBUILD
blob: 8933b39dc3797f04b3fa37c3c63089240ccd4453 (plain) (blame)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Leo <thinkabit.ukim@gmail.com>
pkgname=shaderc
pkgver=2019.1
pkgrel=0
pkgdesc="A collection of tools, libraries, and tests for Vulkan shader compilation"
options="!check" # Fails to configure when tests are enabled
url="https://github.com/google/shaderc"
arch="all"
license="Apache-2.0"
makedepends="cmake glslang-static glslang-dev spirv-tools-dev python3"
subpackages="$pkgname-static $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/google/shaderc/archive/v$pkgver.tar.gz
	fix-link-order.patch
	enum.patch
	third-party.patch
	fix-includes.patch
	"

prepare() {
	default_prepare

	rm -rf third_party

	_glslang_ver="$( . $startdir/../../*/glslang/APKBUILD; echo $pkgver)"
	_spirv_ver="$( . $startdir/../../*/spirv-tools/APKBUILD; echo $pkgver)"

	# Create our own build-version.inc since we disabled git versioning
	# need to keep this in sync with glslang and SPIRV-Tools versions
	# this is displayed with 'glslc --version'
	cat <<- EOF > glslc/src/build-version.inc
		"shaderc $pkgver\n"
		"SPIRV-Tools $_spirv_ver\n"
		"glslang $_glslang_ver\n"
	EOF
}

build() {
	export CXXFLAGS="$CXXFLAGS -I/usr/include/glslang"
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build . \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DSHADERC_SKIP_TESTS=ON \
		-DSHADERC_ENABLE_NV_EXTENSIONS=OFF \
		$CMAKE_CROSSOPTS
	make -C build
}

package() {
	make -C build DESTDIR="$pkgdir" install
}

sha512sums="dc4d617a6619fa6f743827fbec4065e51190e5516fbef59c7fb450740732524fc81ad22ad60a58488d84b45f24e459b71922e37fa05b4c06e0ddd0b59d46c315  shaderc-2019.1.tar.gz
bd24c90b93bf8bd7e56682e02543ff8a5c988549e76502144c2f4904e96b67ca0bc9d1e94b811bcdad1e765625256d3feabeb20ca299f2abb220e6e398d5a590  fix-link-order.patch
d09a23d98278cdef6535c189fc331f092ac185f444ce673a5ea8acba06b791ca8565188ee33d4ec2ec0bd4d1852dc00523fdfdff93b89ff8013b4a745a71cac9  enum.patch
5c5171ef2561070fece6b4cfa087f5baace7e5f828443719570494d9adc39ad724a414da7570f38629dbc9e7b563c8ad8226143c907ce7139a87615098006585  third-party.patch
07e4662de3049157d82cd5283c1831c136ff033bf91daea24c655012916f0b21dd4a8ae10f9b0200e904957495617731c8433dd168e687e7daeafe27d8924a41  fix-includes.patch"