summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1ebef2de621620157dcf0fcbd5e86dbaad3b22e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Maintainer: Harish Rajagopal <harish dot rajagopals at gmail dot com>

_pkgname=regreet
pkgname="greetd-$_pkgname-git"
pkgver=0.1.1.r0.0fb4245
pkgrel=1
pkgdesc="Clean and customizable greeter for greetd"
arch=('x86_64')
url="https://github.com/rharish101/ReGreet"
license=(GPL3)
install="$pkgname.install"
source=("$_pkgname::git+$url.git")
sha256sums=('SKIP')
makedepends=(cargo git)
depends=(greetd gtk4)
provides=(greetd-greeter)
conflicts=("greetd-$_pkgname")
replaces=(regreet-git)

pkgver() {
    cd "$_pkgname"
	printf "%s" "$(git describe --long | sed 's/\([^-]*-\)g/r\1/;s/-/./g')"
}

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

build() {
    cd "$_pkgname"

    export RUSTUP_TOOLCHAIN=stable
    export GREETD_CONFIG_DIR="/etc/greetd"
    export CACHE_DIR="/var/cache/${_pkgname}"
    export LOG_DIR="/var/log/${_pkgname}"
    export SESSION_DIRS="/usr/share/xsessions:/usr/share/wayland-sessions"
    cargo build --frozen --release --all-features --target-dir=target
}

package() {
    cd "$_pkgname"
    install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$_pkgname"
    install -Dm0644 -t "$pkgdir/usr/share/doc/$_pkgname/" "$_pkgname.sample.toml"
    install -Dm0644 "systemd-tmpfiles.conf" "$pkgdir/usr/lib/tmpfiles.d/$_pkgname.conf"
}