# Maintainer: Sainnhe Park <sainnhe@gmail.com>

#Included in Slint by Didier Spaier didieratslintdotfr
pkgname=posy-cursors
pkgver=1.6
pkgrel=1slint
slackdesc="$pkgname (Posy's improved cursors by Michiel de Boer)"
docs=("Posy*png" "README.html")
options=("nosrcpack")
url="https://github.com/simtrami/posy-improved-cursor-linux"
license=(unknown)
source=("https://github.com/simtrami/posy-improved-cursor-linux/archive/refs/tags/${pkgver}.tar.gz")
provides=('posy-cursors')
conflicts=('posy-cursors')
sha256sums=('4bc7c3bc7448035568364b68ce95ee612889d57542b649ef7131eba851d326ea')
doinst() {
	if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

if [ -e usr/share/glib-2.0/schemas ]; then
  if [ -x /usr/bin/glib-compile-schemas ]; then
    /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1
  fi
fi
}
build() {
  cd "posy-improved-cursor-linux-${pkgver}"
[ -f README.md ] && pandoc -f gfm -t html5 -o README.html README.md
  install -Ddm755 "${PKG}/usr/share/icons"
  for variant in Posy* ; do
    cp -dr --no-preserve=ownership "${variant}" "${PKG}/usr/share/icons/"
    mkdir -p $PKG/usr/doc/$pkgname-$pkgver
    cp -a readme_files $PKG/usr/doc/$pkgname-$pkgver || exit
  done
}
