SUMMARY="GTK+ & GNOME Accessibility Toolkit"
DESCRIPTION="Provides the set of accessibility interface that are implemented \
by other toolkits and applications.  Using the ATK interfaces, accessibility \
tools have full access to view and control running applications."
HOMEPAGE="https://developer.gnome.org/atk/"
COPYRIGHT="2001-2003, 2006-2007 Sun Microsystems Inc.
	2009 Novell, Inc.
	2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
	2012-2018 ATK Team
	2014 SUSE LLC."
LICENSE="GNU LGPL v2"
REVISION="1"
SOURCE_URI="https://ftp.gnome.org/pub/GNOME/sources/atk/${portVersion%.*}/atk-$portVersion.tar.xz"
CHECKSUM_SHA256="cd3a1ea6ecc268a2497f0cd018e970860de24a6d42086919d6bf6c8e8d53f4fc"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="?x86_gcc2 x86"

libVersion="0.22810.1"
libVersionCompat="$libVersion compat >= 0"

PROVIDES="
	atk$secondaryArchSuffix = $portVersion
	lib:libatk_1.0$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	cmd:gettext$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libgobject_2.0$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	"

PROVIDES_devel="
	atk${secondaryArchSuffix}_devel = $portVersion
	devel:libatk_1.0$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	atk$secondaryArchSuffix == $portVersion base
	haiku${secondaryArchSuffix}_devel
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libglib_2.0$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:autoconf
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	cmd:python2
	"

defineDebugInfoPackage atk$secondaryArchSuffix \
	"$libDir"/libatk-1.0.so.$libVersion

BUILD()
{
	runConfigure ./configure
	make
}

INSTALL()
{
	make install

	rm $libDir/libatk-1.0.la

	prepareInstalledDevelLib libatk-1.0
	fixPkgconfig

	if [ -n "$secondaryArchSuffix" ]; then
		rm -rf $dataDir/gtk-doc
	fi

	packageEntries devel \
		$developDir
}

TEST()
{
	make check
	cd tests
	./teststateset
	./testrelation
	./testrole
	./testvalue
	./testdocument
}
