summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1704c8b5803ed76ceb92930a0d42d7cf7dad81f2 (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
# Maintainer: coffebar  i8ehkvien@mozmail.com

pkgname=hyprland-monitor-attached
pkgver=0.1.6
pkgrel=2
pkgdesc='Run bash script when you attach the monitor on Hyprland'
arch=('x86_64')
url="https://github.com/coffebar/$pkgname"
license=('MIT')
makedepends=(cargo)
depends=()
_commit=2470fd7
source=("git+$url#commit=$_commit")
sha256sums=('SKIP')

pkgver(){
    cd "$pkgname"
    pcregrep -o1 '^version = "(.*)"$' Cargo.toml
}

prepare() {
    cd "$pkgname"
    export RUSTUP_TOOLCHAIN=stable
    test -f /usr/bin/rustup && /usr/bin/rustup update --no-self-update $RUSTUP_TOOLCHAIN
    cargo fetch --target "$CARCH-unknown-linux-gnu"
}

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

package() {
    cd "$pkgname"
    install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
}