feat: add Nix flake package, AppImage and .deb packaging

- flake: build teleportfling and teleportfling-gui as nixpkgs packages
  (buildGoModule) with a .desktop entry and icon for the GUI
- packaging/appimage.sh: bundle the GUI + runtime libs (recursive ldd)
  into a self-contained AppImage via appimagetool
- packaging/deb.sh: build a .deb for Debian/Ubuntu with both binaries,
  desktop entry, icon and declared runtime dependencies
- README: document all three packaging methods
- .gitignore: ignore dist/
This commit is contained in:
2026-09-19 10:31:35 +01:00
parent a8e2a860b4
commit 5f5a2d8650
7 changed files with 305 additions and 36 deletions
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
# Build a .deb package of TeleportFling for Debian/Ubuntu.
#
# The binary is built with cgo; runtime libraries (libturbojpeg, libpipewire,
# and the GLFW/GL stack for the GUI) are declared as Debian package
# dependencies so the .deb works on a stock Debian/Ubuntu install. Output:
# dist/teleportfling_<version>_amd64.deb
#
# Usage:
# ./packaging/deb.sh
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
OUT="${HERE}/dist"
ROOT="${OUT}/deb-root"
VERSION="0.1.0"
ARCH="amd64"
PKG_NAME="teleportfling"
echo "Building teleportfling and teleportfling-gui..."
nix develop --command bash -c "go build -o '${OUT}/teleportfling' ./cmd/teleportfling && go build -o '${OUT}/teleportfling-gui' ./cmd/teleportfling-gui"
echo "Assembling .deb root..."
rm -rf "${ROOT}"
mkdir -p "${ROOT}/DEBIAN" \
"${ROOT}/usr/bin" \
"${ROOT}/usr/share/applications" \
"${ROOT}/usr/share/icons/hicolor/512x512/apps"
install -m 0755 "${OUT}/teleportfling" "${ROOT}/usr/bin/teleportfling"
install -m 0755 "${OUT}/teleportfling-gui" "${ROOT}/usr/bin/teleportfling-gui"
install -m 0644 "${HERE}/assets/teleportfling.desktop" "${ROOT}/usr/share/applications/teleportfling.desktop"
install -m 0644 "${HERE}/assets/teleportfling.png" "${ROOT}/usr/share/icons/hicolor/512x512/apps/teleportfling.png"
# Debian package control file.
cat > "${ROOT}/DEBIAN/control" <<EOF
Package: ${PKG_NAME}
Version: ${VERSION}
Section: video
Priority: optional
Architecture: ${ARCH}
Maintainer: Pete Edley <[email protected]>
Depends: libjpeg-turbo8 (>= 2.0), libpipewire-0.3-0 (>= 0.3), libgl1, libglx0,
libwayland-client0, libwayland-cursor0, libwayland-egl1, libxkbcommon0,
libx11-6, libxrandr2, libxi6, libxcursor1, libxinerama1, libxxf86vm1,
libxrender1, libxext6, libxfixes3
Description: Stream a screen and audio to OBS Teleport receivers
Standalone Linux sender for the OBS Teleport protocol. Captures a Wayland
screen and system audio, encodes video to JPEG, and streams them over TCP
so OBS with the obs-teleport plugin can discover and display the stream.
.
Provides a headless CLI (teleportfling) and a desktop GUI with system tray
(teleportfling-gui).
Homepage: http://homeserver:3050/pedley/TeleportFling
EOF
echo "Building .deb..."
nix shell nixpkgs#dpkg --command dpkg-deb --build --root-owner-group "${ROOT}" "${OUT}/${PKG_NAME}_${VERSION}_${ARCH}.deb"
echo "Done: ${OUT}/${PKG_NAME}_${VERSION}_${ARCH}.deb"