summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0241242f65dc77dd4176ace41ac23dbff1e30a67 (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
52
53
# Maintainer: chitaotao <chotaotao1qaz2wsx at gmail dot com>

_name='awatcher'
pkgname="$_name-git"
pkgver=r85.cba6687
pkgrel=1
pkgdesc="Activity and idle watchers"
arch=('x86_64')
url="https://github.com/2e3s/$_name"
license=('MPL2')

depends=(
    activitywatch
)
makedepends=(
    git
    cargo
)
provides=(${_name})
conflicts=(
    ${_name}
    aw-${_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

    mv ./target/release/${_name} ./target/release/aw-${_name} 
}

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