Skip to content

Instantly share code, notes, and snippets.

@ImDevinC
Created May 28, 2025 16:16
Show Gist options
  • Save ImDevinC/e18c5bc618989d6b170f77b9446b4ab5 to your computer and use it in GitHub Desktop.
Save ImDevinC/e18c5bc618989d6b170f77b9446b4ab5 to your computer and use it in GitHub Desktop.

Revisions

  1. ImDevinC created this gist May 28, 2025.
    52 changes: 52 additions & 0 deletions PKGBUILD
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    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"
    }