petersweb-infra/nixos/vnc-desktop/discover-logging/build.sh
Philip Peterson 1334de7ff6 Add Discover logging patch and Firefox to vnc-desktop image
Adds a discover-logging/ build step that fetches the plasma-discover
source, instruments PKTransaction.cpp with qWarning calls at key points
(trigger, statusChanged, progressChanged, cleanup, errorFound,
installFile) to diagnose hanging .deb installs, then rebuilds and
reinstalls the patched packagekit-backend.so.

Also installs Firefox via the Mozilla apt repo (Ubuntu 24.04 ships
Firefox as a snap which doesn't work in the container).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 02:48:46 -08:00

32 lines
842 B
Bash

#!/usr/bin/env bash
set -euo pipefail
# Enable deb-src so apt-get source works
sed -i 's/^Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources
apt-get update -qq
apt-get install -y --no-install-recommends \
dpkg-dev \
build-essential \
devscripts \
python3
apt-get build-dep -y plasma-discover
cd /tmp
apt-get source plasma-discover
SRC_DIR=$(ls -d /tmp/plasma-discover-*/)
# Apply logging patch
python3 /discover-logging/patch.py "$SRC_DIR/libdiscover/backends/PackageKitBackend/PKTransaction.cpp"
cd "$SRC_DIR"
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -uc -us -j"$(nproc)"
# Install the rebuilt packages (packagekit-backend.so lives in plasma-discover_*.deb)
dpkg -i /tmp/plasma-discover_*.deb
# Clean up to keep image lean
rm -rf /tmp/plasma-discover-* /tmp/*.deb /tmp/*.dsc /tmp/*.tar.*