# $Id$
# Maintainer: Oscar Fuentes <ofv@wanadoo.es>
# Based on Arch's PKGBUILD

_realname=tcllib
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.0
pkgrel=1
pkgdesc="Set of pure-Tcl extensions (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://core.tcl.tk/tcllib/"
license=('bsd')
depends=("${MINGW_PACKAGE_PREFIX}-tcl")
source=(https://core.tcl-lang.org/tcllib/uv/tcllib-${pkgver}.tar.gz)
sha256sums=('590263de0832ac801255501d003441a85fb180b8ba96265d50c4a9f92fde2534')

package(){
  cd "${srcdir}"/tcllib-${pkgver}
  tclsh installer.tcl \
    -pkg-path "${pkgdir}"${MINGW_PREFIX}/lib/tcllib${pkgver} \
    -app-path "${pkgdir}"${MINGW_PREFIX}/bin \
    -nroff-path "${pkgdir}"${MINGW_PREFIX}/share/man/mann \
    -no-examples \
    -no-html \
    -no-wait \
    -no-gui
  mkdir -p "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/
  cp license.terms "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/COPYING
  rm -f $pkgdir${MINGW_PREFIX}/share/man/mann/{try,string,variable,zlib,coroutine}.n
}
