Initial commit

This commit is contained in:
2026-07-28 16:39:04 +02:00
parent 9230075490
commit a1d29c218c
6 changed files with 29699 additions and 0 deletions
+155
View File
@@ -1,3 +1,158 @@
# satdump_fedora # satdump_fedora
satdump packaged for Fedora satdump packaged for Fedora
# Building SatDump 1.2.2 as an RPM on Fedora 44
This spec has been through several real `rpmbuild` runs on an actual
Fedora 44 system and now produces a working, installable RPM (`satdump`
+ `satdump-devel`). These notes cover how to build it, the non-obvious
fixes baked into the spec and why they're there, and what's still worth
double-checking.
## Building
```bash
sudo dnf install rpm-build rpmdevtools
rpmdev-setuptree
cp satdump.spec ~/rpmbuild/SPECS/
# rpmbuild doesn't fetch Source URLs itself - spectool does that, pulling
# down the main tarball plus the two patched sol2 header files (see below)
cd ~/rpmbuild/SOURCES
spectool -g ~/rpmbuild/SPECS/satdump.spec
sudo dnf builddep ~/rpmbuild/SPECS/satdump.spec
rpmbuild -ba ~/rpmbuild/SPECS/satdump.spec
```
Resulting packages land in `~/rpmbuild/RPMS/x86_64/`. Optional features can
be trimmed at build time:
```bash
# headless build, e.g. for a relay/server box
rpmbuild -ba ~/rpmbuild/SPECS/satdump.spec --without gui --without live
# bladeRF support (off by default - see below)
rpmbuild -ba ~/rpmbuild/SPECS/satdump.spec --with bladerf
```
If you only changed something in `%files` or later and don't need a full
recompile, `--short-circuit` skips straight past `%prep`/`%build` using
what's already in `~/rpmbuild/BUILD/`:
```bash
rpmbuild -bb --short-circuit ~/rpmbuild/SPECS/satdump.spec
```
## Why the spec patches two things before building
**sol2 (Lua binding library), via `Source1`/`Source2`.** 1.2.2 vendors sol2
3.2.3, which has a real bug: `sol::optional<T&>::emplace()` calls a
`construct()` member that doesn't exist on that partial specialization.
Older GCC never checked that unreached branch closely enough to catch it;
GCC 13+ (Fedora 44 ships GCC 15) turns it into a hard build failure. This
is upstream's own bug, not something Fedora-specific — traced their git
history to the exact commit (`2b0a874f3`) where they fixed it by bumping
the vendored header to a newer generated release (the same fix Debian's
1.2.2 package ships). Since SatDump 2.0 drops Lua entirely for AngelScript,
there's no later *tagged* release with the fix to pull a clean tarball
from, so `Source1`/`Source2` point at the two files from that exact commit,
and `%prep` copies them over the vendored ones. This is done via proper
`Source` tags rather than a mid-build `curl`, since Fedora's real build
systems (mock, koji, Copr) run `%build` with no network access.
**Vendored `libacars` (`inmarsat_support` plugin), via `sed` in `%prep`.**
GCC 15 switched its default C dialect from `-std=gnu17` to `-std=gnu23`.
C23 changed what an unprototyped declaration like `void (*node_free)()`
means — from "unspecified arguments" (compatible with anything) to "takes
no arguments." The plugin's vendored `libacars` copy declares its
callback-list functions (`la_list_free_full`, `la_list_foreach`,
`la_list_free_full_with_ctx` in `list.h`/`list.c`) exactly the old way, so
every real call site now mismatches. This isn't `libacars`-specific — it's
a known, wide-reaching GCC 15 migration issue. Forcing `-std=gnu17`
globally via `CMAKE_C_STANDARD` does *not* reliably work here: this
plugin's own `CMakeLists.txt` has a nested `cmake_minimum_required(VERSION
3.12)`, which resets CMake's effective policy version for that subdirectory
below 3.22 (`CMP0128`, which governs `-std=` flag selection), so CMake can
silently skip emitting the flag at all. The actual fix is narrower and more
reliable: give the three declarations/definitions real prototypes matching
how every call site already uses them (verified against every call site in
the plugin, not just one file, and compile-tested against GCC's C23
behavior with zero errors).
## Other decisions baked into the spec
- **`%global debug_package %{nil}`** — this build's LTO flags
(`-flto=auto -ffat-lto-objects`, applied across ~15 plugin `.so`s plus
the core library) confuse Fedora's automatic debuginfo extraction into
leaving orphaned `/usr/lib/debug/...` files that never make it into an
auto-generated `-debuginfo`/`-debugsource` package, which fails the build
with "installed but unpackaged files." Skipping debuginfo packaging
entirely is the simplest reliable fix. If you want real debuginfo later
(e.g. distributing this more broadly), disabling LTO for the build is
the more likely fix than fighting `find-debuginfo.sh`.
- **bladeRF is off by default** (`%bcond_with bladerf`, note this is the
one bcond that defaults *off*, unlike all the others). Fedora's repos
don't carry Nuand's bladeRF/libbladeRF at all — confirmed directly
against a live Fedora 44 system (`dnf`: "No match for argument:
bladeRF-devel"). SatDump's own `bladerf_sdr_support` plugin already
handles a missing bladeRF gracefully via `find_library()` and just skips
building that one plugin with a log message, so this was never going to
hard-fail the build either way — pass `--with bladerf` and install
`bladeRF-devel` yourself only if you've already built libbladeRF from
source.
- **`OpenCL-ICD-Loader-devel`, not `ocl-icd-devel`.** Fedora replaced the
`ocl-icd` OpenCL loader with the Khronos-official `OpenCL-ICD-Loader`;
the two conflict by design (both provide the same functionality), and
Fedora 44 installs the latter by default.
- **No hicolor icon-theme entry.** SatDump doesn't use the standard
`/usr/share/icons/hicolor/<size>/apps/...` layout most GUI apps do — it
installs a single flat `icon.png` under `/usr/share/satdump/`, and
`satdump.desktop`'s `Icon=` line points at that exact absolute path
(valid per the desktop-entry spec, just less common than icon-name
lookup). That's already covered by the general `%{_datadir}/satdump/`
line in `%files`, so there's nothing extra to add here.
- **`satdump-devel` subpackage.** SatDump installs a full public C++ SDK:
`libsatdump_core.so` and `libsatdump_interface.so` as real shared
libraries (which the CLI, SDR server, and every plugin `.so` link
against at runtime, so both live in the main package, not devel-only),
plus roughly 400 headers under `/usr/include/satdump/`, which get their
own `satdump-devel` subpackage (`Requires: satdump = ...`).
## Things that might still need attention
**NNG version.** SatDump's docs mention needing a minimum NNG version and,
on distros where the packaged one is too old, building it from source
(`git clone https://github.com/nanomsg/nng.git -b v1.9.0`). Fedora 44 ships
`nng-devel` at 1.9.0, which has built cleanly so far — but if a future
SatDump release bumps its minimum and `find_package(nng)` starts failing,
the fallback is vendoring NNG as an additional `SourceN` tarball and
building it in `%build` before SatDump's own `%cmake` step.
**Lua 5.5.** Not a problem on Fedora 44 (still on Lua 5.4 — the bump to
5.5 is a Fedora 45 change), but if this spec ever gets rebased for Fedora
45+: SatDump 1.2.2's Lua binding code doesn't compile against 5.5 (removed
`LUA_ERRGCMM` etc., the same break other distro packagers have hit). The
next major SatDump release drops Lua for AngelScript entirely, so this
only matters for 1.2.x.
**OpenCL at runtime.** `OpenCL-ICD-Loader-devel`/`opencl-headers` get you
the build-time loader; the *runtime* machine still needs an actual ICD
installed (`intel-opencl`, `rocm`, a vendor driver, etc.) for
`-DBUILD_OPENCL=ON` to do anything — otherwise projections silently run on
CPU instead.
**Desktop file validation.** `%check` runs `desktop-file-validate` on
`satdump.desktop`. If a future upstream change to that template fails
strict validation (missing `Icon=`, categories, etc.), either patch it in
`%prep` or drop the `%check` section rather than let a cosmetic issue
block the whole build.
## Sanity-check after install
```bash
sudo dnf install ~/rpmbuild/RPMS/x86_64/satdump-1.2.2-1.fc44.x86_64.rpm
satdump --help
satdump-ui # if built with GUI support
```
+53
View File
@@ -0,0 +1,53 @@
// The MIT License (MIT)
// Copyright (c) 2013-2020 Rapptz, ThePhD and contributors
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// This file was generated with a script.
// Generated 2025-06-10 14:45:51.275770 UTC
// This header was generated with sol (revision c1f95a7)
// https://github.com/ThePhD/sol2
#ifndef SOL_SINGLE_SOL_CONFIG_HPP
#define SOL_SINGLE_SOL_CONFIG_HPP
// beginning of sol/config.hpp
/* Base, empty configuration file!
To override, place a file in your include paths of the form:
. (your include path here)
| sol (directory, or equivalent)
| config.hpp (your config.hpp file)
So that when sol2 includes the file
#include <sol/config.hpp>
it gives you the configuration values you desire. Configuration values can be
seen in the safety.rst of the doc/src, or at
https://sol2.readthedocs.io/en/latest/safety.html ! You can also pass them through
the build system, or the command line options of your compiler.
*/
// end of sol/config.hpp
#endif // SOL_SINGLE_SOL_CONFIG_HPP
Binary file not shown.
+29260
View File
File diff suppressed because it is too large Load Diff
+226
View File
@@ -0,0 +1,226 @@
# SatDump RPM spec — Fedora 44
#
# Toggle optional feature sets with rpmbuild --with/--without, e.g.:
# rpmbuild -ba satdump.spec --without gui --without live
#
# NOTE: these use the "bcond_without" form, which means "enabled by
# default, pass --without NAME on the rpmbuild command line to disable."
# An earlier draft tried to fake that same default-on behavior using the
# other form with an extra argument tacked on - that's not valid syntax
# (that other form takes exactly one argument and always defaults to
# *disabled*), so every "with"-conditional block below was silently false
# the whole time. Confirmed by an actual build: satdump-ui never got
# built, and yet satdump.desktop and satdump_sdr_server were installed
# anyway - meaning neither of those is actually gated by BUILD_GUI/
# BUILD_LIVE in this codebase to begin with. Both fixed below: correct
# bcond form, and desktop file/sdr server moved out of the conditional
# blocks entirely.
%bcond_without gui
%bcond_without live
%bcond_without audio
%bcond_without zstd
%bcond_without hdf5
%bcond_without opencl
# Unlike bcond_without gui, this one really does default OFF: Fedora's
# repos don't package bladeRF/libbladeRF at all (confirmed against a live
# Fedora 44 system - dnf gives "No match for argument: bladeRF-devel").
# SatDump's own docs hint at this too: their Red-Hat-specific dnf
# one-liner never lists a bladeRF package, only the openSUSE zypper one
# does. Pass --with bladerf only if you've built/installed libbladeRF from
# source yourself first.
%bcond_with bladerf
# This build's LTO flags (-flto=auto -ffat-lto-objects) across ~15 plugin
# .so's plus the core library confuse Fedora's automatic debuginfo
# extraction into leaving orphaned files under /usr/lib/debug that never
# make it into an automatically generated -debuginfo/-debugsource
# package, which fails the build with "installed but unpackaged files".
# Simplest reliable fix: skip debuginfo packaging for this build entirely.
%global debug_package %{nil}
Name: satdump
Version: 1.2.2
Release: 1%{?dist}
Summary: Generic satellite data processing software
License: GPL-3.0-only
URL: https://www.satdump.org
Source0: https://github.com/SatDump/SatDump/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
# 1.2.2 vendors sol2 3.2.3, whose sol::optional<T&>::emplace() calls a
# construct() member that doesn't exist on that partial specialization.
# GCC < 13 never checked the un-instantiated branch closely enough to catch
# it; GCC 13+ (Fedora 44 ships GCC 15) turns it into a hard FTBFS:
# "class sol::optional<T&>' has no member named 'construct'". Upstream's own
# fix (used e.g. by Debian) was bumping the vendored header to a newer
# generated sol2 release in commit 2b0a874f3 - pull those two files straight
# from that commit so mock/koji's offline build phase already has them
# staged, rather than trying to network-fetch mid-build.
Source1: https://raw.githubusercontent.com/SatDump/SatDump/2b0a874f38d9310e3e4cbc56cfcc69cb0a59e035/src-core/libs/sol2/sol.hpp
Source2: https://raw.githubusercontent.com/SatDump/SatDump/2b0a874f38d9310e3e4cbc56cfcc69cb0a59e035/src-core/libs/sol2/config.hpp
BuildRequires: gcc-c++
BuildRequires: cmake >= 3.13
BuildRequires: git
BuildRequires: pkgconfig
BuildRequires: desktop-file-utils
BuildRequires: fftw-devel
BuildRequires: volk-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
BuildRequires: jemalloc-devel
BuildRequires: libcurl-devel
BuildRequires: sqlite-devel
BuildRequires: nng-devel
BuildRequires: armadillo-devel
BuildRequires: lua-devel
%if %{with gui}
BuildRequires: glfw-devel
BuildRequires: dbus-devel
BuildRequires: zenity
%endif
%if %{with audio}
BuildRequires: portaudio-devel
%endif
%if %{with zstd}
BuildRequires: libzstd-devel
%endif
%if %{with hdf5}
BuildRequires: hdf5-devel
%endif
%if %{with opencl}
BuildRequires: OpenCL-ICD-Loader-devel
BuildRequires: opencl-headers
%endif
%if %{with live}
BuildRequires: rtl-sdr-devel
BuildRequires: hackrf-devel
BuildRequires: airspyone_host-devel
BuildRequires: airspyhf-devel
BuildRequires: libiio-devel
BuildRequires: libad9361-iio-devel
%endif
%if %{with bladerf}
BuildRequires: bladeRF-devel
%endif
# NNG's Fedora package may lag behind upstream point releases; if configure
# fails to find nng >= 1.5 with the packaged nng-devel, see the NOTES file
# for the fallback of vendoring nng from source.
%description
SatDump is a generic satellite data processing software, aimed at providing
a nice UI/UX along with just as advanced features directly aimed at satellite
data reception, processing and product generation from a large number of
satellites, all this handled in an all-in-one software.
This build targets Fedora 44 and packages both the CLI (satdump) and, unless
disabled, the GUI (satdump-ui) and SDR server (satdump_sdr_server).
%package devel
Summary: Development files for SatDump
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Headers for building third-party SatDump plugins or linking against
libsatdump_core directly.
%prep
%setup -q -n SatDump-%{version}
# Swap in the fixed sol2 header pair — see the Source1/Source2 comments
# above. rpmbuild has already staged these in SOURCES/, so this is a plain
# local copy and works fine under mock/koji's network-isolated build.
cp -f %{SOURCE1} src-core/libs/sol2/sol.hpp
cp -f %{SOURCE2} src-core/libs/sol2/config.hpp
# The vendored libacars copy (inmarsat_support plugin) declares its list
# callbacks with old K&R-style empty-parens prototypes, e.g.
# "void (*node_free)()". Under C17 and earlier that meant "unspecified
# arguments" (compatible with anything); GCC 15's C23-by-default treats
# empty parens as "takes no arguments", so every real call site now
# mismatches. (Passing -std=gnu17 does NOT reliably fix this here: this
# plugin's own CMakeLists.txt calls cmake_minimum_required(VERSION 3.12),
# which resets CMake's policy version for that subdirectory below 3.22
# and with it CMP0128, so CMAKE_C_STANDARD can silently fail to emit any
# -std= flag at all for these sources - confirmed by testing.) Give the
# three declarations/definitions their real prototypes instead, matching
# how every call site in this plugin already uses them.
sed -i \
-e 's/void la_list_foreach(la_list \*l, void (\*cb)(), void \*ctx);/void la_list_foreach(la_list *l, void (*cb)(void const *, void *), void *ctx);/' \
-e 's/void la_list_free_full(la_list \*l, void (\*node_free)());/void la_list_free_full(la_list *l, void (*node_free)(void *));/' \
-e 's/void la_list_free_full_with_ctx(la_list \*l, void (\*node_free)(), void \*ctx);/void la_list_free_full_with_ctx(la_list *l, void (*node_free)(void *, void *), void *ctx);/' \
plugins/inmarsat_support/aero/libacars/list.h
sed -i \
-e 's/void la_list_foreach(la_list \*l, void (\*cb)(), void \*ctx) {/void la_list_foreach(la_list *l, void (*cb)(void const *, void *), void *ctx) {/' \
-e 's/void la_list_free_full_with_ctx(la_list \*l, void (\*node_free)(), void \*ctx) {/void la_list_free_full_with_ctx(la_list *l, void (*node_free)(void *, void *), void *ctx) {/' \
-e 's/void la_list_free_full(la_list \*l, void (\*node_free)()) {/void la_list_free_full(la_list *l, void (*node_free)(void *)) {/' \
plugins/inmarsat_support/aero/libacars/list.c
%build
# Upstream's CMakeLists.txt appends -march=native unless it thinks it is
# running in CI, which is not what we want for a redistributable package.
export CI=true
%cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
%if %{with gui}
-DBUILD_GUI=ON \
%else
-DBUILD_GUI=OFF \
%endif
%if %{with live}
-DBUILD_LIVE=ON \
%else
-DBUILD_LIVE=OFF \
%endif
%if !%{with opencl}
-DBUILD_OPENCL=OFF \
%endif
%if %{with bladerf}
-DPLUGIN_BLADERF_SDR_SUPPORT=ON \
%else
-DPLUGIN_BLADERF_SDR_SUPPORT=OFF \
%endif
-DBUILD_ZIQ=%{?with_zstd:ON}%{!?with_zstd:OFF} \
-DBUILD_ZIQ2=%{?with_zstd:ON}%{!?with_zstd:OFF}
%cmake_build
%install
%cmake_install
# Trim the CMake uninstall helper target artifact if present; it's not
# something the RPM should own.
rm -f %{buildroot}%{_prefix}/lib/cmake/satdump/cmake_uninstall.cmake 2>/dev/null || :
%check
desktop-file-validate %{buildroot}%{_datadir}/applications/satdump.desktop
%files
%license LICENSE
%doc README.md
%{_bindir}/satdump
%{_bindir}/satdump_sdr_server
%{_datadir}/applications/satdump.desktop
%if %{with gui}
%{_bindir}/satdump-ui
%endif
%{_datadir}/satdump/
%{_libdir}/satdump/
%{_libdir}/libsatdump_core.so
%{_libdir}/libsatdump_interface.so
%files devel
%{_includedir}/%{name}/
%changelog
* Tue Jul 07 2026 Packager <you@example.com> - 1.2.2-1
- Initial packaging of SatDump 1.2.2 for Fedora 44
Executable
+5
View File
@@ -0,0 +1,5 @@
#!/bin/bash
dnf builddep ./SPECS/satdump.spec
rpmbuild -ba ./SPECS/satdump.spec