# Maintainer: Tobi Lütke <tobi@shopify.com>

pkgname=disktree-bin
_name=disktree
pkgver=0.10.1
pkgrel=1
pkgdesc="Disk space treemap for Omarchy: see what fills a disk by kind, mark what should go, and remove it"
arch=('x86_64' 'aarch64')
url="https://github.com/tobi/disktree"
license=('MIT')
depends=('glibc' 'libgcc' 'libxcb' 'libxkbcommon' 'libxkbcommon-x11' 'wayland' 'libglvnd' 'vulkan-icd-loader')
optdepends=('trash-cli: move to the trash with trash-put (gio or a built-in XDG trash otherwise)'
            'git: changes, stashes and unpushed commits of a selected checkout')
provides=("$_name")
conflicts=("$_name")
options=('!debug')
source_x86_64=("$url/releases/download/v$pkgver/$_name-$pkgver-x86_64-linux.tar.gz")
source_aarch64=("$url/releases/download/v$pkgver/$_name-$pkgver-aarch64-linux.tar.gz")
sha256sums_x86_64=('838a5b7085dfd5532070cadade68ca5cfa4e61809188211a5c890412e201a113')
sha256sums_aarch64=('e4927a4935736ffba9ba034ea63ecf3e2bac74bbf60721759fdf7446f6aa1d3d')

package() {
  cd "$_name-$pkgver-$CARCH-linux"
  install -Dm755 "$_name" "$pkgdir/usr/bin/$_name"
  install -dm755 "$pkgdir/usr/share/applications"
  sed -e 's|@BINDIR@/||' -e "s|@VERSION@|$pkgver|" "$_name.desktop.in" \
    > "$pkgdir/usr/share/applications/$_name.desktop"
  chmod 644 "$pkgdir/usr/share/applications/$_name.desktop"
  install -Dm644 "$_name.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/$_name.svg"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}
