summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3da2266bce40bbda99ab419518959e2eff85bd67 (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
42
43
44
45
46
# Maintainer: OmegaRogue <omegarogue@omegavoid.codes>
pkgname=opendeck-git
pkgver=r35.779f82a
pkgrel=1
pkgdesc="OpenDeck is a desktop application that provides Stream Deck-like functionality, implementing the Elgato Stream Deck SDK for cross-compatibility."
arch=('x86_64')
url="https://github.com/ninjadev64/OpenDeck"
license=('BSD-3-Clause')
makedepends=(git cargo npm cargo-tauri dpkg)
depends=(hidapi webkit2gtk)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=('!lto')
source=(
	"${pkgname%-git}::git+https://github.com/ninjadev64/OpenDeck#branch=tauri-rewrite"
	"50-elgato.rules"
)

sha256sums=('SKIP'
            '9e15b85f84cbe38444b47439670877f77f3a5b3908687b5169731eef730e258e')

pkgver() {
	cd "$srcdir/${pkgname%-git}"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
prepare() {
	cd "$srcdir/${pkgname%-git}/src-tauri"
	export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
	cd ..
	npm install --cache "${srcdir}/npm-cache"
}

build() {
	cd "$srcdir/${pkgname%-git}/src-tauri"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo tauri build --ci -b deb -- --frozen
}

package() {
	install -Dm644 -t "$pkgdir/etc/udev/rules.d" 50-elgato.rules
	cd "$srcdir/${pkgname%-git}"
	dpkg-deb -R $(find . -type f -name "*.deb") $pkgdir
	rm -rf $pkgdir/DEBIAN
}