SUMMARY="An input method for Chinese, Japanese and Korean"
DESCRIPTION="BeCJK was an input method for legacy BeOS, now works on Haiku."
HOMEPAGE="https://github.com/HaikuArchives/BeCJK"
COPYRIGHT="2001-2002 Anthony Lee"
LICENSE="GNU LGPL v2"
REVISION="3"
srcGitRev="35ede035067ebfa14f9a906b57ec17e77f310bff"
SOURCE_URI="https://github.com/HaikuArchives/BeCJK/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="4d64bd104fb925fe9dc9ca7d066d2dd755d80f8c250f391c0085f7ae4633e1a5"
SOURCE_DIR="BeCJK-$srcGitRev"

ARCHITECTURES="all"

PROVIDES="
	BeCJK = $portVersion
	addon:BeCJK = $portVersion
	lib:libbesavager = $portVersion
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc
	cmd:ld
	cmd:python
	cmd:scons
	"

BUILD()
{
	scons -Q
}

INSTALL()
{
	mkdir -p $libDir
	mkdir -p $dataDir/BeCJK/dicts/
	mkdir -p $addOnsDir/input_server/methods/

	cp generated/lib/besavager/*.so $libDir/
	cp generated/data/BeCJK/dicts/* $dataDir/BeCJK/dicts/
	cp generated/add-ons/input_server/methods/BeCJK \
		$addOnsDir/input_server/methods/
}
