make package work again

This commit is contained in:
Tobias Brunner 2022-08-30 08:58:35 +02:00
parent ccaec9a741
commit 074c988abf
3 changed files with 15 additions and 32 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
pkg/
src/
streamdeckd-*

View file

@ -1,8 +1,8 @@
# Maintainer: TheJonsey <mail@thejonsey.com> # Maintainer: TheJonsey <mail@thejonsey.com>
pkgname=streamdeckd pkgname=streamdeckd
_pkgname=streamdeckd _pkgname=streamdeckd
pkgver=${PKGVER:-autogenerated} pkgver=1.0.2
pkgrel=${PKGREL:-1} pkgrel=1
pkgdesc="A Linux Driver for the Elgato Streamdeck" pkgdesc="A Linux Driver for the Elgato Streamdeck"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url='https://github.com/unix-streamdeck/streamdeckd' url='https://github.com/unix-streamdeck/streamdeckd'
@ -18,15 +18,15 @@ makedepends=(
) )
source=( source=(
"$_pkgname::git+git://github.com/unix-streamdeck/streamdeckd#branch=${BRANCH:-master}" "${pkgname}-${pkgver}.tar.gz::https://github.com/unix-streamdeck/streamdeckd/archive/refs/tags/v${pkgver}.tar.gz"
"50-elgato.rules" "50-elgato.rules"
"streamdeckd.service" "streamdeckd.service"
) )
md5sums=( md5sums=(
'SKIP' '1b497fd3138845369a924d2e0fb5d534'
'c181439b9cd1c7905c37dcaa8c53580f' 'c181439b9cd1c7905c37dcaa8c53580f'
'3f9c5710d25ed2e7b613c498ba7fa12a' '2f4a551558450208876edb3f14c95638'
) )
backup=( backup=(
@ -34,12 +34,12 @@ backup=(
) )
pkgver() { pkgver() {
if [[ "$PKGVER" ]]; then if [[ "$pkgver" ]]; then
echo "$PKGVER" echo "$pkgver"
return return
fi fi
cd "$srcdir/$_pkgname" cd "$srcdir/$_pkgname-$pkgver"
local date=$(git log -1 --format="%cd" --date=short | sed s/-//g) local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
local count=$(git rev-list --count HEAD) local count=$(git rev-list --count HEAD)
local commit=$(git rev-parse --short HEAD) local commit=$(git rev-parse --short HEAD)
@ -47,34 +47,14 @@ pkgver() {
} }
build() { build() {
cd "$srcdir/$_pkgname" cd "$srcdir/$_pkgname-$pkgver"
if [ -L "$srcdir/$_pkgname" ]; then
rm "$srcdir/$_pkgname" -rf
mv "$srcdir/go/src/$_pkgname/" "$srcdir/$_pkgname"
fi
rm -rf "$srcdir/go/src"
mkdir -p "$srcdir/go/src"
export GOPATH="$srcdir/go"
mv "$srcdir/$_pkgname" "$srcdir/go/src/"
cd "$srcdir/go/src/$_pkgname/"
ln -sf "$srcdir/go/src/$_pkgname/" "$srcdir/$_pkgname"
echo ":: Updating git submodules"
git submodule update --init
echo ":: Building binary" echo ":: Building binary"
go get -v \ go build
-gcflags "-trimpath $GOPATH/src"
} }
package() { package() {
find "$srcdir/go/bin/" -type f -executable | while read filename; do find "$srcdir/$_pkgname-$pkgver" -type f -executable | while read filename; do
install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)" install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
done done
install -DT -m0755 "$srcdir/50-elgato.rules" "$pkgdir/etc/udev/rules.d/50-elgato.rules" install -DT -m0755 "$srcdir/50-elgato.rules" "$pkgdir/etc/udev/rules.d/50-elgato.rules"

View file

@ -9,4 +9,4 @@ Restart=always
KillMode=process KillMode=process
[Install] [Install]
WantedBy=multi-user.target WantedBy=default.target