SUMMARY="A Qt Mind map application"
DESCRIPTION="Desktop application for creating mind maps and other suitable diagrams.
It's written in Qt.

Features:
- Adjustable grid
- Automatic layout optimization
- Easy-to-use UI
- Export to PNG or SVG
- Forever 100% free
- Full undo/redo
- Nice animations
- Quickly add node text and edge labels
- Save/load in XML-based .ALZ-files
- Translations in English (default), Finnish, French, Italian, Dutch
- Very fast
- Zoom in/out/fit
- Zoom with mouse wheel
"
COPYRIGHT="2018-2020 Jussi Lind"
HOMEPAGE="https://github.com/juzzlin/Heimer"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/juzzlin/Heimer/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="61e0d60abb6e2ae1347843e96bb5e31f61604857f4097765aea3ffd31a3dcc8d"
SOURCE_FILENAME="Heimer-$portVersion.tar.gz"
SOURCE_DIR="Heimer-$portVersion"
ADDITIONAL_FILES="heimer.rdef.in"

ARCHITECTURES="all ?x86_gcc2"
if [ "$targetArchitecture" = x86_gcc2 ]; then
	SECONDARY_ARCHITECTURES="x86"
fi

PROVIDES="
	heimer$secondaryArchSuffix = $portVersion
	app:Heimer = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libGL$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Network$secondaryArchSuffix
	lib:libQt5PrintSupport$secondaryArchSuffix
	lib:libQt5Svg$secondaryArchSuffix
	lib:libQt5Xml$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libQt5Core$secondaryArchSuffix
	devel:libQt5Gui$secondaryArchSuffix
	devel:libQt5Network$secondaryArchSuffix
	devel:libQt5PrintSupport$secondaryArchSuffix
	devel:libQt5Svg$secondaryArchSuffix
	devel:libQt5Xml$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix >= 5
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:qmake$secondaryArchSuffix >= 5
	cmd:unzip
	"

BUILD()
{
	qmake
	make $jobArgs
}

INSTALL()
{
	install -d $appsDir
	install -T ./heimer $appsDir/Heimer

	local APP_SIGNATURE="application/x-vnd.heimer"
	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
	local MINOR="`echo "$portVersion" | cut -d. -f3`"
	local LONG_INFO="$SUMMARY"
	sed \
		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
		-e "s|@MAJOR@|$MAJOR|" \
		-e "s|@MIDDLE@|$MIDDLE|" \
		-e "s|@MINOR@|$MINOR|" \
		-e "s|@LONG_INFO@|$LONG_INFO|" \
		"$portDir"/additional-files/heimer.rdef.in > Heimer.rdef

	addResourcesToBinaries Heimer.rdef $appsDir/Heimer
	addAppDeskbarSymlink $appsDir/Heimer
}
