Compiling Kodi-Game: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
No edit summary
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
This tutorial will show you the necessary steps to compile and run the Kodi-Game branch on an Ubuntu system.
{{mininav| [[Kodi Game]] }}


== Compile Kodi ==
This tutorial will show you the necessary steps to compile and run with RetroPlayer from the Kodi-Game branch on an Ubuntu system.
 
== Where do I start on Linux? ==
General and distribution specific guides on HOW-TO compile Kodi for Linux from source code is available in this whis, and there is also an up-to-date README for Ubuntu Linux available in the [https://github.com/xbmc/xbmc XBMC Foundation git repo on GitHub].
 
The recommended '''Linux development platform''' is currently [[Compiling_Kodi|32-bit Ubuntu Desktop (for x86)]]. The code can be obtained by cloning the xbmc [http://git-scm.com/ git] repository hosted on [https://github.com/garbear/xbmc Github]. First use your package manager to install git on your system and then execute the following command to clone your own repository: <br />
<br /><code>
git clone git://github.com/garbear/xbmc.git
</code><br />
<br />
After the clone has completed, follow the compilation/development guide in the new repository ([[Compiling_Kodi|README.linux]]) to setup the required packages and so on. Team Kodi developers opinion is that the best thing to start with is just to take a look through the source code and try to understand how it all fits together. Test things out, find what works and what does not, then try and track down why.
 
Alternatively, you can [https://www.virtualbox.org/wiki/Downloads download VirtualBox] and follow this guide to install the required software: [[Compiling_Kodi|Ubuntu Desktop (32-bit for x86)]]. Besides from KDevelop, additional development tools that can be useful include Subcommander, Doxygen, Sysprof and PowerTop.
 
The performance of a virtual machine is not great as there is no 2D or 3D hardware acceleration support under a virtual machine, however it should work good enough to get a lot of development tasks done. Nice is also that you can install/run [https://www.virtualbox.org/ VirtualBox] on Windows, OS X and Linux. The free VirtualBox also enables you to share data seamlessly between the virtual machine and host computer, and also allows you to directly access USB 2.0 devices from within the virtual machine. To improve the performance of your virtual machine, you can increase the number of cores on a multi-core system that is assigned to your virtual machine.
 
== Compiling Kodi-Game branch and binary game add-ons ==
Start by following the steps in the [[Compiling_Kodi|Kodi compile HOW TO]]. The only difference is you will need to clone the RetroPlayer branch


Follow the steps in the [[HOW-TO:Compile_Kodi_for_Linux|Kodi compile HOWTO]]. The only difference is to check out the correct branch. Instead of
<source lang="bash">
<source lang="bash">
git clone git://github.com/xbmc/xbmc.git
git clone https://github.com/garbear/xbmc.git
</source>
</source>
you will have to clone
 
 
It is recommended that you build add-ons out-of-tree (other compiling options are available [https://github.com/kodi-game/game.libretro here]).
 
<source lang="bash">
<source lang="bash">
git clone git://github.com/kodi-game/xbmc.git
mkdir binary-addons
cd binary-addons
 
cmake -DADDONS_TO_BUILD="peripheral.joystick game.libretro game.libretro.nestopia" \
      -DCMAKE_BUILD_TYPE=Debug \
      -DCMAKE_INSTALL_PREFIX=$HOME/workspace/xbmc/addons \
      -DPACKAGE_ZIP=1 \
      $HOME/workspace/xbmc/project/cmake/addons
 
make
</source>
</source>


For a development setup you do not need to install kodi to your root directory so you can stop right after the ''make'' command was successful.
== Run Kodi ==
Until button map data has been gathered, input needs to be configured manually. Execute <code>ActivateWindow(GameControllers)</code> (which is mapped to "t" until the window can be launched from the GUI).


== Compile Addons ==
[[File:Controller_configuration_utility.jpg|thumb|600px|left|Controller configuration utility]]


Game addons can be found at [https://github.com/kodi-game kodi-game github repository]. You need at least the ''game.libretro'' addon and an emulator core e.g ''game.libretro.nestobia'' to test your setup and play some games.
<div style="clear: both"></div>
If you followed the howto you should now have a ''xbmc'' directory in your home directory containing the ''kodi.bin'' binary.


change to that directory
From here, choose a controller, choose a button, and then press the key, button, or trigger that should map to the button. To control Kodi with a physical controller, it will need to be mapped to the "Default" controller. To control NES emulators, the keyboard or controller needs to be mapped to the "NES" controller in the configuration utility.
<source lang="bash">
 
cd $HOME/xbmc
[[File:Mapping a button.jpg|thumb|600px|left|Mapping a button]]
</source>


and start compiling addons
<div style="clear: both"></div>
<source lang="bash">
make -C tools/depends/target/binary-addons PREFIX=$HOME/kodi/usr/local ADDONS="game.libretro"
make -C tools/depends/target/binary-addons clean


make -C tools/depends/target/binary-addons PREFIX=$HOME/kodi/usr/local ADDONS="game.libretro.nestopia"
Once you have mapped a keyboard or controller to an emulator's platform's controller, you can control that emulator.
cp /home/markus/kodi/usr/local/lib/kodi/addons/game.libretro.nestopia/* $HOME/kodi/usr/local/share/kodi/addons/game.libretro.nestopia
</source>


Steps you have to perform because the Makefile is not complete at the moment
If you have troubles following this guide please write to the [http://forum.kodi.tv/forumdisplay.php?fid=194 forum] or ask for help in the #kodi-game IRC channel. This page will then be updated to be more helpful.
*The clean step is required because the current Makefile refuses to build another addon if one has been built successful.
*The copy step (last one) is required because kodi is searching for the nestopia binary in the share addon direcotry and not in the lib addon directory.


== Run Kodi ==
=See also=
Now you can start kodi with
* [[Kodi Game|Gaming in Kodi]] - Index of game related articles
<source lang="bash">
** [[Game management]] - A guide to managing game files for and in Kodi
$HOME/kodi/usr/local/lib/kodi/kodi.bin
*** [[Game playback controls]] - A guide that describes the player controls and menus for gaming in Kodi
</source>
*** [[Game controllers]] - Guides for configuring gamepads and jooystick controllers in Kodi
**[[Game add-ons]]
*** [[Porting Libretro cores to game add-ons]]
**** [[Libretro]]
** [[Game development]] - A guide to developing games for Kodi
** [[Compiling Kodi-Game|Compiling Kodi with RetroPlayer]]


You should now have a working kodi that can play nes roms (video + sound). Input is not working at the moment so unfortunately you cannot play.


If you have troubles following this guide please write to the [http://forum.kodi.tv/forumdisplay.php?fid=194 forum] or ask for help in the IRC channel. This page will then be updated to be more helpful.
[[Category:Development]]
[[Category:RetroPlayer]]
[[Category:Gaming]]

Latest revision as of 10:27, 19 May 2020

Home icon grey.png   ▶ Kodi Game ▶ Compiling Kodi-Game

This tutorial will show you the necessary steps to compile and run with RetroPlayer from the Kodi-Game branch on an Ubuntu system.

Where do I start on Linux?

General and distribution specific guides on HOW-TO compile Kodi for Linux from source code is available in this whis, and there is also an up-to-date README for Ubuntu Linux available in the XBMC Foundation git repo on GitHub.

The recommended Linux development platform is currently 32-bit Ubuntu Desktop (for x86). The code can be obtained by cloning the xbmc git repository hosted on Github. First use your package manager to install git on your system and then execute the following command to clone your own repository:

git clone git://github.com/garbear/xbmc.git

After the clone has completed, follow the compilation/development guide in the new repository (README.linux) to setup the required packages and so on. Team Kodi developers opinion is that the best thing to start with is just to take a look through the source code and try to understand how it all fits together. Test things out, find what works and what does not, then try and track down why.

Alternatively, you can download VirtualBox and follow this guide to install the required software: Ubuntu Desktop (32-bit for x86). Besides from KDevelop, additional development tools that can be useful include Subcommander, Doxygen, Sysprof and PowerTop.

The performance of a virtual machine is not great as there is no 2D or 3D hardware acceleration support under a virtual machine, however it should work good enough to get a lot of development tasks done. Nice is also that you can install/run VirtualBox on Windows, OS X and Linux. The free VirtualBox also enables you to share data seamlessly between the virtual machine and host computer, and also allows you to directly access USB 2.0 devices from within the virtual machine. To improve the performance of your virtual machine, you can increase the number of cores on a multi-core system that is assigned to your virtual machine.

Compiling Kodi-Game branch and binary game add-ons

Start by following the steps in the Kodi compile HOW TO. The only difference is you will need to clone the RetroPlayer branch

git clone https://github.com/garbear/xbmc.git


It is recommended that you build add-ons out-of-tree (other compiling options are available here).

mkdir binary-addons
cd binary-addons

cmake -DADDONS_TO_BUILD="peripheral.joystick game.libretro game.libretro.nestopia" \
      -DCMAKE_BUILD_TYPE=Debug \
      -DCMAKE_INSTALL_PREFIX=$HOME/workspace/xbmc/addons \
      -DPACKAGE_ZIP=1 \
      $HOME/workspace/xbmc/project/cmake/addons

make

Run Kodi

Until button map data has been gathered, input needs to be configured manually. Execute ActivateWindow(GameControllers) (which is mapped to "t" until the window can be launched from the GUI).

Controller configuration utility

From here, choose a controller, choose a button, and then press the key, button, or trigger that should map to the button. To control Kodi with a physical controller, it will need to be mapped to the "Default" controller. To control NES emulators, the keyboard or controller needs to be mapped to the "NES" controller in the configuration utility.

Mapping a button

Once you have mapped a keyboard or controller to an emulator's platform's controller, you can control that emulator.

If you have troubles following this guide please write to the forum or ask for help in the #kodi-game IRC channel. This page will then be updated to be more helpful.

See also