SUMMARY="A multi-protocol IM client"
DESCRIPTION="Chat-O-Matic is a multi-protocol chat client. It supports \
IRC, XMPP, and other protocols through libpurple."
HOMEPAGE="https://github.com/JadedCtrl/Chat-O-Matic"
COPYRIGHT="2009-2011 Andrea Anzani
	2010-2015 Dario Casalinuovo
	2009-2011 Pier Luigi Fiorini
	2021 Jaidyn Levesque"
LICENSE="MIT"
REVISION="1"
srcGitRev="2f69f2fa04a915ff6088e9d6d273441854686556"
SOURCE_URI="https://github.com/JadedCtrl/Chat-O-Matic/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="3bbd001817b3d1f8733cb7c51173aff0fd61c8be7c2bc1e577ec038019a52b30"
SOURCE_DIR="Chat-O-Matic-$srcGitRev"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	chat_o_matic$secondaryArchSuffix = $portVersion
	app:Chat_O_Matic = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libexpat$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libgloox$secondaryArchSuffix
	lib:libpurple$secondaryArchSuffix
	lib:libssl$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	chat_o_matic${secondaryArchSuffix}_devel = $portVersion
	"
REQUIRES_devel="
	haiku${secondaryArchSuffix}_devel
	chat_o_matic$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libexpat$secondaryArchSuffix
	devel:libglib_2.0$secondaryArchSuffix
	devel:libgloox$secondaryArchSuffix
	devel:libpurple$secondaryArchSuffix
	devel:libssl$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:g++$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	make OBJ_DIR=objects LIB_DIR=objects
}

INSTALL()
{
	mkdir -p $appsDir
	cp objects/Chat-O-Matic $appsDir

	mkdir -p $addOnsDir/chat-o-matic/
	cp objects/chat-o-matic/* $addOnsDir/chat-o-matic/

	addAppDeskbarSymlink $appsDir/Chat-O-Matic

	mkdir -p $includeDir/chat-o-matic/
	cp application/ChatOMatic.h application/ChatProtocol.h \
		application/ChatProtocolMessages.h application/Flags.h \
		application/UserStatus.h application/Utils.h \
		$includeDir/chat-o-matic/

	packageEntries devel \
		$includeDir
}
