SUMMARY="Save optimized PNG files"
DESCRIPTION="The OptiPNGTranslator allows you to save images as PNG files \
which have been optimized with the commandline tool optipng.
It's a translator, therefore the option to save as 'Optimized PNG image' will \
be available in any native application. You find settings like the \
optimization level in the DataTranslations preferences. The higher the \
level, the longer it takes."
HOMEPAGE="https://github.com/noryb009/OptiPNGTranslator"
COPYRIGHT="2013-2018 Luke (noryb009)"
LICENSE="MIT"
REVISION="5"
srcGitRev="22a9172ddd2035f1770ac0bd32e858d9d33cef27"
SOURCE_URI="$HOMEPAGE/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="0372a3e5276e59f93c8ee14a545d9183fbc0c68b22ac66ee899f8d9723b34e13"
SOURCE_FILENAME="optipngtranslator-$portVersion-$srcGitRev.tar.gz"
SOURCE_DIR="OptiPNGTranslator-$srcGitRev"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	optipngtranslator$secondaryArchSuffix = $portVersion
	add_on:OptiPNGTranslator$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	cmd:optipng
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:as
	cmd:gcc$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	make \
		BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY` \
        TARGET_DIR=.
}

INSTALL()
{
	mkdir -p $addOnsDir/Translators
	cp OptiPNGTranslator $addOnsDir/Translators
}
