summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a86a71facb45374b95931729a04c54f3ebe4d353 (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
# Maintainer: mapache <mastersuv@gmail.com>
pkgname=spawnhere
pkgver=0.2.1
pkgrel=1
pkgdesc="Draw a gesture on Hyprland, spawn a floating window exactly where you drew"
arch=('x86_64')
url="https://github.com/revmnds/spawnhere"
license=('MIT')
depends=(
  'hyprland'
  'wayland'
  'libxkbcommon'
)
makedepends=(
  'cargo'
  'pkgconf'
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('d685e5107166aafbd26c78383719e93438a54ad2e582a4156153b9d43e39cef8')

prepare() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --all-features
}

check() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --release --all-features
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
  install -Dm0644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
  install -Dm0644 examples/config.toml "$pkgdir/usr/share/doc/$pkgname/config.example.toml"
}