summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 99a227cd976af133c569b3926e760046bdd388f5 (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
47
48
49
50
51
52
53
# Maintainer: Natty4 <natty.sh.git at gmail dot com>
pkgname="wleave-git"
pkgver=0.3.0.r0.ge2a7f50
pkgrel=1
pkgdesc="A Wayland-native logout menu, fork of Wlogout"
arch=("x86_64")
license=("MIT")
url="https://github.com/AMNatty/wleave"
source=("${pkgname}::git+${url}?signed")
validpgpkeys=('4F9434A2EAC21BEC148F3656BF6CB659ADEE60EC')
sha1sums=('SKIP')
makedepends=("cargo" "git" "scdoc")
depends=("gtk3" "gtk-layer-shell")
optdepends=("swaylock: default buttons"
            "systemd: default buttons")
backup=("etc/wleave/"{"style.css","layout"})

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

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

build() {
    scdoc < "${srcdir}/${pkgname}/man/wleave.1.scd" | gzip > "${srcdir}/${pkgname}/wleave.1.gz"
    scdoc < "${srcdir}/${pkgname}/man/wleave.5.scd" | gzip > "${srcdir}/${pkgname}/wleave.5.gz"

    cd "${srcdir}/${pkgname}"

    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    make wleave
}

package() {
    install -Dm755 "$srcdir/$pkgname/target/release/wleave" "$pkgdir/usr/bin/wleave"
    install -Dm644 "$srcdir/$pkgname/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

    install -Dm644 -t "$pkgdir/etc/wleave" "$srcdir/$pkgname/"{"style.css","layout"}

    install -Dm644 "$srcdir/$pkgname/completions/wleave.bash" "$pkgdir/usr/share/bash-completion/completions/wleave"
    install -Dm644 "$srcdir/$pkgname/completions/_wleave" "$pkgdir/usr/share/zsh/site-functions/_wleave"
    install -Dm644 "$srcdir/$pkgname/completions/wleave.fish" "$pkgdir/usr/share/fish/vendor_completions.d/wleave.fish"

    install -Dm644 -t "$pkgdir/usr/share/wleave/icons" "$srcdir/$pkgname/icons"/*

    install -Dm644 -t "$pkgdir/usr/share/man/man1" "${srcdir}/${pkgname}/wleave.1.gz"
    install -Dm644 -t "$pkgdir/usr/share/man/man5" "${srcdir}/${pkgname}/wleave.5.gz"
}