SUMMARY="Build packages for the Haiku operating system"
DESCRIPTION="The HaikuPorter tool is provided to ease the fetching, patching \
and building of source code. It can be compared to a slim version of Gentoo \
Portage. Each port contains the Haiku-specific patches to the original source \
code. It fetches the original source code, applies the Haiku-specific \
patches, builds the software, and packages it according to so-called 'recipes'.

See the wiki on the HaikuPorter website for more information on its usage \
and details on how to create those recipes."
HOMEPAGE="https://github.com/haikuports/haikuporter"
COPYRIGHT="2013-2021 Haiku, Inc."
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/haikuports/haikuporter/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="9549fbc60509f33249d461b03f9f3aeb44fe86b99c23ad3e69b375354dc714a5"

ARCHITECTURES="any"

GLOBAL_WRITABLE_FILES="
	settings/haikuports.conf auto-merge
	"

PROVIDES="
	haikuporter = $portVersion
	cmd:haikuporter = $portVersion
	"
REQUIRES="
	haiku
	cmd:git
	cmd:python3
	"

BUILD_REQUIRES="
	"
BUILD_PREREQUIRES="
	cmd:cp
	"

BUILD()
{
	true
}

INSTALL()
{
	# This is very manual, however was done due to
	# https://github.com/haikuports/haikuports/issues/286
	# TODO: Setuptools once #286 is investigated
	mkdir -p $binDir
	cp haikuporter $binDir/

	mkdir -p $libDir/python3.7/vendor-packages/
	cp -R HaikuPorter $libDir/python3.7/vendor-packages/

	mkdir -p $settingsDir
	cp haikuports-sample.conf $settingsDir/haikuports.conf
}
