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

_pkgname=libxext
pkgname=static-compat-$_pkgname
pkgver=1.3.4
pkgrel=3
pkgdesc="X11 miscellaneous extensions library"
arch=('x86_64')
url="https://xorg.freedesktop.org/"
license=('custom')
depends=('static-compat-libx11')
makedepends=('xorg-util-macros' 'static-compat-xorgproto' 'static-compat-configure')
options=(!emptydirs staticlibs)
source=(${url}/releases/individual/lib/libXext-${pkgver}.tar.bz2{,.sig})
sha512sums=('09146397d95f80c04701be1cc0a9c580ab5a085842ac31d17dfb6d4c2e42b4253b89cba695e54444e520be359883a76ffd02f42484c9e2ba2c33a5a40c29df4a'
            'SKIP')
validpgpkeys=('3C2C43D9447D5938EF4551EBE23B7E70B467F0BF') # "Peter Hutterer (Who-T) <office@who-t.net>"
validpgpkeys+=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # Alan Coopersmith <alan.coopersmith@oracle.com>

build() {
  source static-compat-environment
  cd libXext-${pkgver}
  static-compat-configure --sysconfdir=/etc --disable-shared --enable-static
  make
}

package() {
  source static-compat-environment
  cd libXext-${pkgver}
  make DESTDIR="${pkgdir}" install
  rm -r "$pkgdir/$static_compat_prefix"/share/{doc,man}

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