git » greetd.git » main » tree

[main] / PKGBUILD

# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Eric Engestrom <aur [at] engestrom [dot] ch>
# Contributor: Kenny Levinsen <aur [at] kl [dot] wtf>

pkgbase=greetd
pkgname=($pkgbase $pkgbase-agreety)
pkgver=0.10.0
pkgrel=2
pkgdesc='Generic greeter daemon'
arch=(armv7h)
url="https://git.sr.ht/~kennylevinsen/$pkgbase"
license=(GPL3)
depends=(gcc-libs
         glibc
         systemd)
makedepends=(cargo
             scdoc)
# optdepends=('greetd-gtkgreet: Simple GTK based greeter'
#             'greetd-dlm: Dumb Login Manager'
#             'greetd-wlgreet: Wayland greeter')
#             'greetd-tuigreet: A console UI greeter')
#             'greetd-regreet: Wayland greeter')
_archive="$pkgbase-$pkgver"
source=("$_archive.tar.gz::$url/archive/$pkgver.tar.gz"
        "$pkgbase.sysusers"
        "$pkgbase.tmpfiles"
        "$pkgbase.pam")

prepare() {
	cd "$_archive"
	cargo fetch --locked # --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd "$_archive"
	cargo build --frozen --release --all-features
	make -C man all
}

#check() {
#	cd "$_archive"
#	cargo test --frozen --all-features
#}

package_greetd() {
	# The default config uses agreety, so even though people can substitute othe packages that provide a greeter
	# we should keep the agreety dependency until installing a different one would work without manual intervention.
	depends+=("$pkgbase-agreety"
	          "$pkgbase-greeter"
	          pam)
	backup=("etc/$pkgbase/config.toml"
	        "etc/pam.d/$pkgbase")
	cd "$_archive"
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
	install -Dm0644 -t "$pkgdir/usr/lib/systemd/system/" "$pkgname.service"
	install -Dm0644 -t "$pkgdir/etc/$pkgname/" config.toml
	install -Dm0644 "../$pkgname.pam" "$pkgdir/etc/pam.d/$pkgname"
	install -Dm0644 "../$pkgname.sysusers" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"
	install -Dm0644 "../$pkgname.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/$pkgname.conf"
	make -C man DESTDIR="$pkgdir" PREFIX=/usr install
	find "$pkgdir" -type f -name '*agreety*' -delete
}

package_greetd-agreety() {
	depends=(gcc-libs
	         "$pkgbase")
	provides=("$pkgbase-greeter")
	cd "$_archive"
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/${pkgname#*-}"
	make -C man DESTDIR="$pkgdir" PREFIX=/usr install
	find "$pkgdir" -type f -name '*greetd*' -delete
}
sha256sums=('d6151a8683f386c53a010b6dfe37cf4c842bc03313bed7a917be96309372d1df'
            '73858e44c9fdae1aa1d76f9be6027c693119563577ddf0e29ef0a199d5bcf2f4'
            'f450de012c701a14b478e08e7d080098058651848aa3f627f532850ab519657e'
            '993a3096c2b113e6800f2abbd5d4233ebf1a97eef423990d3187d665d3490b92')