# Depends on: xorg-libxrandr gdk-pixbuf mesa xorg-glu pango xorg-libdrm gobject-introspection

description="An object oriented GL/GLES Abstraction/Utility Layer"
url="http://www.gnome.org/"
packager="tnut <tnut@nutyx.org>"
contributors="Pierre B"
name=cogl
version=1.22.2
release=3

source=(http://ftp.gnome.org/pub/gnome/sources/$name/${version%.*}/$name-$version.tar.xz)

build() {
unset MAKEFLAGS

cd $name-$version

sed -i 's/^#if COGL/#ifdef COGL/' cogl/winsys/cogl-winsys-egl.c

./configure --prefix=/usr \
--enable-gles{1,2} \
--enable-{kms,wayland,xlib}-egl-platform \
--enable-wayland-egl-server
make
make DESTDIR=$PKG install
rm $PKG/usr/lib/{libcogl,libcogl-path,libcogl-pango,libcogl-gles2}.la
}
uptodate(){
local latest lastversion url
url="http://ftp.gnome.org/pub/gnome/sources/$name"
latest="`lynx -read_timeout=20 -dump -listonly -nonumbers \
$url/?C=N\;O=D|grep [0-9]/$|head -1`"
lastversion="`lynx -read_timeout=20 -dump -listonly -nonumbers \
$latest/?C=N\;O=D|grep LATEST|grep [0-9]$|cut -d "-" -f3`"
echo "$lastversion"
}
