SUMMARY="Generate Your Projects (GYP) is a build automation tool"
DESCRIPTION="GYP is created by Google to generate native IDE project files \
(such as Visual Studio and Xcode) for building the Chromium web browser and is \
licensed as open source software using the BSD software license.
"
HOMEPAGE="https://code.google.com/p/gyp/"
SOURCE_URI="svn+http://gyp.googlecode.com/svn/trunk#1948"
LICENSE="BSD (2-clause)"
COPYRIGHT="2012 Google Inc."
REVISION="2"
ARCHITECTURES="x86 x86_gcc2 x86_64"

SOURCE_DIR="gyp-$portVersion"
PATCHES="gyp-r1948.patch"

PROVIDES="
	gyp = $portVersion
	cmd:gyp = $portVersion
	"
REQUIRES="
	haiku
	cmd:python
	python_setuptools
	"
BUILD_REQUIRES="
	python_setuptools
	"
BUILD_PREREQUIRES="
	haiku_devel
	cmd:python
	"

BUILD()
{
	$portPackageLinksDir/cmd~python/bin/python setup.py build
}

INSTALL()
{
	# GENERIC: all python_setuptools-based installs need this
	pythonVersion=$(python --version 2>&1 | sed 's/Python //' | head -c3)
	installLocation=$prefix/lib/python$pythonVersion/vendor-packages/
	export PYTHONPATH=$installLocation:$PYTHONPATH
	mkdir -p $installLocation
	
	$portPackageLinksDir/cmd~python/bin/python setup.py install \
		--prefix=$prefix
}
