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 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-30 22:55:28 +00:00
parent 2bc71e44ad
commit 333dc00ee2

View File

@@ -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
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."
else
warn "Failed to build slowrx from source. ISS SSTV decoding will not be available."
fi
)
}