From 2f242ffb61ded18f05b336a10ce1b3d5febe2a1c Mon Sep 17 00:00:00 2001 From: Levi Woodard Date: Mon, 18 May 2026 11:06:59 -0600 Subject: [PATCH] Don't reinstall sunshine when a working build is already present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: install_sunshine always called yay_install on $SUNSHINE_PKG (default sunshine-bin) before checking ldd. If the host already had sunshine (source build) working, the bin install would replace it, trip the ldd check, and the auto-recovery would rebuild source — a redundant 10-minute compile on every ./install.sh re-run. Fix: short-circuit at the top of install_sunshine when either sunshine or sunshine-bin is already installed AND all its shared libs resolve. The recovery dance only runs when there's actually something to fix. --- lib/packages.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/packages.sh b/lib/packages.sh index 820a15e..a33bfc4 100644 --- a/lib/packages.sh +++ b/lib/packages.sh @@ -10,6 +10,21 @@ install_sunshine() { # Ensure runtime deps useful for capture/diagnostics across vendors. yay_install pipewire-pulse vulkan-tools libva-utils jq + + # If a working sunshine (source build) is already installed, don't touch it. + # Otherwise re-running install.sh would replace the source build with + # sunshine-bin (the default $SUNSHINE_PKG), trip the ldd check, then rebuild + # from source — a redundant ~10 minute compile on every re-run. + if pkg_installed sunshine && sunshine_runtime_deps_ok; then + ok "sunshine (source build) already installed with all shared libs resolved" + return 0 + fi + # Same idempotency for sunshine-bin when it happens to be working. + if pkg_installed sunshine-bin && sunshine_runtime_deps_ok; then + ok "sunshine-bin already installed and runtime deps resolved" + return 0 + fi + yay_install "$SUNSHINE_PKG" # sunshine-bin is a precompiled AUR package; it breaks whenever Arch bumps a