# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=libx11
pkgver=1.8.9
pkgrel=1
pkgdesc="X11 client-side library"
arch=(x86_64)
url="https://gitlab.freedesktop.org/xorg/lib/libx11"
# keep xorgproto runtime dependency
# https://lists.archlinux.org/pipermail/arch-dev-public/2019-December/029767.html
depends=('libxcb' 'glibc' 'xorgproto')
makedepends=('xorg-util-macros' 'xtrans')
license=('MIT AND X11')
source=(https://xorg.freedesktop.org//releases/individual/lib/libX11-${pkgver}.tar.xz{,.sig})
sha512sums=('737af91818537295ac86be601b1e3d7e37d150716ec549580913b7cc9a44fee7a6ce9dbc3d46167eed91f23fe857c4dd355ed8f8440fe5fbbf8e9ebe47091b96'
            'SKIP')

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

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

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

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