# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>

_realname=tslib
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.24
pkgrel=1
pkgdesc="Touchscreen Access Library (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://github.com/kergoth/tslib"
license=('spdx:LGPL-2.1-only')
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools"
             "${MINGW_PACKAGE_PREFIX}-cc")
source=("https://github.com/kergoth/tslib/releases/download/${pkgver}/${_realname}-${pkgver}.tar.xz")
sha256sums=('58d9941ffaa269c399f00d0d308184c96087f7acf69aa8e3c6645e852f993ba2')

build() {
  mkdir -p "build-${MSYSTEM}" && cd "build-${MSYSTEM}"

  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --target=${MINGW_CHOST} \
    --sysconfdir=${MINGW_PREFIX}/etc \
    --enable-static \
    --enable-shared \
    --disable-input \
    --disable-touchkit \
    --disable-waveshare
    
  make
}

package() {
  cd "build-${MSYSTEM}"
  make install DESTDIR="${pkgdir}"
}
