SUMMARY="Graphite text processing engine"
DESCRIPTION="
Graphite2 is a library providing rendering capabilities for complex non-Roman \
writing systems."
HOMEPAGE="http://graphite.sil.org"
COPYRIGHT="2010-2013 SIL International"
LICENSE="GNU LGPL v2.1"
#SOURCE_URI="http://sourceforge.net/projects/silgraphite/files/graphite2/graphite2-$portVersion.tar.gz"
SOURCE_URI="http://dev-www.libreoffice.org/src/graphite2-$portVersion.tgz"
CHECKSUM_SHA256="4bc3d5168029bcc0aa00eb2c973269d29407be2796ff56f9c80e10736bd8b003"
PATCHES="graphite2-$portVersion.patchset"
REVISION="1"
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"
else
	ARCHITECTURES="$ARCHITECTURES !x86_gcc2"
fi
SECONDARY_ARCHITECTURES="!x86_gcc2 x86"

PROVIDES="
	graphite2$secondaryArchSuffix = $portVersion compat >= 1.2
	lib:libgraphite2$secondaryArchSuffix = 3.0.1 compat >= 3
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:cmake
	cmd:make
	"

BUILD()
{
	cmake -DCMAKE_INSTALL_PREFIX:PATH=$prefix -DLIB_SUFFIX=$secondaryArchSubDir .
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libgraphite2
	fixPkgconfig

	# devel package
	packageEntries devel \
		$binDir \
		$developDir
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	graphite2${secondaryArchSuffix}_devel = $portVersion compat >= 1.2
	devel:libgraphite2$secondaryArchSuffix = 3.0.1 compat >= 3
	cmd:gr2fonttest$secondaryArchSuffix
	"
REQUIRES_devel="
	graphite2$secondaryArchSuffix == $portVersion base
	haiku$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	"
