# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>

pkgname=gnome-shell-extensions
pkgver=3.34.0
pkgrel=1
pkgdesc="Extensions for GNOME shell, including classic mode"
url="https://wiki.gnome.org/Projects/GnomeShell/Extensions"
arch=(any)
license=(GPL)
makedepends=(meson git sassc js60)
optdepends=('gnome-menus: applications menu extension')
groups=(gnome)
_commit=4ad50ab0354b7056c24e85aa190ce902ee375eda  # tags/3.34.0^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-shell-extensions.git#commit=$_commit"
        "git+https://gitlab.gnome.org/GNOME/gnome-shell-sass.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd $pkgname

  git submodule init
  git config --local submodule.data/gnome-shell-sass.url "$srcdir/gnome-shell-sass"
  git submodule update
}

build() {
  arch-meson $pkgname build -D extension_set=all -D classic_mode=true
  ninja -C build
}

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

package() {
  depends=(gnome-shell)

  DESTDIR="$pkgdir" meson install -C build
}
