SUMMARY="A small-footprint, speed optimized color management engine"
DESCRIPTION="
Little CMS intends to be an open source small-footprint color management \
engine, with special focus on accuracy and performance. It uses the \
International Color Consortium standard (ICC), which is the modern standard \
when regarding to color management. The ICC specification is widely used and \
is referred to in many International and other de-facto standards. It was \
approved as an International Standard, ISO 15076-1, in 2005.
"
HOMEPAGE="http://littlecms.com/" 
SOURCE_URI="http://downloads.sourceforge.net/project/lcms/lcms/$portVersion/lcms2-$portVersion.tar.gz"
CHECKSUM_SHA256="4524234ae7de185e6b6da5d31d6875085b2198bc63b1211f7dde6e2d197d6a53"
REVISION="1"
LICENSE="MIT"
COPYRIGHT="2007 Marti Maria"

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="
	lcms$secondaryArchSuffix = $portVersion compat >= 2
	lib:liblcms2$secondaryArchSuffix = 2.0.7 compat >= 2
	cmd:jpgicc$secondaryArchSuffix
	cmd:linkicc$secondaryArchSuffix
	cmd:psicc$secondaryArchSuffix
	cmd:tificc$secondaryArchSuffix
	cmd:transicc$secondaryArchSuffix
	"
REQUIRES="
	haiku
	lib:libjpeg$secondaryArchSuffix
	lib:libpng$secondaryArchSuffix
	lib:libtiff$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libjpeg$secondaryArchSuffix
	devel:libpng$secondaryArchSuffix
	devel:libtiff$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc${secondaryArchSuffix}
	cmd:ld${secondaryArchSuffix}
	cmd:libtoolize
	cmd:aclocal
	cmd:autoconf
	cmd:make
	"

SOURCE_DIR="lcms2-$portVersion"

BUILD()
{
	libtoolize --force --copy --install
	aclocal
	automake
	autoconf

	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
	
	# prepare develop/lib
	prepareInstalledDevelLibs liblcms2
	
	fixPkgconfig
	
	# devel package
	packageEntries devel \
		$developDir
}

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

PROVIDES_devel="
	lcms${secondaryArchSuffix}_devel = $portVersion
	devel:liblcms2$secondaryArchSuffix = 2.0.7 compat >= 2
	"
REQUIRES_devel="
	lcms$secondaryArchSuffix == $portVersion base
	"
