makedepends=(xorg-libxrandr gdk-pixbuf libglvnd mesa xorg-glu pango xorg-libdrm gobject-introspection xorg-libxcomposite xorg-libxdamage)

description="An object oriented GL/GLES Abstraction/Utility Layer"
url="http://www.gnome.org/"

packager="Great-OS Team"
maintainer="rems"

name=cogl
version=1.22.8
release=3

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

build() {
unset MAKEFLAGS

cd $name-$version

# Do not build examples
sed -e "s/^\(SUBDIRS +=.*\)examples\(.*\)$/\1\2/" \
	-i Makefile.am Makefile.in

#if ! use test ; then
# For some reason the configure switch will not completely disable
# tests being built
sed -e "s/^\(SUBDIRS =.*\)test-fixtures\(.*\)$/\1\2/" \
	-e "s/^\(SUBDIRS +=.*\)tests\(.*\)$/\1\2/" \
	-e "s/^\(.*am__append.* \)tests\(.*\)$/\1\2/" \
	-i Makefile.am Makefile.in
#fi

./configure --prefix=/usr \
            --disable-examples-install \
            --disable-maintainer-flags \
            --enable-gles2 \
            --enable-{kms,wayland}-egl-platform \
            --enable-wayland-egl-server \
            --disable-unit-tests \
            --disable-profile

# https://bugzilla.gnome.org/show_bug.cgi?id=655517
sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

make
make DESTDIR=$PKG install
}

