# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libxcb
pkgver=1.17.0
pkgrel=1
pkgdesc="X11 client-side library"
arch=('x86_64')
url="https://gitlab.freedesktop.org/xorg/lib/libxcb"
depends=('xcb-proto' 'libxdmcp' 'libxau' 'glibc')
makedepends=('libxslt' 'python' 'xorg-util-macros' 'xorgproto')
license=('X11')
source=(https://xorg.freedesktop.org/archive/individual/lib/$pkgname-$pkgver.tar.xz{,.sig})
sha512sums=('945b1f28e8b407a4d0ebf88c99ef3cbef763fd75e6eaa8e971946e44ce8dbe9b478c56ae85aaaadab7fdb25987e88570d9d4fb9ad2febd6d6bf21d644a0e10d0'
            'SKIP')

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr \
    --enable-xinput \
    --enable-xkb \
    --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

check() {
  cd $pkgname-$pkgver
  make -k check
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  install -m755 -d "$pkgdir/usr/share/licenses/$pkgname"
  install -m644 COPYING "$pkgdir/usr/share/licenses/$pkgname"
}
