# ABOUTME: AUR PKGBUILD for Moongreet — greetd greeter for Wayland.
# ABOUTME: Builds from local source, installs config and cache directory.

# Maintainer: Dominik Kressler

pkgname=moongreet
pkgver=0.1.0
pkgrel=1
pkgdesc="A greetd greeter for Wayland, built with Python + GTK4 + gtk4-layer-shell"
arch=('any')
license=('MIT')
depends=(
    'python'
    'python-gobject'
    'gtk4'
    'gtk4-layer-shell'
    'greetd'
)
makedepends=(
    'python-build'
    'python-installer'
    'python-hatchling'
)
install=moongreet.install
source=("$pkgname-$pkgver.tar.gz")
sha256sums=('SKIP')

build() {
    cd "$srcdir/$pkgname-$pkgver"
    python -m build --wheel --no-isolation
}

package() {
    cd "$srcdir/$pkgname-$pkgver"
    python -m installer --destdir="$pkgdir" dist/*.whl

    # Example config
    install -Dm644 config/moongreet.toml "$pkgdir/etc/moongreet/moongreet.toml"

    # Cache directory
    install -dm755 "$pkgdir/var/cache/moongreet"
}
