SUMMARY="Library for creating CORBA Interface Definition Language files"
DESCRIPTION="libIDL is a library for creating trees of CORBA Interface \
Definition Language (IDL) files, which is a specification for defining \
portable interfaces. libIDL was initially written for ORBit (the ORB from \
the GNOME project, and the primary means of libIDL distribution). However, \
the functionality was designed to be as reusable and portable as possible."
HOMEPAGE="https://github.com/GNOME/libIDL/"
COPYRIGHT="1998-1999 Andrew T. Veliath"
LICENSE="GNU LGPL v2"
REVISION="5"
SOURCE_URI="http://ftp.gnome.org/pub/gnome/sources/libIDL/0.8/libIDL-$portVersion.tar.gz"
CHECKSUM_SHA256="bca99570f1ab453e11ae627b209561019cde5aaa98f71f43cc6da048d3bc7e72"
SOURCE_DIR="libIDL-$portVersion"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libidl$secondaryArchSuffix = $portVersion
	lib:libIDL_2$secondaryArchSuffix = 0.0.0 compat >= 0
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libiconv$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	"

PROVIDES_devel="
	libidl${secondaryArchSuffix}_devel = $portVersion
	cmd:libIDL_config_2$secondaryArchSuffix = $portVersion
	devel:libIDL_2$secondaryArchSuffix = 0.0.0 compat >= 0
	"
REQUIRES_devel="
	libidl$secondaryArchSuffix == $portVersion
	"

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

defineDebugInfoPackage libIDL$secondaryArchSuffix \
	"$libDir"/libIDL-2.so.0.0.0

BUILD()
{
	autoreconf -vfi
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	# remove libtool files
	rm "$libDir"/*.la

	prepareInstalledDevelLibs libIDL-2
	fixPkgconfig

	fixDevelopLibDirReferences "$binDir"/libIDL-config-2

	packageEntries devel \
		"$developDir" "$binDir" "$infoDir"
}
