arch-streamdeckd/PKGBUILD

66 lines
1.5 KiB
Bash

# Maintainer: TheJonsey <mail@thejonsey.com>
pkgname=streamdeckd
_pkgname=streamdeckd
pkgver=1.0.2
pkgrel=2
pkgdesc="A Linux Driver for the Elgato Streamdeck"
arch=('i686' 'x86_64')
url='https://github.com/unix-streamdeck/streamdeckd'
license=('BSD-3')
depends=(
'libusb'
'xdotool'
'xdg-utils'
)
makedepends=(
'go'
'git'
)
source=(
"${pkgname}-${pkgver}.tar.gz::https://github.com/unix-streamdeck/streamdeckd/archive/refs/tags/v${pkgver}.tar.gz"
"50-elgato.rules"
"streamdeckd.service"
)
md5sums=(
'1b497fd3138845369a924d2e0fb5d534'
'c181439b9cd1c7905c37dcaa8c53580f'
'2f4a551558450208876edb3f14c95638'
)
backup=(
"etc/udev/rules.d/50-elgato.rules"
)
pkgver() {
if [[ "$pkgver" ]]; then
echo "$pkgver"
return
fi
cd "$srcdir/$_pkgname-$pkgver"
local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
local count=$(git rev-list --count HEAD)
local commit=$(git rev-parse --short HEAD)
echo "$date.${count}_$commit"
}
build() {
cd "$srcdir/$_pkgname-$pkgver"
echo ":: Building binary"
go build
}
package() {
find "$srcdir/$_pkgname-$pkgver" -type f -executable | while read filename; do
install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
done
install -DT -m0644 "$srcdir/50-elgato.rules" "$pkgdir/etc/udev/rules.d/50-elgato.rules"
install -DT -m0644 "$srcdir/streamdeckd.service" "$pkgdir/usr/lib/systemd/user/streamdeckd.service"
echo "To enable and start the service:"
echo -e "systemctl --user enable --now streamdeckd.service"
echo -e "A reboot might be required for streamdeckd to work correctly."
}