# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=libxcb
pkgver=%version%
pkgrel=%release%
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=('e3afdae1c0e2a5ae2add7b2c4fdd3283cb86023ef6448f5b8b29a4bb72c274e34eaf0fc7523762bcd3f5116910fe7374490e8f26c25744301563ced80acc3e7f'
            'SKIP')
#validpgpkeys=('A66D805F7C9329B4C5D82767CCC4F07FAC641EFF') # "Daniel Stone <daniels@collabora.com>"
#validpgpkeys=('3BB639E56F861FA2E86505690FDD682D974CA72A') # "Matt Turner <mattst88@gmail.com>"
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # "Alan Coopersmith <alan.coopersmith@oracle.com>"

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"
}
