# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=libxtst
pkgver=1.2.5
pkgrel=1.1
pkgdesc="library for XTEST & RECORD extensions"
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url="https://gitlab.freedesktop.org/xorg/lib/libxtst"
license=('MIT-open-group'
         'HPND-sell-variant'
         'X11'
         'HPND-doc'
         'HPND-doc-sell')
depends=('libxext' 'libxi' 'libx11' 'glibc' 'xorgproto')
makedepends=('xorg-util-macros')
source=(https://xorg.freedesktop.org/releases/individual/lib/libXtst-${pkgver}.tar.xz{,.sig})
sha512sums=('848fa580d7abccd48c9ca3440f92e299839ada0912ed60d38d4d4f5bf37431cd02d7059265ab4e524c3e2cb9c368b9b90b863d1ed97d74979ef8811fc5e635a9'
            'SKIP')
#validpgpkeys=('C41C985FDCF1E5364576638B687393EE37D128F8') # Matthieu Herrb <matthieu.herrb@laas.fr>
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>

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

package() {
  cd "${srcdir}/libXtst-${pkgver}"
  make DESTDIR="${pkgdir}" install

  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/"
}
