MythTV PVR/BuildFromSource


 * The addon is part of KODI's official addon repository: https://github.com/kodi-pvr/pvr.mythtv
 * The addon's development repository is https://github.com/janbar/pvr.mythtv. You will also find the addon's issue tracker here.

Branches
KODI PVR addons like the MythTV addon are not compatible with all versions of KODI (due to the PVR API version dependency). The addon repositories have different branches for the different KODI versions. Use  after cloning the repository to switch to the according branch before starting the build.
 * Branch doityourself: Compatible with KODI alpha/beta development builds
 * Branch helix: Compatible with KODI Helix (v14)
 * Branch gotham: Compatible with XBMC Gotham (v13)

Build MythTV addon on Ubuntu
sudo apt-get install git sudo apt-get install build-essential automake autoconf checkinstall sudo apt-get install bison flex libtool intltool zip cmake
 * Install build utilities/libraries

cd $HOME/src git clone git://github.com/janbar/pvr.mythtv.git
 * Clone the pvr.mythtv sources from git repository

gotham branch cd pvr.mythtv ; git checkout gotham ; cd .. helix branch cd pvr.mythtv ; git checkout helix ; cd .. development branch cd pvr.mythtv ; git checkout doityourself ; cd ..
 * Choose the branch you want to build.

mkdir -p build rm -rf build/* cd build cmake -DCMAKE_BUILD_TYPE=Release ../pvr.mythtv/ make
 * Build it in a new cleaned folder

cp -r ../pvr.mythtv/pvr.mythtv ./ cp pvr.mythtv.so pvr.mythtv/ zip -r pvr.mythtv-linux.zip ./pvr.mythtv
 * Create the package ZIP

mv pvr.mythtv-linux.zip $HOME
 * Put the addon in a handy location

rm ~/.kodi/addons/packages/pvr.mythtv-linux.zip
 * You may need to delete the previous addon zip file out of ~/.kodi/addons/packages/ to allow installation of newer revision with the same addon version number


 * Start KODI, add the addon using the zip file, then finally enable Live TV using the MythTV addon above.

Build MythTV addon on OSX

 * Install git. Go to http://code.google.com/p/git-osx-installer
 * Install Xcode for your Mac. Go to http://connect.apple.com/
 * Install Command line tools: Go to http://connect.apple.com/ or type "xcode-select --install" in terminal
 * Snow leopard: Xcode 3.2.6
 * Lion: Xcode 4.3+
 * Mountain Lion: Xcode 4.4+
 * Maverick: Xcode 5.0.1 or newer

mkdir src ; cd src git clone -b release http://cmake.org/cmake.git cd cmake ./bootstrap ; make Then install cmake tool. At prompt enter your password. sudo make install
 * Now open a terminal console and download cmake tool to build addon. Below the cmake sources are installed in the folder $HOME/src

cd $HOME/src git clone git://github.com/janbar/pvr.mythtv.git
 * Clone the pvr.mythtv sources from git repository

gotham branch cd pvr.mythtv ; git checkout gotham ; cd .. helix branch cd pvr.mythtv ; git checkout helix ; cd .. development branch cd pvr.mythtv ; git checkout doityourself ; cd ..
 * Choose the branch you want to build.

mkdir -p build rm -rf build/* cd build cmake -DCMAKE_BUILD_TYPE=Release -DCORE_SYSTEM_NAME=darwin ../pvr.mythtv/ make
 * Build it in a new cleaned folder

cp -r ../pvr.mythtv/pvr.mythtv ./ cp pvr.mythtv.dylib pvr.mythtv/ zip -r pvr.mythtv-osx.zip ./pvr.mythtv
 * Create the package ZIP

mv pvr.mythtv-osx.zip $HOME
 * Put the addon in a handy location

rm $HOME/Library/Application\ Support/KODI/addons/packages/pvr.mythtv-osx.zip
 * You may need to delete the previous addon zip file out of $HOME/Library/Application\ Support/KODI/addons/packages/ to allow installation of newer revision with the same addon version number


 * Start KODI, add the addon using the zip file, then finally enable Live TV using the MythTV addon above.

Build MythTV addon on Windows
cd src git clone -b helix git://github.com/janbar/pvr.mythtv.git
 * Install Visual C++ 2013 windows desktop
 * Download pvr.mythtv sources from git repository
 * Run cmake GUI and create the VC project in a dedicated folder
 * Open pvr.mythtv.sln in Visual C++ 2013
 * Build it
 * To install the addon, copy the generated DLL pvr.mythtv.dll into sub folder pvr.mythtv from the sources. ZIP the sub folder with its content as pvr.mythtv-win32.zip.
 * Start KODI, add the addon using the zip file, then finally enable Live TV using the MythTV addon above.

Build MythTV git into OpenELEC
cd OpenELEC.tv PROJECT=RPi ARCH=arm make release git clone -b helix https://github.com/janbar/pvr.mythtv.git mkdir -p build rm -rf build/* cd build PROJECT=RPi ARCH=arm for FILE in \ ../build.OpenELEC-${PROJECT}.${ARCH}-*/toolchain/etc/cmake-*-openelec-*.conf ; do if [ -f "$FILE" ]; then cmake -DCMAKE_TOOLCHAIN_FILE=$FILE \ -DCMAKE_BUILD_TYPE=Release \ ../pvr.mythtv/ break fi done make
 * Follow normal OpenELEC build instructions (http://wiki.openelec.tv/index.php?title=Compile_from_source) for desired PROJECT+ARCH. This stage has to be done for all needed PROJECT+ARCH. It will install required toolchain to build addon.
 * From OpenELEC sources folder clone sources of compatible branch: gotham, helix or doityourself (last development)
 * Create a cleaned  folder and go
 * Select PROJECT and ARCH to build
 * Configure the build by running script below
 * Build the addon

cp -r ../pvr.mythtv/pvr.mythtv ./ cp pvr.mythtv.so pvr.mythtv/ zip -r pvr.mythtv-${PROJECT}-${ARCH}.zip ./pvr.mythtv
 * Create the package ZIP