Kodi Steam Deck development: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
Garbear (talk | contribs)
m Install required packages: Update header to specify "includes add-on dependencies"
Garbear (talk | contribs)
Install missing pkg-config files: Add groovy and jdk-openjdk packages
 
(20 intermediate revisions by the same user not shown)
Line 11: Line 11:
The following steps will allow you to compile Kodi on the Steam Deck:
The following steps will allow you to compile Kodi on the Steam Deck:


=== Disable the read-only filesystem===
=== Disable the read-only filesystem ===


<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight lang="bash" enclose="div">
Line 35: Line 35:
</syntaxhighlight>
</syntaxhighlight>


=== Install required packages (includes add-on dependencies) ===
=== Refresh the file database ===


<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight lang="bash" enclose="div">
sudo pacman -S \
sudo pacman -Fy
  acl \
  audit \
  base-devel \
  ccache \
  curl \
  glibc \
  gperf \
  jre-openjdk \
  krb5 \
  libcap-ng \
  libglvnd \
  libpcap \
  libvdpau \
  libx11 \
  libxext \
  libxfixes \
  libxrandr \
  libxrender \
  linux-api-headers \
  lld \
  mesa \
  net-tools \
  perl-parse-yapp \
  pcre \
  qt5-base \
  readline \
  rpcsvc-proto \
  systemd-libs \
  xorgproto \
  zlib
</syntaxhighlight>
</syntaxhighlight>


=== Disable Baloo ===
=== Install missing pkg-config files ===
 
Building Kodi and depends writes a few hundred thousand small files, so it's recommended that you disable the Baloo indexer:


<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight lang="bash" enclose="div">
balooctl suspend
sudo pacman -S --overwrite '*' groovy jdk-openjdk libx11 libxau libxcb libxdmcp libxrandr mesa
balooctl disable
balooctl purge
</syntaxhighlight>
</syntaxhighlight>
== Get/build the source code ==


=== Clone Kodi ===
=== Clone Kodi ===
Line 97: Line 65:


<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight lang="bash" enclose="div">
./configure --prefix="$HOME/kodi-deps" --host=x86_64-steamdeck-linux-gnu
./configure --prefix="$HOME/kodi-deps" --with-rendersystem=gl
</syntaxhighlight>
</syntaxhighlight>


=== Build depends (this takes about 25 minutes) ===
=== Build depends (this takes about 45 minutes) ===


<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight lang="bash" enclose="div">
Line 108: Line 76:
=== Create CMake files ===
=== Create CMake files ===


Optionally, link with LLD because ld.gold complains about newer DWARF formats:
First, set the parameters.
 
Link with LLD because ld.gold complains about newer DWARF formats.
 
<syntaxhighlight lang="bash" enclose="div">
export CMAKE_EXTRA_ARGUMENTS="-DENABLE_LLD=ON"
export PKG_CONFIG_LIBDIR_EXTRA="/usr/lib/pkgconfig:/usr/share/pkgconfig"
</syntaxhighlight>
 
Generate the CMake files:


<syntaxhighlight lang="bash" enclose="div">
<syntaxhighlight lang="bash" enclose="div">
cd ~/Documents/kodi
cd ~/Documents/kodi
make -C tools/depends/target/cmakebuildsys CMAKE_EXTRA_ARGUMENTS="-DENABLE_LLD=ON"
make -C tools/depends/target/cmakebuildsys
</syntaxhighlight>
</syntaxhighlight>


Line 128: Line 105:
</syntaxhighlight>
</syntaxhighlight>


[[Category:Development]]
== Installation ==
[[Category:Gaming]]
 
[[Category:RetroPlayer]]
=== Create launcher script ===
 
First, create a script directory:
 
<syntaxhighlight lang="bash" enclose="div">
mkdir -p ~/bin
</syntaxhighlight>
 
Then, write the script:
 
<syntaxhighlight lang="bash" enclose="div">
cat <<'EOL' > ~/bin/kodi.sh
#!/usr/bin/env bash
set -euo pipefail
 
# Kodi needs this when running from the build tree
export SSL_CERT_FILE="/home/deck/Documents/kodi/system/certs/cacert.pem"
 
KODI_BIN="/home/deck/Documents/kodi/build/kodi.bin"
 
# Gaming Mode: already inside gamescope (Wayland)
if [[ -n "${STEAM_GAMEPADUI:-}" ]]; then
  export WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-gamescope-0}"
  exec "${KODI_BIN}" -fs
fi
 
# Desktop Mode (X11)
exec "${KODI_BIN}" -fs
 
# Alternative desktop Mode: provide a Wayland compositor via nested gamescope
# and force 4K
#exec /usr/bin/gamescope --expose-wayland -f -b -W 3840 -H 2160 -- "${KODI_BIN}" -fs
 
EOL
</syntaxhighlight>
 
Finally, make it executable:
 
<syntaxhighlight lang="bash" enclose="div">
chmod +x ~/bin/kodi.sh
</syntaxhighlight>
 
=== Create desktop entry ===
 
Write the desktop file:
 
<syntaxhighlight lang="bash" enclose="div">
cat <<'EOL' > ~/.local/share/applications/kodi.desktop
[Desktop Entry]
Version=1.0
Name=Kodi
GenericName=Media Center
Comment=Manage and view your media
Type=Application
Terminal=false
Categories=AudioVideo;Video;Player;TV;
Icon=/home/deck/Documents/kodi/tools/Linux/packaging/media/icon256x256.png
 
Exec=/home/deck/bin/kodi.sh
EOL
</syntaxhighlight>
 
Make it executable:
 
<syntaxhighlight lang="bash" enclose="div">
chmod +x ~/.local/share/applications/kodi.desktop
</syntaxhighlight>
 
Update the launcher database:
 
<syntaxhighlight lang="bash" enclose="div">
update-desktop-database ~/.local/share/applications 2>/dev/null || true
</syntaxhighlight>
 
Copy the launcher to your desktop:
 
<syntaxhighlight lang="bash" enclose="div">
cp ~/.local/share/applications/kodi.desktop ~/Desktop/
</syntaxhighlight>
 
=== Add to Steam (Gaming Mode) ===
 
Switch to Desktop Mode.
 
Open Steam.
 
Select "Add a Game" -> "Add a Non-Steam Game..."
 
Click "Browse..." and select:
<code>/home/deck/bin/kodi.sh</code>
 
After it is added, open Properties and set:
 
* Name: <code>Kodi</code>
* Compatibility: ensure "Force the use of a specific Steam Play compatibility tool" is unchecked.

Latest revision as of 14:27, 7 March 2026

Development:
  ▶ Development ▶ Kodi Steam Deck development

Kodi is easily installable on the Steam Deck via Flatpak, but if you're looking to do development on the Steam Deck, this article is for you.

Environment Setup

The first step is to disable the read-only filesystem. If you're reading this, it's assumed that you know what you're doing. If not, seek safety.

The following steps will allow you to compile Kodi on the Steam Deck:

Disable the read-only filesystem

sudo steamos-readonly disable

Initialize the pacman keyring

sudo pacman-key --init

Populate the pacman keyring with the default Arch Linux and Holo keys

sudo pacman-key --populate archlinux holo

Update the system packages

sudo pacman -Syu

Refresh the file database

sudo pacman -Fy

Install missing pkg-config files

sudo pacman -S --overwrite '*' groovy jdk-openjdk libx11 libxau libxcb libxdmcp libxrandr mesa

Get/build the source code

Clone Kodi

git clone https://github.com/xbmc/xbmc.git ~/Documents/kodi

Bootstrap depends

cd ~/Documents/kodi/tools/depends
./bootstrap

Configure depends

./configure --prefix="$HOME/kodi-deps" --with-rendersystem=gl

Build depends (this takes about 45 minutes)

make -j8

Create CMake files

First, set the parameters.

Link with LLD because ld.gold complains about newer DWARF formats.

export CMAKE_EXTRA_ARGUMENTS="-DENABLE_LLD=ON"
export PKG_CONFIG_LIBDIR_EXTRA="/usr/lib/pkgconfig:/usr/share/pkgconfig"

Generate the CMake files:

cd ~/Documents/kodi
make -C tools/depends/target/cmakebuildsys

Build Kodi (this takes about 18 minutes)

cd build
make -j8

Build binary add-ons

make -j8 binary-addons

Installation

Create launcher script

First, create a script directory:

mkdir -p ~/bin

Then, write the script:

cat <<'EOL' > ~/bin/kodi.sh
#!/usr/bin/env bash
set -euo pipefail

# Kodi needs this when running from the build tree
export SSL_CERT_FILE="/home/deck/Documents/kodi/system/certs/cacert.pem"

KODI_BIN="/home/deck/Documents/kodi/build/kodi.bin"

# Gaming Mode: already inside gamescope (Wayland)
if [[ -n "${STEAM_GAMEPADUI:-}" ]]; then
  export WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-gamescope-0}"
  exec "${KODI_BIN}" -fs
fi

# Desktop Mode (X11)
exec "${KODI_BIN}" -fs

# Alternative desktop Mode: provide a Wayland compositor via nested gamescope
# and force 4K
#exec /usr/bin/gamescope --expose-wayland -f -b -W 3840 -H 2160 -- "${KODI_BIN}" -fs

EOL

Finally, make it executable:

chmod +x ~/bin/kodi.sh

Create desktop entry

Write the desktop file:

cat <<'EOL' > ~/.local/share/applications/kodi.desktop
[Desktop Entry]
Version=1.0
Name=Kodi
GenericName=Media Center
Comment=Manage and view your media
Type=Application
Terminal=false
Categories=AudioVideo;Video;Player;TV;
Icon=/home/deck/Documents/kodi/tools/Linux/packaging/media/icon256x256.png

Exec=/home/deck/bin/kodi.sh
EOL

Make it executable:

chmod +x ~/.local/share/applications/kodi.desktop

Update the launcher database:

update-desktop-database ~/.local/share/applications 2>/dev/null || true

Copy the launcher to your desktop:

cp ~/.local/share/applications/kodi.desktop ~/Desktop/

Add to Steam (Gaming Mode)

Switch to Desktop Mode.

Open Steam.

Select "Add a Game" -> "Add a Non-Steam Game..."

Click "Browse..." and select: /home/deck/bin/kodi.sh

After it is added, open Properties and set:

  • Name: Kodi
  • Compatibility: ensure "Force the use of a specific Steam Play compatibility tool" is unchecked.