SUMMARY="Library for the Render Extension to the X11 protocol"
DESCRIPTION="The Xrender library is designed as a lightweight library \
interface to the Render extension."
HOMEPAGE="https://www.x.org/releases/individual/lib/"
COPYRIGHT="2000 SuSE, Inc
	2001-2003 Keith Packard"
LICENSE="libXrender"
REVISION="5"
SOURCE_URI="https://www.x.org/releases/individual/lib/libXrender-$portVersion.tar.bz2"
CHECKSUM_SHA256="c06d5979f86e64cabbde57c223938db0b939dff49fdb5a793a1d3d0396650949"
SOURCE_DIR="libXrender-$portVersion"

ARCHITECTURES="all"
SECONDARY_ARCHITECTURES="x86"

libVersion="1.3.0"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

# server-interfacing: needs libX11_xcb.

PROVIDES="
	libxrender$secondaryArchSuffix = $portVersion
	lib:libXrender$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libX11_xcb$secondaryArchSuffix
	"

PROVIDES_devel="
	libxrender${secondaryArchSuffix}_devel = $portVersion
	devel:libXrender$secondaryArchSuffix = $libVersion
	"
REQUIRES_devel="
	libxrender$secondaryArchSuffix == $portVersion base
	devel:libX11_xcb$secondaryArchSuffix
	devel:renderproto
	devel:xproto
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libX11_xcb$secondaryArchSuffix
	devel:util_macros
	"
BUILD_PREREQUIRES="
	cmd:aclocal
	cmd:autoconf
	cmd:gcc$secondaryArchSuffix
	cmd:libtoolize$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

defineDebugInfoPackage libxrender$secondaryArchSuffix \
	$libDir/libXrender.so.$libVersion

BUILD()
{
	autoreconf -vfi
	runConfigure --omit-dirs docDir ./configure --docdir "$developDocDir"
	make $jobArgs
}

INSTALL()
{
	make install

	if [ -z "$secondaryArchSuffix" ]; then
		install -d "$developDocDir"
		install -t "$developDocDir" README
	else
		rm -rf "$developDir/documentation"
	fi

	rm -f $libDir/*.la

	prepareInstalledDevelLib libXrender
	fixPkgconfig

	# devel package
	packageEntries devel \
		$developDir
}
