summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ef35eb594dad023ce53b33ffc2098921228d0c4d (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
# Original Author: Firegem <mrfiregem [at] protonmail [dot] ch>
# Maintainer: Rolv Apneseth <rolv.apneseth [at] gmail [dot] com>

pkgname=wpaperd-git
pkgver=r222.204b1c5
pkgrel=2
pkgdesc='Wallpaper daemon for Wayland.'
arch=('x86_64')
url='https://github.com/danyspin97/wpaperd'
license=('GPL3')
depends=('libxkbcommon' 'wayland' 'mesa')
makedepends=('cargo' 'scdoc' 'git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("${pkgname}::git+${url}.git")
md5sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}" || exit
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "${srcdir}/${pkgname}" || exit
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo fetch --locked --target "${CARCH}-unknown-linux-gnu"
}

build() {
    cd "${srcdir}/${pkgname}" || exit
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --frozen --release
    scdoc <man/wpaperd-output.5.scd >target/release/wpaperd-output.5
}

package() {
    cd "${srcdir}/${pkgname}" || exit
    # Daemon
    install -Dm0755 -t "${pkgdir}/usr/bin" "target/release/${pkgname%-git}"
    # CLI
    install -Dm0755 -t "${pkgdir}/usr/bin" "target/release/wpaperctl"
    # Doc
    install -Dm0644 -t "${pkgdir}/usr/share/man/man5" target/release/wpaperd-output.5
}