# Contributor: fossdd <fossdd@pwned.life>
maintainer="fossdd <fossdd@pwned.life>"
pkgname=decibels
pkgver=46.0
_gi_ts_def_commit="dbbaa0527556cd3ce5434c4a5072cd99348eff7a"
pkgrel=1
pkgdesc="Play audio files"
url="https://gitlab.gnome.org/GNOME/Incubator/decibels"
arch="noarch !armhf" # armhf: gjs -> mozjs
license="GPL-3.0-or-later"
depends="
	gjs
	gtk4.0
	libadwaita
"
makedepends="
	meson
	gtk4.0-dev
	libadwaita-dev
	gjs-dev
	typescript
	blueprint-compiler
	desktop-file-utils
	gobject-introspection-dev
	"
subpackages="$pkgname-lang"
source="https://gitlab.gnome.org/GNOME/Incubator/decibels/-/archive/$pkgver/decibels-$pkgver.tar.gz
	https://gitlab.gnome.org/BrainBlasted/gi-typescript-definitions/-/archive/$_gi_ts_def_commit/gi-typescript-definitions-$_gi_ts_def_commit.tar.gz
	"

prepare() {
	default_prepare

	mv "$srcdir"/gi-typescript-definitions-$_gi_ts_def_commit/* "$builddir"/gi-types
}

build() {
	abuild-meson \
		output .
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output

	ln -s org.gnome.Decibels "$pkgdir"/usr/bin/decibels
}

sha512sums="
95e4f443b0374eeb29f64116caec1bbd2b5aaf2fb150c80e919683e04cb72497e25a2b2373b3410f3a355ed9bec8f90a196b4b8227028389afcccc4144f5472f  decibels-46.0.tar.gz
ea2f60aa45085f26acc769b2adc622bbc311a3317a4fd49e6452ba0e21b0cbefe0f489bc055d4a6c439c2863010acbc71a26025c89e6b53b68a633aad13bf6f1  gi-typescript-definitions-dbbaa0527556cd3ce5434c4a5072cd99348eff7a.tar.gz
"
