# Maintainer: Jiachen YANG <farseerfc@archlinux.org>
# Contributor: xyzzy <628208@gmail.com>

pkgname=flameshot
pkgver=0.10.1
pkgrel=1
pkgdesc="Powerful yet simple to use screenshot software"
arch=('x86_64')
url="https://github.com/flameshot-org/flameshot"
license=('GPL')
depends=('qt5-svg' 'hicolor-icon-theme')
makedepends=('make' 'qt5-tools' 'cmake')
optdepends=('gnome-shell-extension-appindicator: for system tray icon if you are using Gnome')
source=("${pkgname}-v${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
sha256sums=('c2d760345d78dd5d2488c6bea54cb10870b09772179f33594a33c8f62ccdeeb9')

prepare() {
  cd "${srcdir}/${pkgname}-${pkgver}"
}

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"
  mkdir build
  cd build
  cmake .. -DCMAKE_INSTALL_PREFIX=/usr
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}/build"
  make DESTDIR="${pkgdir}" install
  
  # zsh _flameshot completion is provided by zsh-completions so exclude from packaging
  rm -rf ${pkgdir}/usr/share/zsh/
}
