SUMMARY="Modal code editor with a focus on interactivity"
DESCRIPTION="Kakoune is a code editor that implements Vi's \"keystrokes as a text \
editing language\" model.  As it's also a modal editor, it is somewhat \
similar to the Vim editor (after which Kakoune was originally inspired).

Kakoune has a strong focus on interactivity, most commands provide \
immediate and incremental results, while still being competitive (as \
in keystroke count) with Vim.

Kakoune works on selections, which are oriented, inclusive range of \
characters, selections have an anchor and a cursor character.  Most \
commands move both of them, except when extending selection where the \
anchor character stays fixed and the cursor one moves around."
HOMEPAGE="https://kakoune.org/"
COPYRIGHT="Public Domain"
LICENSE="Unlicense"
REVISION="1"
SOURCE_URI="https://github.com/mawww/kakoune/releases/download/v$portVersion/kakoune-$portVersion.tar.bz2"
CHECKSUM_SHA256="aa30889d9da11331a243a8f40fe4f6a8619321b19217debac8f565e06eddb5f4"
PATCHES="kakoune-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
	commandSuffix=
	commandBinDir=$prefix/bin
fi

PROVIDES="
	kakoune$secondaryArchSuffix
	cmd:kak$commandSuffix
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:cmp
	cmd:find
	cmd:gcc$secondaryArchSuffix
	cmd:install
	cmd:ld$secondaryArchSuffix
	cmd:make
	"

BUILD()
{
	make $jobArgs
}

INSTALL()
{
	make bindir="$commandBinDir" docdir="$docDir" libexecdir="$libExecDir" \
		mandir="$manDir/man1" sharedir="$dataDir/kak" install
}
