SUMMARY="Converts joystick signals to keyboard events"
DESCRIPTION="JoystickUtilizer converts joystick signals into keyboard events. \
Finally you can play games with a joystick that didn't support one so far. \
Very useful for emulators!"
HOMEPAGE="https://github.com/HaikuArchives/JoystickUtilizer"
COPYRIGHT="2002-2008 Werner Freytag"
LICENSE="MIT"
REVISION="2"
srcGitRev="73a7cb393e3c1366a82e384b756acbd5a790580b"
SOURCE_URI="https://github.com/HaikuArchives/JoystickUtilizer/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="582b4aa7f1e7be3157e7bd0d08a1462e6c326e78b765d35c826d2337360cae56"
SOURCE_DIR="JoystickUtilizer-$srcGitRev/trunk"

ARCHITECTURES="all"

USER_SETTINGS_FILES="
	settings/JoystickUtilizer_settings
	"

PROVIDES="
	joystickutilizer = $portVersion
	add_on:JoystickUtilizerDevice = $portVersion
	app:JoystickUtilizer = $portVersion
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:g++
	cmd:make
	"

BUILD()
{
	cd InputDevice
	make $jobArgs OBJ_DIR=objects

	cd ..
	make $jobArgs OBJ_DIR=objects
}

INSTALL()
{
	mkdir -p $preferencesDir
	cp -af objects/JoystickUtilizer $preferencesDir

	cd InputDevice
	mkdir -p $addOnsDir/input_server/devices
	cp -af objects/JoystickUtilizerDevice \
		$addOnsDir/input_server/devices

	addPreferencesDeskbarSymlink $preferencesDir/JoystickUtilizer
}
