diff --git a/srcpkgs/libdrm/patches/configure_no_pthread_stubs.diff b/srcpkgs/libdrm/patches/configure_no_pthread_stubs.diff
deleted file mode 100644
index 1fec969698..0000000000
--- a/srcpkgs/libdrm/patches/configure_no_pthread_stubs.diff
+++ /dev/null
@@ -1,99 +0,0 @@
---- configure.orig 2010-06-22 23:33:27.209859071 +0200
-+++ configure 2010-06-22 23:34:07.417853306 +0200
-@@ -11727,96 +11727,6 @@ $as_echo "no" >&6; }
- fi
- fi
-
--pkg_failed=no
--{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREADSTUBS" >&5
--$as_echo_n "checking for PTHREADSTUBS... " >&6; }
--
--if test -n "$PTHREADSTUBS_CFLAGS"; then
-- pkg_cv_PTHREADSTUBS_CFLAGS="$PTHREADSTUBS_CFLAGS"
-- elif test -n "$PKG_CONFIG"; then
-- if test -n "$PKG_CONFIG" && \
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pthread-stubs\""; } >&5
-- ($PKG_CONFIG --exists --print-errors "pthread-stubs") 2>&5
-- ac_status=$?
-- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-- test $ac_status = 0; }; then
-- pkg_cv_PTHREADSTUBS_CFLAGS=`$PKG_CONFIG --cflags "pthread-stubs" 2>/dev/null`
--else
-- pkg_failed=yes
--fi
-- else
-- pkg_failed=untried
--fi
--if test -n "$PTHREADSTUBS_LIBS"; then
-- pkg_cv_PTHREADSTUBS_LIBS="$PTHREADSTUBS_LIBS"
-- elif test -n "$PKG_CONFIG"; then
-- if test -n "$PKG_CONFIG" && \
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"pthread-stubs\""; } >&5
-- ($PKG_CONFIG --exists --print-errors "pthread-stubs") 2>&5
-- ac_status=$?
-- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-- test $ac_status = 0; }; then
-- pkg_cv_PTHREADSTUBS_LIBS=`$PKG_CONFIG --libs "pthread-stubs" 2>/dev/null`
--else
-- pkg_failed=yes
--fi
-- else
-- pkg_failed=untried
--fi
--
--
--
--if test $pkg_failed = yes; then
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
--$as_echo "no" >&6; }
--
--if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
-- _pkg_short_errors_supported=yes
--else
-- _pkg_short_errors_supported=no
--fi
-- if test $_pkg_short_errors_supported = yes; then
-- PTHREADSTUBS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "pthread-stubs" 2>&1`
-- else
-- PTHREADSTUBS_PKG_ERRORS=`$PKG_CONFIG --print-errors "pthread-stubs" 2>&1`
-- fi
-- # Put the nasty error message in config.log where it belongs
-- echo "$PTHREADSTUBS_PKG_ERRORS" >&5
--
-- as_fn_error "Package requirements (pthread-stubs) were not met:
--
--$PTHREADSTUBS_PKG_ERRORS
--
--Consider adjusting the PKG_CONFIG_PATH environment variable if you
--installed software in a non-standard prefix.
--
--Alternatively, you may set the environment variables PTHREADSTUBS_CFLAGS
--and PTHREADSTUBS_LIBS to avoid the need to call pkg-config.
--See the pkg-config man page for more details." "$LINENO" 5
--elif test $pkg_failed = untried; then
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
--$as_echo "no" >&6; }
-- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
--$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
--as_fn_error "The pkg-config script could not be found or is too old. Make sure it
--is in your PATH or set the PKG_CONFIG environment variable to the full
--path to pkg-config.
--
--Alternatively, you may set the environment variables PTHREADSTUBS_CFLAGS
--and PTHREADSTUBS_LIBS to avoid the need to call pkg-config.
--See the pkg-config man page for more details.
--
--To get pkg-config, see .
--See \`config.log' for more details." "$LINENO" 5; }
--else
-- PTHREADSTUBS_CFLAGS=$pkg_cv_PTHREADSTUBS_CFLAGS
-- PTHREADSTUBS_LIBS=$pkg_cv_PTHREADSTUBS_LIBS
-- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
--$as_echo "yes" >&6; }
--
--fi
--
--
-
- pkgconfigdir=${libdir}/pkgconfig
-
diff --git a/srcpkgs/libdrm/patches/no-pthread-stubs.patch b/srcpkgs/libdrm/patches/no-pthread-stubs.patch
new file mode 100644
index 0000000000..6602f8785e
--- /dev/null
+++ b/srcpkgs/libdrm/patches/no-pthread-stubs.patch
@@ -0,0 +1,65 @@
+diff -ru libdrm-2.4.0/configure.ac libdrm-2.4.0-nostubs/configure.ac
+--- libdrm-2.4.0/configure.ac 2008-10-09 21:57:09.000000000 +0200
++++ libdrm-2.4.0-nostubs/configure.ac 2008-10-21 10:48:24.000000000 +0200
+@@ -32,10 +32,6 @@
+ AC_HEADER_STDC
+ AC_SYS_LARGEFILE
+
+-PKG_CHECK_MODULES(PTHREADSTUBS, pthread-stubs)
+-AC_SUBST(PTHREADSTUBS_CFLAGS)
+-AC_SUBST(PTHREADSTUBS_LIBS)
+-
+ pkgconfigdir=${libdir}/pkgconfig
+ AC_SUBST(pkgconfigdir)
+ AC_ARG_ENABLE(udev, AS_HELP_STRING([--enable-udev],
+--- libdrm-2.4.16/intel/Makefile.am 2009-11-20 23:54:36.000000000 +0000
++++ libdrm-2.4.16/intel/Makefile.am.new 2009-12-07 08:11:32.235748069 +0000
+@@ -26,13 +26,12 @@
+ $(WARN_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/intel \
+- $(PTHREADSTUBS_CFLAGS) \
+ -I$(top_srcdir)/include/drm
+
+ libdrm_intel_la_LTLIBRARIES = libdrm_intel.la
+ libdrm_intel_ladir = $(libdir)
+ libdrm_intel_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+-libdrm_intel_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @CLOCK_LIB@
++libdrm_intel_la_LIBADD = ../libdrm.la @CLOCK_LIB@
+
+ libdrm_intel_la_SOURCES = \
+ intel_atomic.h \
+--- libdrm-2.4.16/radeon/Makefile.am 2009-11-20 23:54:36.000000000 +0000
++++ libdrm-2.4.16/radeon/Makefile.am.new 2009-12-07 08:12:31.889075388 +0000
+@@ -26,13 +26,12 @@
+ $(WARN_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/radeon \
+- $(PTHREADSTUBS_CFLAGS) \
+ -I$(top_srcdir)/include/drm
+
+ libdrm_radeon_la_LTLIBRARIES = libdrm_radeon.la
+ libdrm_radeon_ladir = $(libdir)
+ libdrm_radeon_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+-libdrm_radeon_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
++libdrm_radeon_la_LIBADD = ../libdrm.la
+
+ libdrm_radeon_la_SOURCES = \
+ radeon_bo_gem.c \
+--- libdrm-2.4.16/nouveau/Makefile.am 2009-11-20 23:54:36.000000000 +0000
++++ libdrm-2.4.16/nouveau/Makefile.am.new 2009-12-07 08:13:01.489072320 +0000
+@@ -2,13 +2,12 @@
+ $(WARN_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/nouveau \
+- $(PTHREADSTUBS_CFLAGS) \
+ -I$(top_srcdir)/include/drm
+
+ libdrm_nouveau_la_LTLIBRARIES = libdrm_nouveau.la
+ libdrm_nouveau_ladir = $(libdir)
+ libdrm_nouveau_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+-libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
++libdrm_nouveau_la_LIBADD = ../libdrm.la
+
+ libdrm_nouveau_la_SOURCES = \
+ nouveau_device.c \
diff --git a/srcpkgs/libdrm/patches/no-pthread-stubs.patch.args b/srcpkgs/libdrm/patches/no-pthread-stubs.patch.args
new file mode 100644
index 0000000000..2eba1cb3c5
--- /dev/null
+++ b/srcpkgs/libdrm/patches/no-pthread-stubs.patch.args
@@ -0,0 +1 @@
+-Np1
diff --git a/srcpkgs/libdrm/template b/srcpkgs/libdrm/template
index 8d8fd08c35..f58e00bd6d 100644
--- a/srcpkgs/libdrm/template
+++ b/srcpkgs/libdrm/template
@@ -1,13 +1,13 @@
# Template build file for 'libdrm'.
pkgname=libdrm
-version=2.4.21
+version=2.4.22
distfiles="http://dri.freedesktop.org/libdrm/$pkgname-$version.tar.bz2"
build_style=gnu_configure
configure_args="--enable-udev --enable-vmwgfx-experimental-api
--enable-nouveau-experimental-api"
short_desc="Userspace interface to kernel DRM services"
maintainer="Juan RP "
-checksum=4e1b612ba3b6b1deae4a8c14946099283e7a00e48a5ab002eaf4312f5a8ba14b
+checksum=0bb0e594e4094d9000d80f38e96e8f640b6364f96cfef5b970cf4481443c6b3d
long_desc="
This package provides a library which offers a userspace interface
to kernel DRM (Direct Rendering Manager) services for access to
@@ -16,6 +16,13 @@ long_desc="
subpackages="$pkgname-devel"
Add_dependency run glibc
Add_dependency run libudev
+Add_dependency build automake
Add_dependency build pkg-config
Add_dependency build glibc-devel
Add_dependency build libudev-devel
+
+pre_configure()
+{
+ cd ${wrksrc} && libtoolize -f && aclocal && autoconf && automake \
+ || return 1
+}