#!/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__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" < 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"