Created
May 28, 2025 16:16
-
-
Save ImDevinC/e18c5bc618989d6b170f77b9446b4ab5 to your computer and use it in GitHub Desktop.
Virtualenv supported StreamController AUR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgname=streamcontroller-git | |
_pkgname=${pkgname%-git} | |
_reponame=StreamController | |
pkgver=r1783.98ec06f1 | |
pkgrel=1 | |
pkgdesc="An elegant Linux app for the Elgato Stream Deck with support for plugins" | |
arch=('any') | |
url="https://github.com/StreamController/StreamController" | |
license=('GPL-3') | |
depends=('python' 'xdg-desktop-portal' 'xdg-desktop-portal-gtk' 'libportal' 'libportal-gtk4' 'libadwaita') | |
makedepends=('git' 'python-pip') | |
source=("git+https://github.com/StreamController/StreamController.git") | |
sha256sums=('SKIP') | |
pkgver() { | |
cd "$srcdir/$_reponame" | |
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" | |
} | |
package() { | |
# Create virtualenv with dependencies | |
mkdir -p "$pkgdir/usr/local/lib/$_pkgname" | |
python -m venv "$pkgdir/usr/local/lib/$_pkgname" | |
source "$pkgdir/usr/local/lib/$_pkgname/bin/activate" | |
cd "$srcdir/$_reponame" | |
pip install -r requirements.txt | |
deactivate | |
# Install source files | |
cd "$srcdir" | |
mkdir -p "$pkgdir/usr/lib/$_pkgname" | |
install -d "$_reponame" "$pkgdir/usr/lib/$_pkgname/" | |
cp -r "$_reponame"/* "$pkgdir/usr/lib/$_pkgname/" | |
# Install launch script to /usr/bin | |
mkdir -p "$pkgdir/usr/bin" | |
echo "#!/bin/bash" > "$pkgdir/usr/bin/$_pkgname" | |
echo "cd /usr/lib/$_pkgname" >> "$pkgdir/usr/bin/$_pkgname" | |
echo "source /usr/local/lib/$_pkgname/bin/activate" >> "$pkgdir/usr/bin/$_pkgname" | |
echo "python main.py \$@" >> "$pkgdir/usr/bin/$_pkgname" | |
chmod +x "$pkgdir/usr/bin/$_pkgname" | |
# Install application entry | |
install -Dm644 "$startdir/streamcontroller.desktop" "$pkgdir/usr/share/applications/streamcontroller.desktop" | |
# Install icon | |
install -Dm644 "$srcdir/$_reponame/flatpak/icon_256.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/streamcontroller.png" | |
} | |
clean() { | |
cd "$srcdir" | |
rm -rf "$_reponame" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment