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

321.5. kodi-21.3

Ten-foot media centre for local and network video, music and pictures, with add-ons

Version 21.3, release 1
Shelf video-players — Video players and media centres, and their front-end add-ons
Phase 44_apps (Applications), 404 of 422 in build order
Licence GPL-2.0-or-later
Homepage https://kodi.tv/
Build time 28.7 SBU
Installed size 96.8 MiB in 2165 files
Recipe ports/core/video-players/kodi/kpkgbuild

About

Kodi is a ten-foot media centre: a full-screen interface for local and network video, music and pictures, driven by a remote, a keyboard or a game pad, and extended by add-ons written in Python. This port builds it for the Wayland windowing system, drawing with OpenGL ES through EGL and decoding through VA-API, with a menu entry that also offers to open it full screen.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, autoconf, automake, libtool, nasm, swig, openjdk, python3, waylandpp, wayland, wayland-protocols, libxkbcommon, libdrm, libglvnd, mesa, libva, libass, libcdio, curl, freetype2, fribidi, harfbuzz, lzo, openssl, rapidjson, sqlite, taglib, tinyxml, tinyxml2, zlib, giflib, libjpeg-turbo, libpng, libunistring, libxml2, libxslt, alsa-lib, libpulse, pipewire, avahi, bluez, libbluray, libcap, lcms2, dav1d, dbus, libmicrohttpd, libplist, samba, eudev, libudfread, gnutls, libcec, libnfs, shairplay, lirc.

Required by: no port names it.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

Patches

build.sh applies these; kpkg applies nothing by itself.

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

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/video-players/kodi.

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/video-players/kodi
echo 'a60afcb556e4a00cb19fc35b7e77758107c9a8096c6ce9b66af5f92396be31aa  kodi-21.3.tar.gz' | sha256sum -c -
echo '6be27e0b3a4907f0cd3cfadec255ee1b925569e1bd06e67a4d2f4267299b69c4  crossguid-ca1bf4b810e2d188d04cb6286f957008ee1b7681.tar.gz' | sha256sum -c -
echo 'f38c4a4e7a4f4da6d8e83b8852489aa3bb6588a915dc41f5ee89d9aad305a06e  libdvdcss-1.4.3-Next-Nexus-Alpha2-2.tar.gz' | sha256sum -c -
echo '584f62a3896794408d46368e2ecf2c6217ab9c676ce85921b2d68b8961f49dfc  libdvdnav-6.1.1-Next-Nexus-Alpha2-2.tar.gz' | sha256sum -c -
echo '719130091e3adc9725ba72df808f24a14737a009dca5a4c38c601c0c76449b62  libdvdread-6.1.3-Next-Nexus-Alpha2-2.tar.gz' | sha256sum -c -
echo '375fd8abab657d18578554927d23abfc9cb3b6794bd9839330230cf5f9fcea26  ffmpeg-6.0.1.tar.gz' | sha256sum -c -
echo '5dea48d1fcddc3ec571ce2058e13910a0d4a6bab4cc09a809d8b1dd1c88ae6f2  fmt-9.1.0.tar.gz' | sha256sum -c -
echo '697f91700237dbae2326b90469be32b876b2b44888302afbc7aceb68bcfe8224  spdlog-1.10.0.tar.gz' | sha256sum -c -
echo '8aff985da30aaab37edf8e5b02fda33ed4cbdd962699a8e2af98fdef306f4e4d  flatbuffers-23.3.3.tar.gz' | sha256sum -c -
echo 'e4018e850f80700acee8da296e56e15b1eef711ab15157e542e7d7e1237c3476  fstrcmp-0.7.D001.tar.gz' | sha256sum -c -
echo '4dae6fdcd2bb0bb6c37b5f97c33c2be954da743985369cddac3546e3218bffb8  pcre-8.45.tar.bz2' | sha256sum -c -
echo '395a69a81d5e9915d360d630663c1d98534c9dec134cb267798e49370855d93d  apache-groovy-binary-4.0.33.zip' | sha256sum -c -
echo '08b93712bed7f48725d93c44d70c71e7e661af390f22f0f3e6ba61e3af3cea36  commons-lang3-3.17.0-bin.tar.gz' | sha256sum -c -
echo 'a690c1e868a373f2d0fa5e7e89f5359b24e544d1b5e310f5a709d95a03a95df5  commons-text-1.13.0-bin.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/kodi
SRC=$SRC_ROOT/kodi-21.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf kodi-21.3.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf crossguid-ca1bf4b810e2d188d04cb6286f957008ee1b7681.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf libdvdcss-1.4.3-Next-Nexus-Alpha2-2.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf libdvdnav-6.1.1-Next-Nexus-Alpha2-2.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf libdvdread-6.1.3-Next-Nexus-Alpha2-2.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf ffmpeg-6.0.1.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf fmt-9.1.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf spdlog-1.10.0.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf flatbuffers-23.3.3.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf fstrcmp-0.7.D001.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf pcre-8.45.tar.bz2 -C "$SRC_ROOT"
cp apache-groovy-binary-4.0.33.zip "$SRC"
tar --no-same-permissions --warning=no-unknown-keyword -xf commons-lang3-3.17.0-bin.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf commons-text-1.13.0-bin.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 _codename, _mirror, _crossguid, _dvdcss, _dvdnav, _dvdread, _ffmpeg, _fmt, _spdlog, _flatbuf, _fstrcmp, _pcre, _groovy, _langver, _textver and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

for _p in fix-musl-incompability gcc13 lfs64 gcc15-musl dyn-pagesize; do
	patch -p1 -i "$PORT_SRC/$_p.patch"
done

patch -p1 -i "$PORT_SRC/fmt-imported-configs.patch"

patch -p1 -i "$PORT_SRC/texturepacker-giflib6.patch"

patch -p1 -i "$PORT_SRC/pcre-cmp0026.patch"

patch -p1 -i "$PORT_SRC/platformdefs-limits.patch"

_src() {
	if [ -f "$PORT_SRC/$1" ]; then echo "$PORT_SRC/$1"; else echo "$SOURCE_DIR/$1"; fi
}

python3 -m zipfile -e "apache-groovy-binary-$_groovy.zip" "$SRC_ROOT/groovy"
_groovydir="$SRC_ROOT/groovy/groovy-$_groovy"

export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=2097152"
export CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
export CXXFLAGS="$CXXFLAGS -D_LARGEFILE64_SOURCE"
export CMAKE_POLICY_VERSION_MINIMUM=3.5
mkdir build && cd build
cmake .. -G Ninja \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DCORE_PLATFORM_NAME=wayland \
	-DAPP_RENDER_SYSTEM=gles \
	-DENABLE_VAAPI=ON \
	-DENABLE_VDPAU=OFF \
	-DENABLE_GOLD=OFF \
	-DENABLE_LLD=OFF \
	-DENABLE_MOLD=OFF \
	-DUSE_LTO=OFF \
	-DENABLE_SSE=ON \
	-DENABLE_SSE2=ON \
	-DENABLE_SSE3=OFF \
	-DENABLE_SSSE3=OFF \
	-DENABLE_SSE4_1=OFF \
	-DENABLE_SSE4_2=OFF \
	-DENABLE_AVX=OFF \
	-DENABLE_AVX2=OFF \
	-DENABLE_TESTING=OFF \
	-DENABLE_EVENTCLIENTS=OFF \
	-DENABLE_PYTHON=ON \
	-DENABLE_UPNP=ON \
	-DENABLE_OPTICAL=ON \
	-DENABLE_DVDCSS=ON \
	-DENABLE_AIRTUNES=ON \
	-DENABLE_ALSA=ON \
	-DENABLE_PULSEAUDIO=ON \
	-DENABLE_PIPEWIRE=ON \
	-DENABLE_AVAHI=ON \
	-DENABLE_BLUETOOTH=ON \
	-DENABLE_BLURAY=ON \
	-DENABLE_CAP=ON \
	-DENABLE_DAV1D=ON \
	-DENABLE_DBUS=ON \
	-DENABLE_LCMS2=ON \
	-DENABLE_MICROHTTPD=ON \
	-DENABLE_PLIST=ON \
	-DENABLE_SMBCLIENT=ON \
	-DENABLE_UDEV=ON \
	-DENABLE_UDFREAD=ON \
	-DENABLE_XSLT=ON \
	-DENABLE_CEC=ON \
	-DENABLE_NFS=ON \
	-DENABLE_ISO9660PP=ON \
	-DENABLE_LIRCCLIENT=ON \
	-DENABLE_MDNS=OFF \
	-DENABLE_SNDIO=OFF \
	-DENABLE_MARIADBCLIENT=OFF \
	-DENABLE_MYSQLCLIENT=OFF \
	-DENABLE_INTERNAL_FFMPEG=ON \
	-DENABLE_INTERNAL_DAV1D=OFF \
	-DENABLE_INTERNAL_CROSSGUID=ON \
	-DENABLE_INTERNAL_CEC=OFF \
	-DENABLE_INTERNAL_NFS=OFF \
	-DENABLE_INTERNAL_FLATBUFFERS=ON \
	-DENABLE_INTERNAL_FMT=ON \
	-DENABLE_INTERNAL_SPDLOG=ON \
	-DENABLE_INTERNAL_FSTRCMP=ON \
	-DENABLE_INTERNAL_PCRE=ON \
	-DENABLE_INTERNAL_RapidJSON=OFF \
	-DENABLE_INTERNAL_TAGLIB=OFF \
	-DENABLE_INTERNAL_UDFREAD=OFF \
	-DENABLE_INTERNAL_KISSFFT=ON \
	-DENABLE_INTERNAL_GTEST=OFF \
	-DCROSSGUID_URL="$(_src "crossguid-$_crossguid.tar.gz")" \
	-DLIBDVDCSS_URL="$(_src "libdvdcss-$_dvdcss.tar.gz")" \
	-DLIBDVDNAV_URL="$(_src "libdvdnav-$_dvdnav.tar.gz")" \
	-DLIBDVDREAD_URL="$(_src "libdvdread-$_dvdread.tar.gz")" \
	-DFFMPEG_URL="$(_src "ffmpeg-$_ffmpeg.tar.gz")" \
	-DFMT_URL="$(_src "fmt-$_fmt.tar.gz")" \
	-DSPDLOG_URL="$(_src "spdlog-$_spdlog.tar.gz")" \
	-DFLATBUFFERS_URL="$(_src "flatbuffers-$_flatbuf.tar.gz")" \
	-DFSTRCMP_URL="$(_src "fstrcmp-$_fstrcmp.tar.gz")" \
	-DPCRE_URL="$(_src "pcre-$_pcre.tar.bz2")" \
	-Dgroovy_SOURCE_DIR="$_groovydir" \
	-Dapache-commons-lang_SOURCE_DIR="$SRC_ROOT/commons-lang3-$_langver" \
	-Dapache-commons-text_SOURCE_DIR="$SRC_ROOT/commons-text-$_textver" \
	-Wno-dev
ninja crossguid
ninja
DESTDIR=$PKG ninja install
cd ..
rm -f "$PKG/usr/bin/TexturePacker"

rm -rf "$PKG/usr/share/xsessions" "$PKG/usr/share/wayland-sessions" \
	"$PKG/usr/lib/firewalld"

install -Dm644 /dev/stdin "$PKG/usr/share/kodi/system/settings/appliance.xml" <<'XML'
<?xml version="1.0" encoding="utf-8" ?>
<settings version="1">
  <section id="system">
    <category id="addons">
      <group id="1">
        <setting id="general.addonupdates">
          <default>2</default>
        </setting>
      </group>
    </category>
  </section>
</settings>
XML

cat > "$PKG/usr/share/applications/kodi.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Kodi
GenericName=Media Center
Comment=Watch and listen to your videos, music and pictures
TryExec=kodi
Exec=kodi
Icon=kodi
Terminal=false
StartupWMClass=Kodi
Categories=AudioVideo;Video;Player;TV;
Keywords=kodi;xbmc;media;center;tv;movies;music;player;
Actions=Fullscreen;

[Desktop Action Fullscreen]
Name=Open in Full Screen
Exec=kodi -fs
DESKTOP
chmod 644 "$PKG/usr/share/applications/kodi.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/kodi, 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 kodi-21.3-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/kodi, and runs the triggers its paths call for.

Contents

Installed programs: kodi, kodi-TexturePacker, kodi-standalone.

Installed directories: /usr/include/kodi, /usr/lib/kodi, /usr/share/doc/kodi, /usr/share/kodi, /usr/share/licenses/kodi.

Notes