SUMMARY="A small build system similar to make"
DESCRIPTION="Ninja is a small build system with a focus on speed. It differs \
from other build systems in two major respects: it is designed to have its \
input files generated by a higher-level build system, and it is designed to \
run builds as fast as possible.
Ninja's low-level approach makes it perfect for embedding into more featureful \
build systems. Via gyp it can build Chrome and v8 and node.js etc.; via CMake \
it can build LLVM, KDE, Blender, etc.
"
HOMEPAGE="http://martine.github.io/ninja/"
LICENSE="Apache v2"
COPYRIGHT="2014 Google Inc."
SOURCE_URI="https://github.com/martine/ninja/archive/v1.5.1.tar.gz"
CHECKSUM_SHA256="fba77b9ed4b4dd0e86c4513776938dc64bd4508dc2055b04c0c6df68bcfa397d"
PATCHES="ninja-1.5.1.patch"
REVISION="2"
ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	ninja$secondaryArchSuffix = $portVersion
	cmd:ninja = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgcc_s$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel
	haiku_devel
	cmd:python
	cmd:g++$secondaryArchSuffix
	cmd:gcc$secondaryArchSuffix
	cmd:as$secondaryArchSuffix
	"

BUILD()
{
	python ./bootstrap.py
}

INSTALL()
{
	mkdir -p $prefix/bin
	cp ninja $prefix/bin
}
