SUMMARY="Bible study tool that supports a wide variety of Bibles"
DESCRIPTION="ScriptureGuide is a Bible study tool. It supports all of the \
features you'd expect: search, setting the font, taking notes, etc. Through \
the accompanying ScriptureGuideManager app, you can download hundereds of free \
copies of various Bibles, commentaries, and related books."
COPYRIGHT="2014 ScriptureGuide Team"
LICENSE="GNU GPL v2"
HOMEPAGE="https://github.com/HaikuArchives/ScriptureGuide" 
SOURCE_URI="https://github.com/HaikuArchives/ScriptureGuide/archive/v0.9.0.tar.gz"
CHECKSUM_SHA256="63b36186eaf4be130f333e62fa0fb283dbff90149a14763e96c157d9950777b5"
SOURCE_DIR="ScriptureGuide-$portVersion"
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="
	scriptureguide$secondaryArchSuffix = $portVersion
	app:ScriptureGuide = $portVersion
	app:ScriptureGuideManager = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix
	cmd:awk
	cmd:wget
	cmd:unzip
	lib:libsword$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	icu$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsword$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	icu${secondaryArchSuffix}_devel
	"

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

BUILD()
{
	cd ScriptureGuide
	make $jobArgs
	cd ../ScriptureGuideManager
	make $jobArgs
}

INSTALL()
{
	mkdir -p $appsDir
	cp -R App $appsDir
	mv $appsDir/App $appsDir/ScriptureGuide
	
	addAppDeskbarSymlink $appsDir/ScriptureGuide/ScriptureGuide
	addAppDeskbarSymlink $appsDir/ScriptureGuide/ScriptureGuideManager
}
