gn-0.1557.2c72317e.recipe revision 86c81ecb
1SUMMARY="A meta-build system that generates build files for Ninja"
2DESCRIPTION="GN is a meta-build system that generates build files for Ninja"
3HOMEPAGE="https://gn.googlesource.com/"
4COPYRIGHT="2008-2019 The Chromium Authors."
5LICENSE="BSD (3-clause)"
6REVISION="1"
7srcGitRev="2c72317e3a1f579c6a527c067ed575c0b92e544e"
8SOURCE_URI="https://github.com/korli/gn/archive/$srcGitRev.tar.gz"
9CHECKSUM_SHA256="83fcb58c63ca57b2f07ca85559d9773c9f48ab5736585301c1127459ec977a1f"
10SOURCE_FILENAME="gn-$portVersion-$srcGitRev.tar.gz"
11SOURCE_DIR="gn-$srcGitRev"
12PATCHES="gn-$portVersion.patchset"
13
14ARCHITECTURES="!x86_gcc2 x86 x86_64"
15if [ "$targetArchitecture" = x86_gcc2 ]; then
16SECONDARY_ARCHITECTURES="x86"
17fi
18
19commandBinDir=$binDir
20if [ "$targetArchitecture" = x86_gcc2 ]; then
21	commandBinDir=$prefix/bin
22fi
23
24PROVIDES="
25	gn$secondaryArchSuffix = $portVersion
26	cmd:gn = $portVersion
27	"
28REQUIRES="
29	haiku$secondaryArchSuffix
30	"
31
32BUILD_REQUIRES="
33	haiku${secondaryArchSuffix}_devel
34	"
35BUILD_PREREQUIRES="
36	cmd:gcc$secondaryArchSuffix
37	cmd:g++$secondaryArchSuffix
38	cmd:ninja
39	cmd:python
40	cmd:git
41	cmd:sed
42	"
43
44BUILD()
45{
46	export CC=gcc
47	export CXX=g++
48
49	GN_COMMIT_VERSION_SHORT=`echo $srcGitRev | cut -c 1-7`
50
51	sed  -i \
52		"s/(999999, \"091169b\")/(\"01473\", \"$GN_COMMIT_VERSION_SHORT\")/g" \
53		build/gen.py
54
55	python build/gen.py --host haiku --platform=haiku
56	ninja -C out $jobArgs
57}
58
59INSTALL()
60{
61	mkdir -p $commandBinDir
62	cp out/gn $commandBinDir
63}
64
65TEST()
66{
67	./out/gn_unittests
68}
69