# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=pangox-compat
pkgver=0.0.2+2+gedb9e09
pkgrel=3
pkgdesc="X Window System font support for Pango"
arch=('x86_64')
license=('LGPL')
depends=('pango')
makedepends=(git)
_commit=edb9e0904d04d1da02bba7b78601a2aba05aaa47  # master
source=("git+https://gitlab.gnome.org/Archive/pangox-compat#commit=$_commit"
        0001-Re-add-pango_x_get_shaper_map-it-is-still-used-in-th.patch)
url="http://www.pango.org/"
sha256sums=('SKIP'
            'd5aad903439ede05b866c9a2962f293bec4897f07d5a7b07ebc5aa99eeb27e48')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname
  patch -Np1 -i ../0001-Re-add-pango_x_get_shaper_map-it-is-still-used-in-th.patch
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname

  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

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