SUMMARY="Tools and library for creating flame fractal images"
DESCRIPTION="Flam3 - Flames are algorithmically generated images and \
animations. The software was originally written in 1992 and released as \
open source, aka free software. Over the years it has been greatly expanded, \
and is now widely used to create art and special effects. The shape and \
color of each image is specified by a long string of numbers - a genetic \
code of sorts."
HOMEPAGE="https://flam3.com/"
COPYRIGHT="1992-2015 Scott Draves, Erik Reckase"
LICENSE="GNU GPL v3"
REVISION="2"
SOURCE_URI="https://github.com/scottdraves/flam3/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="afcd4af13897740e34f6ae1f3061bbfbda9c1dd5df3ecc9f57141c985d35d19d"
if [ "$effectiveTargetArchitecture" = x86_gcc2 ];then
	PATCHES="flam3-$portVersion.patchset"
fi

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	flam3$secondaryArchSuffix = $portVersion
	cmd:flam3_animate$secondaryArchSuffix
	cmd:flam3_convert$secondaryArchSuffix
	cmd:flam3_genome$secondaryArchSuffix
	cmd:flam3_render$secondaryArchSuffix
	lib:libflam3$secondaryArchSuffix = 0.0.0 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
	lib:libpng16$secondaryArchSuffix
	lib:libxml2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	flam3${secondaryArchSuffix}_devel = $portVersion
	devel:libflam3$secondaryArchSuffix = 0.0.0 compat >= 0
	"
REQUIRES_devel="
	flam3$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libjpeg$secondaryArchSuffix
	devel:libpng16$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:git
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	autoreconf -vfi
	runConfigure ./configure --enable-shared
	make $jobArgs
}

INSTALL()
{
	make install

	rm $libDir/libflam3.la

	prepareInstalledDevelLib libflam3
	fixPkgconfig

	packageEntries devel \
		$developDir
}
