SUMMARY="A tool to manage multiple clipboards"
DESCRIPTION="Ever had something important in your clipboard but you copied \
something else and lost the previous contents? ClipUp allows you to keep \
multiple clips and protect them even between reboots.

ClipUp is invoked by pressing CMD+SHIFT+V or by clicking on the icon in the \
Deskbar.
"
HOMEPAGE="https://github.com/HaikuArchives/ClipUp"
COPYRIGHT="2002 Werner Freytag"
LICENSE="MIT"
REVISION="3"
SOURCE_URI="https://github.com/HaikuArchives/ClipUp/archive/d47f0f6835.tar.gz"
CHECKSUM_SHA256="a79746196b42d0e3547f28c4691c807c0f28057a1a76a225da17beacdc93cf8c"
SOURCE_DIR="ClipUp-d47f0f6835b9f6b7ceb6374e8019bf97f31638c4"

# Builds but is broken.
ARCHITECTURES="!x86_gcc2"

USER_SETTINGS_FILES="
	settings/ClipUp_settings
	settings/clipup_clips
	"

PROVIDES="
	clipup = $portVersion
	app:ClipUp = $portVersion
	"
REQUIRES="
	haiku
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:gcc
	cmd:make
	cmd:xres
	"

BUILD()
{
	cd "Input Device"
	make
	cd "../Input Filter Ctrl-V"
	make
	cd "../Main"
	make
}

INSTALL()
{
	mkdir -p $addOnsDir/input_server/devices
	mkdir -p $addOnsDir/input_server/filters

	cd "Input Device"
	make install INSTALL_DIR=temp
	mv temp/* $addOnsDir/input_server/devices
	cd ..

	cd "Input Filter Ctrl-V"
	make install INSTALL_DIR=temp
	mv temp/* $addOnsDir/input_server/filters
	cd ..

	cd "Main"
	make install INSTALL_DIR=$appsDir
	mkdir -p "$dataDir/deskbar/menu/Desktop applets"
	symlinkRelative -s "$appsDir/ClipUp" "$dataDir/deskbar/menu/Desktop applets"
}
