summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5750907522b48e1f593adfa2c969a4428de0dedf (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
# Maintainer: Maximilian Luz <m@mxnluz.io>

pkgname='pbpctrl'
pkgver=0.1.7
pkgrel=1
pkgdesc='Control Google Pixel Buds Pro from the Linux command line.'
url='https://github.com/qzed/pbpctrl'
license=('MIT' 'Apache')
arch=('x86_64')
depends=('gcc-libs' 'dbus' 'bluez')
makedepends=('git' 'rust' 'cargo' 'dbus' 'protobuf')

source=(
    "${pkgname}-${pkgver}.tar.gz::https://github.com/qzed/pbpctrl/archive/refs/tags/v${pkgver}.tar.gz"
)

sha256sums=('41926b0903e08e7c0741cfae010d92fbc6806881a515b27131f00b84d5116194')

build(){
    cd "${srcdir}/${pkgname}-${pkgver}"
    env CARGO_TARGET_DIR="${PWD}/target" CARGO_INCREMENTAL=0 cargo build --release
    strip --strip-all "target/release/pbpctrl"
}

package() {
    install -D -m755 "${srcdir}/${pkgname}-${pkgver}/target/release/pbpctrl" "${pkgdir}/usr/bin/pbpctrl"

    # completion files
    install -D -m644 "${srcdir}/${pkgname}-${pkgver}/target/pbpctrl.bash" "${pkgdir}/usr/share/bash-completion/completions/pbpctrl"
    install -D -m644 "${srcdir}/${pkgname}-${pkgver}/target/_pbpctrl" "${pkgdir}/usr/share/zsh/site-functions/_pbpctrl"
    install -D -m644 "${srcdir}/${pkgname}-${pkgver}/target/pbpctrl.fish" "${pkgdir}/usr/share/fish/vendor_completions.d/pbpctrl.fish"

    # license
    install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE-MIT" "${pkgdir}/usr/share/licenses/pbpctrl/LICENSE-MIT"
    install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE-APACHE" "${pkgdir}/usr/share/licenses/pbpctrl/LICENSE-APACHE"
}