# Maintainer: Valeria Fadeeva <valeria@fadeeva.me>

_gitname="$(basename $(pwd))"
pkgname=("$_gitname")
pkgver=1.29
pkgrel=1
pkgdesc="$(head -n 2 README.md | tail -n 1)"
url="https://git.melawy.ru/Design/$_gitname"
arch=("any")
license=("AGPL3")
depends=("kwindowsystem>=6" "gtk-update-icon-cache" "breeze-icons" "hicolor-icon-theme")
optdepends=()
makedepends=("git")
options=("!strip")
backup=()
provides=("melawy-icon-theme" "${pkgname}")
conflicts=("melawy-icon-theme" "${pkgname}")
replaces=("melawy-icon-theme")
source=("git+$url.git")
sha256sums=("SKIP")
validpgpkeys=('BC8B600E8DDA1F4CB77B10D2BA803A261A5EE6B8')

# pkgver() {
#   cd "$srcdir/Melawy-icon-theme"
#   git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
# }

# pkgver() {
# 	cd "$srcdir/$_gitname"
# 	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
# }

pkgver() {
	cd "$srcdir/$_gitname"
	printf "1.%s" "$(git rev-list --count HEAD)"
}

prepare() {
   cd "$srcdir/$_gitname"

  # Disable running gtk-update-icon-cache
  sed -i '/gtk-update-icon-cache/d' install.sh
}

package() {
  cd "$srcdir/$_gitname"
  install -d "$pkgdir/usr/share/icons"
  ./install.sh -t all -d "$pkgdir/usr/share/icons"
}
