DESCRIPTION="Chicken is a Scheme interpreter and native Scheme to C compiler" 
HOMEPAGE="http://www.call-cc.org/" 
SRC_URI="http://code.call-cc.org/releases/4.7.0/chicken-4.7.0.tar.gz"
CHECKSUM_MD5="9389388fdf04c3c64de29633aae12539"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND=""
BUILD()
{
	cd chicken-4.7.0
	if [ `gcc -dumpversion | cut -f1 -d.` -eq "2" ];then
		echo "Removing -fwrapv flag for gcc2 build"
		sed -i 's/-fwrapv//' Makefile.haiku
	fi
	make PLATFORM=haiku PREFIX=`finddir B_COMMON_DIRECTORY` \
	MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man1 \
	DOCDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/doc/chicken \
	DATADIR=`finddir B_COMMON_DATA_DIRECTORY`/chicken
	
}

INSTALL()
{
	cd chicken-4.7.0
	make PLATFORM=haiku PREFIX=`finddir B_COMMON_DIRECTORY` install \
	MANDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man1 \
	DOCDIR=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/doc/chicken \
	DATADIR=`finddir B_COMMON_DATA_DIRECTORY`/chicken
}

TEST()
{
	if ! type -p csi > /dev/null;then
		echo "ERROR: Chicken must be installed before running the test suite"
		exit 1
	fi
	cd chicken-4.7.0
	make PLATFORM=haiku PREFIX=`finddir B_COMMON_DIRECTORY` check
}

LICENSE="BSD (2-clause)"
COPYRIGHT="2008-2011 The Chicken Team
		2000-2007 Felix L. Winkelmann"
