SUMMARY="Native editor for bitmap graphics"
DESCRIPTION="
WonderBrush is an editor for bitmap graphics. The main window holds any number \
of documents, which are called Canvas. A canvas has an associated name and \
pixel resolution as well as some other properties. It also references up to \
two files, which represent it on disk, one is a file in some export format \
(ie. an SVG document, a flat Translator bitmap or soure code), the other a \
full-featured project file.
Each canvas can have any number of Layers, currently arranged as a list. Each \
layer represents an individual bitmap in the size of the canvas. Depending on \
each layers blending mode, they are composed on top of each other to form the \
final canvas bitmap.
Each layer can contain any number of Objects, which are created by \
WonderBrush's tools. Each object has a set of properties which define the \
unique appearance of the object on the layer.
At any time, it is possible to reorder the layers, or the objects they \
contain. This could be called non-linear editing. It is also possible to \
change most of an objects properties later on. This could be called \
non-destructive editing, because adding another object (like a filter) does \
not actually destroy any pixel data.
"
HOMEPAGE="http://yellowbites.com/wonderbrush.html" 
LICENSE="WonderBrush"
COPYRIGHT="2005, Stephan Aßmus und Ingo Weinhold GbR"
SOURCE_URI="http://yellowbites.com/downloads/WonderBrush-2.1.2-x86-gcc2-2013-01-02.zip#noarchive"
CHECKSUM_SHA256="d0e9fad818c3f7900a475b80a249c9aa4eb118dc8498a6370a87e7a10fa42067"
REVISION="5"
ARCHITECTURES="x86_gcc2"
if [ $effectiveTargetArchitecture = x86_gcc2 -a $targetArchitecture = x86 ]
then
	ARCHITECTURES="$ARCHITECTURES x86"
fi
SECONDARY_ARCHITECTURES="x86_gcc2"
DISABLE_SOURCE_PACKAGE=yes

PROVIDES="
	wonderbrush$secondaryArchSuffix = $portVersion compat >= 2
	app:WonderBrush = $portVersion compat >= 2
	"
REQUIRES="
	haiku$secondaryArchSuffix >= r1~alpha3_pm-1
	lib:libfreetype$secondaryArchSuffix >= 6
	lib:libz$secondaryArchSuffix >= 1
	lib:liblayout$secondaryArchSuffix
	"
BUILD_REQUIRES="
	"
BUILD_PREREQUIRES="
	haiku$secondaryArchSuffix
	coreutils
	cmd:unzip
	"

USER_SETTINGS_FILES="
	settings/WonderBrush directory
	"

SOURCE_DIR="WonderBrush"

BUILD()
{
	:
}

INSTALL()
{
	wonderbrushDir=$appsDir/WonderBrush
	mkdir -p $appsDir
	unzip -d $appsDir WonderBrush-2.1.2-x86-gcc2-2013-01-02.zip

	rm -f $wonderbrushDir/lib/liblayout.so

	# Hack to make libfreetype and libz available under the name WonderBrush
	# has been linked against them.
	ln -s $portPackageLinksDir/lib~libfreetype$secondaryArchSuffix/lib/libfreetype.so.6 \
		$wonderbrushDir/lib/libfreetype.so
	ln -s $portPackageLinksDir/lib~libz$secondaryArchSuffix/lib/libz.so.1 \
		$wonderbrushDir/lib/libz.so

	addAppDeskbarSymlink $wonderbrushDir/WonderBrush
}
