# SliTaz package receipt.

PACKED_SIZE="372.0K"
UNPACKED_SIZE="1.0M"
PACKAGE="cairo"
VERSION="1.14.4"
CATEGORY="x-window"
SHORT_DESC="2D graphics library"
MAINTAINER="pankso@slitaz.org"
LICENSE="MPL LGPL2.1"
TARBALL="$PACKAGE-$VERSION.tar.xz"
WEB_SITE="https://www.cairographics.org/"
WGET_URL="${WEB_SITE}releases/$TARBALL"
HOST_ARCH="i486 arm"

DEPENDS="bzlib fontconfig freetype glib glibc-base harfbuzz libffi libpng \
libxcb libxml2 pcre pixman xorg-libX11 xorg-libXau xorg-libXdmcp xorg-libXext \
xorg-libXrender zlib"
BUILD_DEPENDS="pkg-config glib-dev libpng-dev zlib-dev fontconfig-dev \
freetype-dev xorg-libX11-dev pixman-dev xorg-libXau-dev xorg-libXdmcp-dev \
xorg-libXrender-dev xcb-util-dev libxcb-dev expat-dev libxml2-dev"
SPLIT="cairo-tools"
SIBLINGS="cairo-gl"

# Handle cross compilation
case "$ARCH" in
	arm*) export CFLAGS="$CFLAGS -L/cross/$ARCH/sysroot/usr/lib" ;;
esac

# Rules to configure and make the package.
compile_rules()
{
	./configure \
		--prefix=/usr \
		--enable-xcb \
		--enable-xlib-xcb \
		--enable-tee \
		--disable-static \
		$CONFIGURE_ARGS &&
	make $MAKEFLAGS &&
	make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/lib
	cp -a $install/usr/lib/*.so* $fs/usr/lib
}
