SUMMARY="An advanced text editor"
DESCRIPTION="An advanced text editor, written in Python, with useful features:
* Syntax highlighting
* Code completion
* Session restore
* Code folding
* Macros
* External commands
* Spell checker
* Split view"
HOMEPAGE="https://gitlab.com/JakobDev/jdTextEdit"
COPYRIGHT="2019-2021 JakobDev"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://gitlab.com/JakobDev/jdTextEdit/-/archive/$portVersion/jdTextEdit-$portVersion.tar.gz"
CHECKSUM_SHA256="3f99bd69b3f2f9296409a08877d25ac6bb0aaa9ce9abc4dbf7bc050d76301b3e"
SOURCE_DIR="jdTextEdit-$portVersion"
ADDITIONAL_FILES="
	distribution.json
	jdtextedit.rdef
	"

ARCHITECTURES="any"

PROVIDES="
	jdtextedit = $portVersion
	app:jdTextEdit = $portVersion
	"
REQUIRES="
	haiku
	cmd:python3.8
	chardet_python38
	editorconfig_core_py_python38
	jdtranslationhelper_python38
	pyenchant_python38
	pyqt5_python38
	qscintilla_python38
	requests_python38
	setuptools_python38
	"

BUILD_REQUIRES="
	haiku_devel
	setuptools_python38
	"

INSTALL()
{
	python3.8 setup.py install \
		--root=/ --prefix=$prefix \
		--install-data=$dataDir

	cp $portDir/additional-files/distribution.json \
		$prefix/lib/python3.8/vendor-packages/jdTextEdit/distribution.json

	mkdir -p $appsDir
	mv $prefix/bin/jdTextEdit $appsDir/jdTextEdit
	settype -t application/x-vnd.Be-elfexecutable $appsDir/jdTextEdit

	rc  $portDir/additional-files/jdtextedit.rdef
	resattr -o $appsDir/jdTextEdit  $portDir/additional-files/jdtextedit.rsrc

	addAppDeskbarSymlink $appsDir/jdTextEdit
}
