From 333dc00ee26a57f96c0f4763ab71d4e603047089 Mon Sep 17 00:00:00 2001 From: Smittix Date: Fri, 30 Jan 2026 22:55:28 +0000 Subject: [PATCH] fix: Show build errors and add pkg-config for slowrx source builds - Add pkg-config dependency for cmake to locate libraries - Display cmake/make error output (last 20 lines) on failure - Helps users troubleshoot slowrx build failures on Debian/Ubuntu/macOS Co-Authored-By: Claude Opus 4.5 --- setup.sh | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/setup.sh b/setup.sh index 124fef5..92156be 100755 --- a/setup.sh +++ b/setup.sh @@ -394,6 +394,7 @@ install_slowrx_from_source_macos() { brew_install fftw brew_install libsndfile brew_install gtk+3 + brew_install pkg-config ( tmp_dir="$(mktemp -d)" @@ -406,8 +407,17 @@ install_slowrx_from_source_macos() { cd "$tmp_dir/slowrx" info "Compiling slowrx..." mkdir -p build && cd build - cmake .. >/dev/null 2>&1 || { warn "cmake failed for slowrx"; exit 1; } - make >/dev/null 2>&1 || { warn "make failed for slowrx"; exit 1; } + local cmake_log make_log + cmake_log=$(cmake .. 2>&1) || { + warn "cmake failed for slowrx:" + echo "$cmake_log" | tail -20 + exit 1 + } + make_log=$(make 2>&1) || { + warn "make failed for slowrx:" + echo "$make_log" | tail -20 + exit 1 + } # Install to /usr/local/bin if [[ -w /usr/local/bin ]]; then @@ -676,7 +686,7 @@ install_aiscatcher_from_source_debian() { install_slowrx_from_source_debian() { info "slowrx not available via APT. Building from source..." - apt_install build-essential git cmake \ + apt_install build-essential git cmake pkg-config \ libfftw3-dev libsndfile1-dev libgtk-3-dev libasound2-dev libpulse-dev # Run in subshell to isolate EXIT trap @@ -692,12 +702,21 @@ install_slowrx_from_source_debian() { mkdir -p build && cd build info "Compiling slowrx..." - if cmake .. >/dev/null 2>&1 && make >/dev/null 2>&1; then - $SUDO install -m 0755 slowrx /usr/local/bin/slowrx - ok "slowrx installed successfully." - else - warn "Failed to build slowrx from source. ISS SSTV decoding will not be available." - fi + local cmake_log make_log + cmake_log=$(cmake .. 2>&1) || { + warn "cmake failed for slowrx:" + echo "$cmake_log" | tail -20 + warn "ISS SSTV decoding will not be available." + exit 1 + } + make_log=$(make 2>&1) || { + warn "make failed for slowrx:" + echo "$make_log" | tail -20 + warn "ISS SSTV decoding will not be available." + exit 1 + } + $SUDO install -m 0755 slowrx /usr/local/bin/slowrx + ok "slowrx installed successfully." ) }