# Maintainer: Jan de Groot <jgc@archlinux.org>
# Maintainer: Andreas Radke <andyrtr@archlinux.org>

pkgname=lib32-xcb-util-keysyms
_pkgname=xcb-util-keysyms
pkgver=0.4.1
pkgrel=1
pkgdesc="Utility libraries for XC Binding - Standard X key constants and conversion to/from keycodes"
arch=('x86_64')
url="https://xcb.freedesktop.org"
license=('custom')
depends=('lib32-libxcb' $_pkgname)
makedepends=('xorg-util-macros' 'xorgproto')
source=("https://xcb.freedesktop.org/dist/${_pkgname}-${pkgver}.tar.xz")
sha512sums=('dd53a36b52647f22bf0da8cded4b2974a51899eaac799797017ed8534f14bc2d2d339a14fa5ef387ae4528b7d9a5d31920bb0c71b09ca34f58e5081e768e2bbf')

build() {
  cd ${_pkgname}-${pkgver}

  export CC='gcc -m32'
  export CXX='g++ -m32'

  export PKG_CONFIG_PATH=/usr/lib32/pkgconfig

  ./configure --prefix=/usr --libdir=/usr/lib32 --disable-static
  make
}

check() {
  cd ${_pkgname}-${pkgver}
  make check
}

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

  rm -rf "${pkgdir}"/usr/{include,share}
  mkdir -p "$pkgdir/usr/share/licenses"
  ln -s $_pkgname "$pkgdir/usr/share/licenses/$pkgname"
}
