# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=adwaita-icon-theme
pkgname=(
  adwaita-icon-theme
  adwaita-cursors
)
pkgver=46.2
pkgrel=1
pkgdesc="GNOME standard icons"
url="https://gitlab.gnome.org/GNOME/adwaita-icon-theme"
arch=(any)
license=("CC-BY-SA-3.0 OR LGPL-3.0-only")
depends=(
  adwaita-icon-theme-legacy
  hicolor-icon-theme
)
makedepends=(
  git
  gtk-update-icon-cache
  meson
)
source=("git+https://gitlab.gnome.org/GNOME/adwaita-icon-theme.git#tag=${pkgver/[a-z]/.&}")
b2sums=('566e62a532aa3ce27ca940d327f6e07896dda385a65904a972a29cd3bd2a3fdb39f046d24130abe7f923165f414f660cf6ea84ff233ca45da2f91e5953a113a6')

prepare() {
  cd $pkgbase
}

build() {
  arch-meson $pkgbase build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package_adwaita-icon-theme() {
  depends+=(adwaita-cursors)

  meson install -C build --destdir "$pkgdir"

  # Split cursors
  mkdir -p cursors/usr/share/icons/Adwaita
  mv {"$pkgdir",cursors}/usr/share/icons/Adwaita/cursors

  # Covered by common licenses
  rm -r "$pkgdir/usr/share/licenses"
}

package_adwaita-cursors() {
  pkgdesc="GNOME standard cursors"
  depends=()

  mv cursors/* "$pkgdir"

  # deduplicate cursors
  hardlink -c "$pkgdir/usr"
}

# vim:set sw=2 sts=-1 et:
