Kodi Steam Deck development: Difference between revisions
Add step to create desktop icon |
→Install missing pkg-config files: Add groovy and jdk-openjdk packages |
||
| (19 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> | ||
=== | === Refresh the file database === | ||
<syntaxhighlight lang="bash" enclose="div"> | <syntaxhighlight lang="bash" enclose="div"> | ||
sudo pacman - | sudo pacman -Fy | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== | === Install missing pkg-config files === | ||
<syntaxhighlight lang="bash" enclose="div"> | <syntaxhighlight lang="bash" enclose="div"> | ||
sudo pacman -S --overwrite '*' groovy jdk-openjdk libx11 libxau libxcb libxdmcp libxrandr mesa | |||
</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" -- | ./configure --prefix="$HOME/kodi-deps" --with-rendersystem=gl | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Build depends (this takes about | === 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 === | ||
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 | make -C tools/depends/target/cmakebuildsys | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 128: | Line 105: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Create | == Installation == | ||
=== 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"> | <syntaxhighlight lang="bash" enclose="div"> | ||
cat <<EOL > ~/ | 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] | [Desktop Entry] | ||
Version=1.0 | Version=1.0 | ||
| Line 139: | Line 160: | ||
GenericName=Media Center | GenericName=Media Center | ||
Comment=Manage and view your media | Comment=Manage and view your media | ||
Type=Application | |||
Terminal=false | Terminal=false | ||
Categories=AudioVideo;Video;Player;TV; | 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> | </syntaxhighlight> | ||
Copy the launcher to your desktop: | |||
<syntaxhighlight lang="bash" enclose="div"> | <syntaxhighlight lang="bash" enclose="div"> | ||
cp ~/.local/share/applications/kodi.desktop ~/Desktop/ | |||
</syntaxhighlight> | </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:
|
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.