# SliTaz package receipt.

PACKED_SIZE="40.0K"
UNPACKED_SIZE="112.0K"
PACKAGE="libdrm"
VERSION="2.4.100"
CATEGORY="x-window"
SHORT_DESC="Freedesktop DRM Library."
MAINTAINER="pankso@slitaz.org"
LICENSE="MIT"
WEB_SITE="https://dri.freedesktop.org/"

TARBALL="$PACKAGE-$VERSION.tar.bz2"
WGET_URL="$WEB_SITE/$PACKAGE/$TARBALL"

DEPENDS="glibc-base linux-drm udev xorg-libpciaccess"
BUILD_DEPENDS="gc-dev libpthread-stubs-dev pkg-config \
	udev-dev xorg-libpciaccess-dev"
	#xorg-dev xorg-dev-proto

HOST_ARCH="i486 arm"

current_version()
{
	wget -O - $(dirname $WGET_URL) 2>/dev/null | \
	sed "/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*\".*|\\1|" | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
	./configure					\
		--enable-intel				\
		--enable-nouveau-experimental-api	\
		--enable-radeon				\
		--enable-udev				\
		--enable-vmwgfx-experimental-api	\
		$CONFIGURE_ARGS &&
	make -j 1 &&
	make install
}

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

	cp -a $install/usr/lib/libdrm.so*	$fs/usr/lib
	cp -a $install/usr/lib/libkms*.so*	$fs/usr/lib
}
