SUMMARY="Shared library for image manipulation"
DESCRIPTION="LibImageManip provides an easy way to create add-ons that \
transform images. Some basic add-ons are included."
HOMEPAGE="https://github.com/HaikuArchives/LibImageManip"
COPYRIGHT="2000 Edmund Vermeulen"
LICENSE="Public Domain"
SOURCE_URI="https://github.com/HaikuArchives/LibImageManip/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="f9aed23036fa2138c7902a9120fe01d96f6d97c02f0e67d6fa2e978a2437f9ec"
SOURCE_DIR="LibImageManip-$portVersion"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libimagemanip$secondaryArchSuffix = $portVersion
	lib:libimagemanip$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

PROVIDES_devel="
	libimagemanip${secondaryArchSuffix}_devel = $portVersion
	devel:libimagemanip$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	libimagemanip$secondaryArchSuffix == $portVersion base
	"

BUILD()
{
	cd Source
	make OBJ_DIR=objects $jobArgs
	mkdir -p ../Addons
	for i in DitherFloydSteinberg GammaCorrect MakeGray; do
		cd $i
		make $jobArgs
		cd ..
	done
}

INSTALL()
{
	mkdir -p $developDocDir $includeDir $libDir $addOnsDir/ImageManip/

	cp LibImageManip.html $developDocDir
	cp -R Include/. $includeDir/
	cp -R Addons/. $addOnsDir/ImageManip/

	cp Source/objects/libimagemanip.so $libDir

	prepareInstalledDevelLibs \
		libimagemanip

	packageEntries devel \
		$developDir
}
