summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 32b9b7cd5a284618c03fb5d3c687f2a73a73ff16 (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
# Maintainer: Valters Tomsons <valters.tomsons at protonmail dot com>

pkgname="dsbattery"
pkgver=1.3.1
pkgrel=2
pkgdesc="DualShock 4 controller utility for status bars"
arch=('x86_64' 'aarch64')
url='https://github.com/valters-tomsons/dsbattery'
license=('MIT')

makedepends=('dotnet-sdk>=6.0.0')
optdepends=('bluez-tools: disconnect support')

options=('!strip')
source=("$pkgname-$pkgver.tar.gz::https://github.com/valters-tomsons/dsbattery/archive/refs/tags/${pkgver}.tar.gz")
sha256sums=('61a28fb1aea059fe99a3228b9511aec08599cdac991c10cec352c1930e5e2cea')

_outputdir="Release"

build() {
    cd "$pkgname-$pkgver"

    # Determine RID for build
    case $CARCH in "aarch64") RID=arm64 ;;
    "x86_64") RID=x64 ;;
    esac

    dotnet publish -c Release --self-contained -r linux-"${RID}" -o="${_outputdir}"
}

package() {
    install -Dm755 "$srcdir/$pkgname-$pkgver/${_outputdir}/$pkgname" "$pkgdir/usr/bin/${pkgname}"
    install -Dm644 "$srcdir/$pkgname-$pkgver/LICENSE" "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}