# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=xproto
pkgver=7.0.26
pkgrel=1
pkgdesc="X11 core wire protocol and auxiliary headers"
arch=(any)
license=('custom')
groups=('development')
url="https://xorg.freedesktop.org/"
makedepends=('util-macros')
source=(${url}/releases/individual/proto/${pkgname}-${pkgver}.tar.bz2
        0001-msysize.msys.patch)
sha256sums=('636162c1759805a5a0114a369dffdeccb8af8c859ef6e1445f26a4e6e046514f'
            '7c617a5012733c5290f74e14f73521688345e8b5ccb5747e0466834ebbad4028')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  patch -p1 -i ${srcdir}/0001-msysize.msys.patch
  autoreconf -ivf
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  ./configure --build=${CHOST} --prefix=/usr
  make
}

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

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