SUMMARY="Powerfully simple build configuration"
DESCRIPTION="\
Describe your software project with a full-featured scripting language and \
let Premake write the build scripts for you. With one file your project can \
support both IDE-addicted Windows coders and Linux command-line junkies!
"
HOMEPAGE="http://industriousone.com/premake"
SOURCE_URI="http://sourceforge.net/projects/premake/files/Premake/4.4/premake-4.4-beta5-src.zip"
CHECKSUM_SHA256="0fa1ed02c5229d931e87995123cdb11d44fcc8bd99bba8e8bb1bbc0aaa798161"
REVISION="1"
LICENSE="BSD (2-clause)"
COPYRIGHT="2012 Industrious One, LLC"

ARCHITECTURES="x86 ?x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
else
	ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	premake
	premake4$secondaryArchSuffix = $portVersion
	cmd:premake4$secondaryArchSuffix = $portVersion
"

REQUIRES="
	haiku$secondaryArchSuffix
"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
"

BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
"

SOURCE_DIR="premake-4.4-beta5"

PATCH()
{
	sed -i '/#define LUA_USE_ULONGJMP/d' src/host/lua-5.1.4/src/luaconf.h
	sed -i '/-lm/d' build/gmake.unix/Premake4.make
	sed -i 's/-rdynamic//g' build/gmake.unix/Premake4.make
}

BUILD()
{
	cd build/gmake.unix
	make config=release
}

INSTALL()
{
	cd bin/release
	mkdir -p $binDir
	install -m 0755 premake4 $binDir
}

