# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=deepin-cogl
pkgver=1.22.5
pkgrel=2
pkgdesc="An object oriented GL/GLES Abstraction/Utility Layer for Deepin"
arch=('x86_64')
url="https://github.com/linuxdeepin/deepin-cogl"
license=('GPL2')
depends=('mesa' 'libdrm' 'libxext' 'libxdamage' 'libxcomposite' 'gdk-pixbuf2' 'pango' 'libxrandr')
makedepends=('gobject-introspection' 'git' 'gtk-doc')
provides=("cogl=$pkgver")
conflicts=("cogl")
options=(!emptydirs)
source=("git+https://github.com/linuxdeepin/deepin-cogl.git#tag=$pkgver")
sha512sums=('SKIP')

prepare() {
  cd $pkgname

  sed -e 's|1.15|1.16 1.15|' -i autogen.sh # Support automake 1.16
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  ./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 -j1
}

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

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