pkgname=awww
pkgver=0.11.2
pkgdesc="Efficient animated wallpaper daemon for wayland, controlled at runtime"
homepage="https://codeberg.org/LGFae/awww"
depends=(
  dav1d
  gcc
  glibc
  lz4
)
makedepends=(
  cargo
  scdoc
  wayland
  wayland-protocols
)
license=(GPL-3)
sources=("${pkgname}-${pkgver}.tar.gz")
urls=("https://codeberg.org/LGFae/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=("586637b4df570ed064f88ae1307a55652e55dc40739fde0c91852d13feed5897a0b32bf8d166723d42ef43884ceea0fba1e42d1fabb148943fc30831bca33159")

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
  cargo fetch --locked
}

src_build() {
  cargo build --frozen --release --all-features
  ./doc/gen.sh
}

src_install() {
  install -vDm755 -t "$pkgdir/usr/bin" \
    target/release/swww \
    target/release/swww-daemon

  install -vDm644 -t "${pkgdir}/usr/share/man/man1" doc/generated/*.1

  install -vDm644 completions/swww.bash "${pkgdir}/usr/share/bash-completion/completions/awww"
  install -vDm644 completions/_swww -t "${pkgdir}/usr/share/zsh/site-functions"
  install -vDm644 completions/swww.fish -t "${pkgdir}/usr/share/fish/vendor_completions.d"
}

# vim:ft=sh syn=sh et sw=2:
