SUMMARY="A native editor for vector/bitmap graphics"
DESCRIPTION="WonderBrush is an editor for bitmap and vector graphics.

The main window holds any number of documents, which are called Canvas. Each \
canvas can have any number of Layers, arranged as a list. Each layer \
represents an individual bitmap in the size of the canvas. Depending on each \
layer's 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 with \
WonderBrush's tools, e.g. brush strokes, shapes, text objects or filters. 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 edit the objects they \
contain. This could be called non-linear editing. It is also possible to \
change most of an object's properties later on. This could be called \
non-destructive editing, because adding another object (like a filter) does \
not actually destroy any pixel data.

An open WonderBrush document references up to two files: one is a file in some \
export format (e.g. an SVG document, some bitmap format like PNG or JPEG, \
etc.). The other is a full-featured project file.

The canvas resolution can be changed at any time, with all objects being \
resized accordingly. This makes WonderBrush a kind of hybrid of bitmap and \
vector editor."
HOMEPAGE="https://github.com/stippi/WonderBrush-v2"
COPYRIGHT="2005-2021, Stephan Aßmus und Ingo Weinhold GbR"
LICENSE="WonderBrush"
REVISION="11"
srcGitRev="f6df82a9021534130c1649080a26d21f9742610d"
SOURCE_URI="$HOMEPAGE/archive/$srcGitRev.tar.gz"
SOURCE_DIR="WonderBrush-v2-$srcGitRev"
CHECKSUM_SHA256="6e6e9c3294c2f1036e93b18283b6d80d5b7b072bab408ede0a5e0a0a7473e236"

ARCHITECTURES="all"

USER_SETTINGS_FILES="
	settings/WonderBrush directory
	"

PROVIDES="
	wonderbrush = $portVersion compat >= 2
	app:WonderBrush = $portVersion compat >= 2
	"
REQUIRES="
	haiku
	lib:libexpat
	lib:libfreetype
	lib:liblayout
	lib:libz
	"

BUILD_REQUIRES="
	haiku_devel
	devel:libexpat
	devel:libfreetype
	devel:liblayout
	"
BUILD_PREREQUIRES="
	haiku
	cmd:gcc
	cmd:jam
	"

BUILD()
{
	# multi-job builds don't work reliably
	[ $targetArchitecture = x86_64 ] && TARGET_PLATFORM=haiku64
	[ $targetArchitecture = x86_gcc2 ] && TARGET_PLATFORM=haiku
	jam -sTARGET_PLATFORM=$TARGET_PLATFORM
}

INSTALL()
{
	docFolder=$documentationDir/packages/wonderbrush
	mkdir -p $appsDir \
		$docFolder/Deutsch $docFolder/English $docFolder/Polski

	cp WonderBrush/WonderBrush $appsDir
	addAppDeskbarSymlink $appsDir/WonderBrush

	cd WonderBrush/doc
	cp -r -t $docFolder/Deutsch Deutsch/html Deutsch/tutorials
	ln -s $docFolder/Deutsch/html/introduction.html $docFolder/Deutsch/Docs.html

	cp -r -t $docFolder/English English/html English/tutorials
	ln -s $docFolder/English/html/introduction.html $docFolder/English/Docs.html

	cp -r -t $docFolder Polski
}
