336.2. stellarium-26.2
Planetarium — a realistic sky in 3D, as seen with the eye, binoculars or a telescope
| Version | 26.2, release 1 |
| Shelf | astronomy — Astronomy, planetaria, ephemerides, FITS and satellite prediction |
| Phase | 44_apps (Applications), 9 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://stellarium.org/ |
| Build time | 22.2 SBU |
| Installed size | 481.3 MiB in 2997 files |
| Recipe | ports/core/astronomy/stellarium/kpkgbuild |
About
Stellarium is a planetarium: it draws the sky as it looks from any place on Earth at any time, to the eye, through binoculars or through a telescope, with its stars, planets, deep-sky objects and the sky cultures of many peoples. It is a Qt 6 program with OpenGL rendering and a set of plugins built into it, among them telescope control, satellites, oculars and a lens distortion estimator.
Sources
stellarium-26.2.tar.xz(452.5 MiB)
sha2569a068d00aac82151f2b24c7f278847a2f9416f31f17c0326fc56ee4cc4cb1aed
upstream: https://github.com/Stellarium/stellarium/releases/download/v26.2/stellarium-26.2.tar.xz
archive copy: sources-1/astronomy--stellarium-26.2.tar.xzstellarium-qxlsx-9f545935a1effa0144ba76598e95a7597210553a.zip(7.0 MiB)
sha25627dad1aa0e477b43990f6cbbfb30988f417a6f3629c880c397574ae17bfb4b34
upstream: https://github.com/QtExcel/QXlsx/archive/9f545935a1effa0144ba76598e95a7597210553a.zip
archive copy: sources-1/astronomy--stellarium-qxlsx-9f545935a1effa0144ba76598e95a7597210553a.zipstellarium-indi-2.1.3.zip(3.6 MiB)
sha256c3941d803ce94228cef0e74da1b72e2135ba2ea80c97f72f7e5056cdbb595536
upstream: https://github.com/indilib/indi/archive/v2.1.3.zip
archive copy: sources-1/astronomy--stellarium-indi-2.1.3.zipmd4c-0.5.2.tar.gz(232.4 KiB)
sha25655d0111d48fb11883aaee91465e642b8b640775a4d6993c2d0e7a8092758ef21
upstream: https://github.com/mity/md4c/archive/refs/tags/release-0.5.2.tar.gz
archive copy: sources-1/astronomy--md4c-0.5.2.tar.gz
Dependencies
Depends on: cmake, ninja, pkgconf, qt6-qtbase, qt6-qtdeclarative, qt6-qtsvg, qt6-qtcharts, qt6-qtmultimedia, qt6-qtspeech, qt6-qtpositioning, qt6-qtserialport, qt6-qttools, qt6-qtimageformats, qt6-qtwayland, exiv2, gpsd, nlopt, zlib, python3, noto-fonts, ttf-dejavu, onetbb.
Required by: no port names it.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install stellarium'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/astronomy/stellarium.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/astronomy/stellarium
echo '9a068d00aac82151f2b24c7f278847a2f9416f31f17c0326fc56ee4cc4cb1aed stellarium-26.2.tar.xz' | sha256sum -c -
echo '27dad1aa0e477b43990f6cbbfb30988f417a6f3629c880c397574ae17bfb4b34 stellarium-qxlsx-9f545935a1effa0144ba76598e95a7597210553a.zip' | sha256sum -c -
echo 'c3941d803ce94228cef0e74da1b72e2135ba2ea80c97f72f7e5056cdbb595536 stellarium-indi-2.1.3.zip' | sha256sum -c -
echo '55d0111d48fb11883aaee91465e642b8b640775a4d6993c2d0e7a8092758ef21 md4c-0.5.2.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/stellarium
SRC=$SRC_ROOT/stellarium-26.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf stellarium-26.2.tar.xz -C "$SRC" --strip-components=1
cp stellarium-qxlsx-9f545935a1effa0144ba76598e95a7597210553a.zip "$SRC"
cp stellarium-indi-2.1.3.zip "$SRC"
tar --no-same-permissions --warning=no-unknown-keyword -xf md4c-0.5.2.tar.gz -C "$SRC_ROOT"
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _qxlsx, _indi, _md4c and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
cmake -E chdir "$SRC_ROOT" cmake -E tar xf "$SRC/stellarium-qxlsx-$_qxlsx.zip"
cmake -E chdir "$SRC_ROOT" cmake -E tar xf "$SRC/stellarium-indi-$_indi.zip"
cmake -S . -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib \
-D CMAKE_BUILD_TYPE=Release \
-D STELLARIUM_RELEASE_BUILD=1 \
-D ENABLE_TESTING=0 \
-D ENABLE_CCACHE=0 \
-D ENABLE_PODIR=0 \
-D ENABLE_SHOWMYSKY=0 \
-D ENABLE_QTWEBENGINE=0 \
-D ENABLE_GPS=1 \
-D ENABLE_MEDIA=1 \
-D ENABLE_SPEECH=1 \
-D ENABLE_XLSX=1 \
-D ENABLE_INDI=1 \
-D USE_PLUGIN_ONLINEQUERIES=0 \
-D PREFER_SYSTEM_INDILIB=0 \
-D CMAKE_REQUIRE_FIND_PACKAGE_GPS=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_exiv2=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_NLopt=ON \
-D CPM_QXlsxQt6_SOURCE="$SRC_ROOT/QXlsx-$_qxlsx" \
-D CPM_indiclient_SOURCE="$SRC_ROOT/indi-$_indi" \
-D CPM_md4c_SOURCE="$SRC_ROOT/md4c-release-$_md4c" \
-D FETCHCONTENT_FULLY_DISCONNECTED=ON \
-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build
data="$PKG/usr/share/stellarium/data"
ln -sf /usr/share/fonts/noto/NotoSans-Regular.ttf "$data/NotoSans-Regular.ttf"
ln -sf /usr/share/fonts/noto/NotoSansMono-Regular.ttf "$data/NotoSansMono-Regular.ttf"
ln -sf /usr/share/fonts/TTF/DejaVuSans.ttf "$data/DejaVuSans.ttf"
ln -sf /usr/share/fonts/TTF/DejaVuSansMono.ttf "$data/DejaVuSansMono.ttf"
rm -f "$PKG/usr/share/applications/org.stellarium.Stellarium.desktop"
cat > "$PKG/usr/share/applications/org.stellarium.stellarium.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Stellarium
GenericName=Planetarium
Comment=A realistic sky in 3D, as seen with the eye, binoculars or a telescope
TryExec=stellarium
Exec=stellarium --startup-script=%f
Icon=stellarium
Terminal=false
StartupWMClass=org.stellarium.stellarium
MimeType=application/x-stellarium-script;
Categories=Qt;Education;Science;Astronomy;
Keywords=astronomy;planetarium;sky;stars;planets;constellation;telescope;stellarium;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.stellarium.stellarium.desktop"
The switches, and why each is set:
-D STELLARIUM_RELEASE_BUILD=1— Build as an official release: the version is the public one, with no patch number taken from the day of the year and no branch and commit asked of git, which has no repository to read in an unpacked tarball. It is upstream’s default, named so it cannot change.-D ENABLE_CCACHE=0— Do not wrap the compiler in ccache when it is found; upstream’s default is to use it.-D ENABLE_PODIR=0— Do not compile the translation files underpo/. kpkg removes every non-English catalogue from the package anyway (see size and language policy).-D ENABLE_SHOWMYSKY=0— No ShowMySky atmosphere model. Upstream’s default is on, and it then looks for the library and, failing that, has CPM fetch and build it; ShowMySky is not a port.-D ENABLE_QTWEBENGINE=0— Never link Qt WebEngine. Its one user is the Online Queries plugin, which links it whenever it finds it; qt6-qtwebengine is a port but not independs, so with that plugin built the result would depend on whether it happened to be installed.-D USE_PLUGIN_ONLINEQUERIES=0— Leave out the Online Queries plugin, which upstream builds by default. It looks the selected object up on web services and shows the page in a WebEngine view, or in the system web browser when built without WebEngine.-D ENABLE_GPS=1,-D CMAKE_REQUIRE_FIND_PACKAGE_GPS=ON— Location from a GPS receiver. On Linux Stellarium queries gpsd throughlibgpswhen it finds it and otherwise reads NMEA from a serial device; requiring the package stops the configure whenlibgpsis missing instead of quietly building the serial fallback alone.-D CMAKE_REQUIRE_FIND_PACKAGE_exiv2=ON,-D CMAKE_REQUIRE_FIND_PACKAGE_NLopt=ON— The Lens Distortion Estimator plugin reads photographs’ metadata with exiv2 and fits its model with nlopt. It looks for exiv2 as optional, and for NLopt through CPM, which would fetch NLopt from GitHub when the system has none. Required, both must be the system’s.-D ENABLE_MEDIA=1,-D ENABLE_SPEECH=1— Video and sound through Qt Multimedia, and speech output through Qt TextToSpeech. Both are on by default; named so they cannot drop out.-D ENABLE_XLSX=1,-D CPM_QXlsxQt6_SOURCE="$SRC_ROOT/QXlsx-$_qxlsx"— Export tables from the Astronomical Calculations window and the Satellites plugin to Excel files with QXlsx. QXlsx is not a port, and Stellarium builds it in through CPM when it finds no system copy; theCPM_<name>_SOURCEvariable makes CPM use the copy this recipe fetched instead of downloading one.-D ENABLE_INDI=1,-D PREFER_SYSTEM_INDILIB=0,-D CPM_indiclient_SOURCE="$SRC_ROOT/indi-$_indi"— Telescope Control can drive a mount through an INDI server. INDI is not a port, so Stellarium builds the INDI client library from the INDI source this recipe fetched. WithPREFER_SYSTEM_INDILIB=0it never links alibindiclientit happens to find instead.-D CPM_md4c_SOURCE="$SRC_ROOT/md4c-release-$_md4c"— md4c, the Markdown parser Stellarium turns the sky cultures’ descriptions into HTML with, is not a port either, and is built in from the fetched source.-D FETCHCONTENT_FULLY_DISCONNECTED=ON— CPM is built on CMake’s FetchContent; disconnected, FetchContent downloads and updates nothing and uses the source directories it is given, so the configure never reaches the network.-D ENABLE_TESTING=0— No unit tests; upstream’s default.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/stellarium, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf stellarium-26.2-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/stellarium, and runs the triggers its paths call for.
Contents
Installed programs: stellarium.
Installed directories: /usr/share/licenses/stellarium, /usr/share/stellarium.
Short descriptions
stellarium |
A real-time realistic planetarium |
Notes
The three extra sources are the versions Stellarium’s own CMake names in its CPMAddPackage and CPMFindPackage calls, with the same SHA-256 sums, so a Stellarium bump has to move _qxlsx, _indi and _md4c to whatever the new release names. kpkg unpacks a later tarball into $SRC_ROOT by itself, which is where md4c comes from; a zip is not a tarball and is only copied into $SRC, so build.sh unpacks the QXlsx and INDI zips into $SRC_ROOT with cmake -E tar.
After the install, four of the faces upstream ships in /usr/share/stellarium/data (Noto Sans, Noto Sans Mono, DejaVu Sans and DejaVu Sans Mono) are replaced with links to the same faces from noto-fonts and ttf-dejavu. The fifth, NotoSansSC-Regular.otf, ships as upstream built it (see what is built from source). Upstream’s org.stellarium.Stellarium.desktop is replaced by org.stellarium.stellarium.desktop, with StartupWMClass=org.stellarium.stellarium, TryExec and search keywords. The file name and the class are org.stellarium.stellarium because that is the Wayland app id Qt gives the window: the organisation domain stellarium.org reversed, then the executable’s name. The entry keeps upstream’s Exec=stellarium --startup-script=%f and drops its desktop actions.