Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

330.8. gcompris-26.2

Educational activities for children aged 2 to 10 — reading, counting, science, games and art

Version 26.2, release 1
Shelf education — Learning software, offline encyclopedias and reference dictionaries
Phase 44_apps (Applications), 93 of 422 in build order
Licence GPL-3.0-or-later
Homepage https://gcompris.net/
Build time 9.2 SBU
Installed size 142.1 MiB in 237 files
Recipe ports/core/education/gcompris/kpkgbuild

About

GCompris is a suite of educational activities for children aged 2 to 10: reading, counting, telling the time, geography, science experiments, puzzles, games and drawing. It is a Qt Quick program, gcompris-qt. The port ships the activities’ word pictures, the English voices and the background music with it, so the activities that use them work with no network.

Sources

Dependencies

Depends on: cmake, ninja, extra-cmake-modules, qt6-qtbase, qt6-qtdeclarative, qt6-qtmultimedia, qt6-qtsvg, qt6-qtimageformats, qt6-qttools, qt6-qtsensors, qt6-qtgraphs, qt6-qtquick3d, qt6-qtwayland, openssl.

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 gcompris'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/education/gcompris.

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/education/gcompris
echo 'f876239f39397f554006f4218a3c229627e2af4317a8765ecf9462f0058dfcb4  gcompris-26.2.tar.xz' | sha256sum -c -
echo 'f7373c7faf74754523cb8a2425492349a8c9aa8cb15cd77105132377b5bf6f6d  qml-box2d-e3674e0fe030c406a1d915e47eab760624fffa55.tar.gz' | sha256sum -c -
echo '1e032186d2d900da803958648c8882fffe02a29295b55af10f8dd7b8061febb3  words-webp-2022-04-10-21-14-15.rcc' | sha256sum -c -
echo 'ed88033477018095e7849cfa4b827a64c0ae673e8ec6035d66cbb3b07622d8f6  voices-en_US-2026-07-28-15-07-14.rcc' | sha256sum -c -
echo 'c8f2a40a676e82f29a92e18e63a6e630572d0c8ca08d1353ac703f87f2d24b62  voices-en_GB-2026-07-28-15-07-14.rcc' | sha256sum -c -
echo '66187620c25dffefec8b243b66714af85235b77efaf98b6a7a4ce15c7b3bc852  backgroundMusic-ogg-2024-03-19-11-10-30.rcc' | 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/gcompris
SRC=$SRC_ROOT/gcompris-26.2
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf gcompris-26.2.tar.xz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf qml-box2d-e3674e0fe030c406a1d915e47eab760624fffa55.tar.gz -C "$SRC_ROOT"
cp words-webp-2022-04-10-21-14-15.rcc "$SRC"
cp voices-en_US-2026-07-28-15-07-14.rcc "$SRC"
cp voices-en_GB-2026-07-28-15-07-14.rcc "$SRC"
cp backgroundMusic-ogg-2024-03-19-11-10-30.rcc "$SRC"

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 _box2d, _words, _voices, _music and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

cp -a "$SRC_ROOT/qml-box2d-$_box2d/." external/qml-box2d/

echo "set(QT_NO_QML_PLUGIN_RPATH ON)" > "$SRC_ROOT/no-qml-rpath.cmake"

cmake -S . -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D KDE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D CMAKE_TOOLCHAIN_FILE="$SRC_ROOT/no-qml-rpath.cmake" \
	-D KDE_INSTALL_USE_QT_SYS_PATHS=ON \
	-D BUILD_TESTING=OFF \
	-D WITH_DOWNLOAD=OFF \
	-D SKIP_TRANSLATIONS=ON \
	-D BUILD_SERVER=OFF \
	-D COMPILE_DOC=OFF \
	-D QML_BOX2D_MODULE=submodule \
	-D COMPRESSED_AUDIO=ogg \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

rcc="$PKG/usr/share/gcompris-qt/rcc/data3"
place() {
	install -Dm644 "$2" "$rcc/$1/$2"
	(cd "$rcc/$1" && md5sum "$2" >> Contents)
}
place words words-webp-$_words.rcc
place voices-ogg voices-en_US-$_voices.rcc
place voices-ogg voices-en_GB-$_voices.rcc
place backgroundMusic backgroundMusic-ogg-$_music.rcc
chmod 644 "$rcc"/*/Contents

cat > "$PKG/usr/share/applications/org.kde.gcompris.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=GCompris
GenericName=Educational Game for Children
Comment=Activities for children aged 2 to 10
TryExec=gcompris-qt
Exec=gcompris-qt
Icon=gcompris-qt
Terminal=false
StartupWMClass=org.kde.gcompris
Categories=Qt;KDE;Education;Game;KidsGame;
Keywords=children;kids;learn;school;reading;counting;game;gcompris;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.kde.gcompris.desktop"

The switches, and why each is set:

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/gcompris, 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 gcompris-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/gcompris, and runs the triggers its paths call for.

Contents

Installed programs: gcompris-qt.

Installed directories: /usr/lib/qml, /usr/share/gcompris-qt, /usr/share/licenses/gcompris.

Notes

qml-box2d, the physics module several activities import, is a git submodule that the release archive carries empty. The recipe’s second source is qml-box2d at a pinned commit, the recipe’s _box2d, and build.sh copies it into external/qml-box2d before configure. cmake/box2d.cmake builds it as an external project and installs it under /usr/lib/qml, which gcompris-qt adds to its import path.

The word pictures, the two English voice packs and the background music are the .rcc resource files the downloader would otherwise fetch on first use. Each is a source of the recipe, pinned by its date stamp. build.sh installs each one under /usr/share/gcompris-qt/rcc/data3/<kind>/ and appends its md5 to that directory’s Contents file, the list the download manager reads to know what is present.

The menu entry is replaced: gcompris-qt sets its desktop file name, and so its Wayland app_id, to org.kde.gcompris, which the entry gives as StartupWMClass.