summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 43bcaad4549eaa2ee0b9c785e8e1708b316a67a5 (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
# Maintainer: Sergey A. <murlakatamenka@disroot.org>
#
# Ex-maintainers:
#   - Daniel Menelkir <dmenelkir@gmail.com>
#   - Donovan Glover <https://donovan.is>

pkgname=hyprdim
pkgver=2.2.5
pkgrel=1
pkgdesc="Automatically dim windows in Hyprland when switching between them"
arch=('x86_64')
url="https://github.com/donovanglover/hyprdim"
license=('GPL3')
depends=('gcc-libs')
makedepends=('cargo')
source=("$pkgname-$pkgver.tar.gz::https://github.com/donovanglover/$pkgname/archive/$pkgver.tar.gz")
sha256sums=('888f63c4e2e5d4d22690f217acb98f9d69e4020733585da5c0f5c9542e52428e')

prepare() {
  cd "$pkgname-$pkgver"

  export RUSTUP_TOOLCHAIN=stable

  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"

  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target

  cargo build --release --frozen
}

package() {
  cd "$pkgname-$pkgver"

  install -Dm 755 'target/release/hyprdim' -t "$pkgdir/usr/bin"

  # shell completions
  install -Dm 644 'target/completions/_hyprdim' -t "$pkgdir/usr/share/zsh/site-functions/_hyprdim"
  install -Dm 644 'target/completions/hyprdim.bash' -t "$pkgdir/usr/share/bash-completion/completions"
  install -Dm 644 'target/completions/hyprdim.fish' -t "$pkgdir/usr/share/fish/vendor_completions.d"

  # docs
  install -Dm 644 'target/man/hyprdim.1' -t "$pkgdir/usr/share/man/man1"
  install -Dm 644 'README.md' -t "$pkgdir/usr/share/doc/$pkgname"

  install -Dm 644 'LICENSE' -t "$pkgdir/usr/share/licenses/$pkgname"
}