summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cd499f904e382f84b59df418c1127069784e3ef0 (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
_name='aw-watcher-media-player'
pkgname="$_name-git"
pkgver=r16.d1da62f
pkgrel=1
pkgdesc="Watcher of system's currently playing media for ActivityWatch"
arch=('x86_64')
url="https://github.com/2e3s/$_name"
license=('Unlicense')

depends=(
    activitywatch
)
makedepends=(
    git
    cargo
)
provides=(${_name})
conflicts=(
    ${_name}
)

source=("${_name}::git+$url")
sha256sums=('SKIP')


pkgver() {
    cd "${_name}"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd "${_name}"
    export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

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

}

package() {
    cd "${_name}"
    install -Dm0755 ./target/release/aw-watcher-media-player -t "${pkgdir}/usr/bin/"
}