SUMMARY="Extended version of the yabasic programming language"
DESCRIPTION="
yab is an extended version of yabasic, a BASIC programming language, with \
special commands designed for Haiku.
"
HOMEPAGE="http://yab.orgfree.com"
SOURCE_URI="https://github.com/bbjimmy/YAB/archive/1.7.5.tar.gz"
CHECKSUM_SHA256="45ea5fccd6ec0989e93bdb4dc31c271cf8eb8f39cce9ca9c2f4ab02f3ee8cc10"

REVISION="2"
LICENSE="Artistic"
COPYRIGHT="
	1995-2006 Marc-Oliver Ihm (yabasic)
	2006-2009 Jan Bungeroth (yab improvements)
	2013-2015 Jim Saxton (yab improvements)
	"

ARCHITECTURES="x86_gcc2 x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
	yab = $portVersion
	cmd:yab = $portVersion
	lib:libyab = $portVersion
	devel:libyab = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:bison
	cmd:flex
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:mkdepend
	"
SOURCE_DIR=YAB-1.7.5

BUILD()
{	
	mkdir -p tmp
	cp -r src/* tmp
	cd tmp
	make  $jobArgs BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY`
}

INSTALL()
{	
	mkdir -p $binDir
	mkdir -p $libDir
	mkdir -p $appsDir/yab-IDE
	cp tmp/yab  $binDir/
	cp tmp/libyab.so $libDir/
	cp -r src $appsDir/yab-IDE/src
	cp tmp/bison.h $appsDir/yab-IDE/src/
	cp -r Documentation $appsDir/yab-IDE/Documentation
	mkdir -p $documentationDir
	ln -s $appsDir/yab-IDE/Documentation $documentationDir/yab-1.7.5
	prepareInstalledDevelLibs libyab
}
