# $Id: PKGBUILD 213665 2014-05-27 21:44:20Z jgc $
# Maintainer: Ionut Biru <ibiru@archlinux.org>

pkgname=cogl
pkgver=1.18.0
pkgrel=2
pkgdesc="An object oriented GL/GLES Abstraction/Utility Layer"
arch=('i686' 'x86_64')
url="http://www.clutter-project.org/"
license=('GPL2')
depends=('mesa' 'libdrm' 'libxext' 'libxdamage' 'libxcomposite' 'gdk-pixbuf2' 'pango' 'libxrandr')
makedepends=('gobject-introspection')
options=(!emptydirs)
source=(http://ftp.gnome.org/pub/gnome/sources/$pkgname/${pkgver:0:4}/$pkgname-$pkgver.tar.xz
        git-fixes.patch)
sha256sums=('a4d91ebf7e7aba362eb5c6e4ffebbf1167ff4ac87fabae104912d879a5390f5e'
            '40f8cd44858e8e604248c1a1c86b1f499ba15562102bf5974401369961d82849')

prepare() {
  cd $pkgname-$pkgver
  patch -Np1 -i ../git-fixes.patch
}

build() {
  cd $pkgname-$pkgver
  ./configure --prefix=/usr \
    --enable-gles{1,2} \
    --enable-{kms,wayland}-egl-platform \
    --enable-wayland-egl-server

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

  make
}

package() {
  cd $pkgname-$pkgver
  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:
