summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 698f4f85acbdc3ebca71cd4e57157b94e3e57412 (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
# Maintainer: Matthieu Bessat <mail at matthieubessat dot fr>

_pkgname=pads
pkgname=${_pkgname}-git
pkgver=0.2.6.r0.gc7b4563
pkgrel=1
pkgdesc="A simple CLI tool for switching the default/active output device for PulseAudio."
arch=('i686' 'x86_64')
url="https://github.com/dogue/pads"
license=('MIT')
depends=('libpulse')
makedepends=('rust' 'cargo' 'git')
conflicts=()
source=("git+https://github.com/dogue/pads.git")
md5sums=('SKIP')


pkgver() {
    cd $_pkgname
    printf "%s" "$(git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g')"
}

prepare() {
    cd $_pkgname
    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 -Dm755 "target/release/$_pkgname" \
        -t "$pkgdir/usr/bin"
    install -Dm644 LICENSE \
        "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}