SUMMARY="Syntax highlighting engine for Kate syntax definitions"
DESCRIPTION="This is a stand-alone implementation of the Kate syntax \
highlighting engine. It's meant as a building block for text editors as \
well as for simple highlighted text rendering (e.g. as HTML), supporting \
both integration with a custom editor as well as a ready-to-use \
QSyntaxHighlighter sub-class."
HOMEPAGE="https://github.com/KDE/syntax-highlighting/"
COPYRIGHT="2010-2021 KDE Organisation"
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://github.com/KDE/syntax-highlighting/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="a324527a0bca0238e69ad05da207420fb21058870f5d2ff7f1f0008beb484106"
SOURCE_DIR="syntax-highlighting-$portVersion"

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

PROVIDES="
	ksyntax_highlighting$secondaryArchSuffix = $portVersion
	cmd:kate_syntax_highlighter$secondaryArchSuffix = $portVersion
	lib:libKF5SyntaxHighlighting$secondaryArchSuffix = $portVersion compat >= 5
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libQt5Core$secondaryArchSuffix
	lib:libQt5Gui$secondaryArchSuffix
	lib:libQt5Xml$secondaryArchSuffix
	"

PROVIDES_devel="
	ksyntax_highlighting${secondaryArchSuffix}_devel = $portVersion
	devel:ksyntax_highlighting$secondaryArchSuffix = $portVersion compat >= 5
	devel:libkf5syntaxhighlighting$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	ksyntax_highlighting$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	extra_cmake_modules$secondaryArchSuffix >= $portVersion
	devel:libKF5CoreAddons$secondaryArchSuffix == $portVersion
	devel:libQt5Core$secondaryArchSuffix >= 5.7
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:g++$secondaryArchSuffix
	cmd:lrelease$secondaryArchSuffix >= 5
	cmd:make
	cmd:perl
	"

BUILD()
{
	mkdir -p build
	cd build

	cmake .. $cmakeDirArgs \
		-DCMAKE_BUILD_TYPE=Release \
		-DKDE_INSTALL_PLUGINDIR=$addOnsDir/Qt5 \
		-DECM_MKSPECS_INSTALL_DIR=$dataDir/Qt5/mkspecs \
		-DECM_DIR=/system/data/cmake/Modules/ECM/cmake
	make $jobArgs
}

INSTALL()
{
	cd build
	make install

	prepareInstalledDevelLibs \
		libKF5SyntaxHighlighting

	packageEntries devel \
		$libDir/cmake \
		$dataDir/Qt5/mkspecs \
		$developDir
}

TEST()
{
	cd build
	make test
}
