SUMMARY="Port of FAR v2"
DESCRIPTION="Haiku port of FAR v2
Currently interesting only for entusiasts.

Currently working plugins: colorer, multiarc, farftp, tmppanel, align, \
autowrap, drawline, editcase, SimpleIndent"
HOMEPAGE="https://github.com/elfmz/far2l/"
COPYRIGHT="2016-2018 elfmz"
LICENSE="GNU GPL v2"
REVISION="1"
srcGitRev="fc5b0a3a2a8e7ef9e25e42f82f1202cdaa206529"
SOURCE_URI="https://github.com/elfmz/far2l/archive/$srcGitRev.zip"
CHECKSUM_SHA256="103e0540deaec5a80f05605c34faa14a431f3ab9ba522021d2af8a3ce2f497fd"
SOURCE_DIR="far2l-$srcGitRev"
PATCHES="far-$portVersion.patchset"

ARCHITECTURES="?all"

PROVIDES="
	far = $portVersion
	app:Far = $portVersion
	cmd:far = $portVersion
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	wxqt${secondaryArchSuffix}_devel
	devel:libglib_2.0$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++
	cmd:gawk
	cmd:m4
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	chmod +x far2l/bootstrap/scripts
	mkdir -p build
	cd build
	cmake ..\
		-DCMAKE_CXX_FLAGS="-D_GNU_SOURCE -D_BSD_SOURCE" \
		-DCMAKE_INSTALL_PREFIX:PATH=$prefix
}

INSTALL()
{
	cd build
	make install
	# TODO: fix install path
	addAppDeskbarSymlink $appsDir/Far/Far
}
