summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 88d738e6fb7a5f5573562ae5490f4622dffb07a0 (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
54
55
56
57
58
59
60
# Maintainer: willemw <willemw12@gmail.com>
# Contributor: Grzegorz Koperwas <admin@grzegorzkoperwas.site>

pkgname=swww-git
pkgver=0.9.5.r183.g3e2e2ba
pkgrel=1
pkgdesc='Efficient animated wallpaper daemon for Wayland, controlled at runtime'
#arch=(x86_64)
arch=(x86_64 aarch64)
url=https://github.com/LGFae/swww
license=(GPL-3.0-or-later)
makedepends=(cargo git scdoc)
depends=(libxkbcommon lz4)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=(!lto)
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

pkgver() {
  git -C $pkgname describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd $pkgname

  export RUSTUP_TOOLCHAIN=stable
  cargo update # Only in a VCS package build
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd $pkgname

  export RUSTUP_TOOLCHAIN=stable CARGO_TARGET_DIR=target
  cargo build --frozen --release --all-features

  # Man pages
  ./doc/gen.sh
}

check() {
  cd $pkgname

  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --all-features
}

package() {
  install -Dm755 "$pkgname/target/release/${pkgname%-git}"{,-daemon} -t "$pkgdir/usr/bin"

  install -Dm644 $pkgname/completions/_swww -t "$pkgdir/usr/share/zsh/site-functions"
  install -Dm644 $pkgname/completions/swww.bash "$pkgdir/usr/share/bash-completion/completions/swww"
  install -Dm644 $pkgname/completions/swww.elv "$pkgdir/usr/share/elvish/lib/swww.elv"
  install -Dm644 $pkgname/completions/swww.fish -t "$pkgdir/usr/share/fish/vendor_completions.d"

  install -Dm644 $pkgname/*.md -t "$pkgdir/usr/share/doc/${pkgname%-git}"
  cp -a $pkgname/example_scripts "$pkgdir/usr/share/doc/${pkgname%-git}"
  install -Dm644 $pkgname/doc/generated/*.1 -t "$pkgdir/usr/share/man/man1"
}