# Maintainer: Chih-Hsuan Yen <yan121215@archlinux.org>
# Contributor: Ye Jingchen <ye.jingchen@gmail.com>

pkgname=capitaine-cursors
pkgver=3
pkgrel=2
pkgdesc="An x-cursor theme inspired by macOS and based on KDE Breeze"
arch=(any)
url="https://github.com/keeferrourke/capitaine-cursors"
license=(LGPL3)
source=("$pkgname-$pkgver.tar.gz::https://github.com/keeferrourke/$pkgname/archive/r$pkgver.tar.gz")
makedepends=(inkscape xorg-xcursorgen)
sha256sums=('226258d7d07648c27d8ecfb2085a1af4bcc37e49df497fcd371950f7c42ae090')

prepare() {
  cd $pkgname-r$pkgver
  # Remove prebuilt assets
  rm -rf dist/
}

build() {
  cd $pkgname-r$pkgver
  bash -e ./build.sh
}

package() {
  cd $pkgname-r$pkgver
  install -Ddm755 "$pkgdir/usr/share/icons"
  cp -dr --no-preserve=ownership dist/ "$pkgdir/usr/share/icons/capitaine-cursors"
  # inconsistency naming in upstream releases...
  # https://github.com/keeferrourke/capitaine-cursors/releases
  cp -dr --no-preserve=ownership dist-white/ "$pkgdir/usr/share/icons/capitaine-cursors-light"
}
