Kodi Community Forum

Full Version: Develop PVR addons with new cmake build system
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13
you have to use the openelec buildsystem. it's a cross build, you cannot build using your host tools.
Hi,
Following the readme, I was able to build the whole kodi APK FOR ANDROID. (already proud of that ;-))
Now, I would like to replace the original pvr.iptvsimple addon with this one: https://github.com/simphax/pvr.iptvsimpl.../recording.

But I don't know what to do exactly, and when in the building process (I tried replacing the source code and calling make again without success)
Could someone advice me how to.

Info: I'm building the Jarvi branch on ubuntu 14.04 64 bits.

Thanks
Jérôme
(2016-02-29, 11:19)gadjou Wrote: [ -> ]Hi,
Following the readme, I was able to build the whole kodi APK FOR ANDROID. (already proud of that ;-))
Now, I would like to replace the original pvr.iptvsimple addon with this one: https://github.com/simphax/pvr.iptvsimpl.../recording.

But I don't know what to do exactly, and when in the building process (I tried replacing the source code and calling make again without success)
Could someone advice me how to.

Info: I'm building the Jarvi branch on ubuntu 14.04 64 bits.

Thanks
Jérôme

Sorry to insist, but still no luck. As stated in this readme, I created a pvr.iptvsimple.txt into xbmc/project/cmake/addons/addons/pvr.iptvsimple.txt wich reference my repository.
Unfortunately, the building processes keep overwriting it with the original repository.
What am I making wrong?
I recently reactivated my build environment on Windows (Linux & cross compilation is still working fine) and noticed that the custom CMAKE_C/CXX_FLAGS in project/cmake/scripts/windows/c-flag-overrides.cmake and project/cmake/scripts/windows/cxx-flag-overrides.cmake are not honored any more.

I'm executing the following batch file on Windows (roughly copied from tools/buildsteps/win32/make-addons.bat):
Code:
call "%VS120COMNTOOLS%..\..\VC\bin\vcvars32.bat"

SET BASE_PATH=%CD%\..\project\cmake
SET SCRIPTS_PATH=%BASE_PATH%\scripts\windows
SET ADDONS_PATH=%BASE_PATH%\addons
SET TEMP=%CD%\tmp

mkdir %TEMP%

cmake -G "NMake Makefiles" ^
      -DADDONS_TO_BUILD="pvr.dvbviewer" ^
      -DCMAKE_INSTALL_PREFIX="output" ^
      -DCMAKE_USER_MAKE_RULES_OVERRIDE="%SCRIPTS_PATH%/c-flag-overrides.cmake" ^
      -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="%SCRIPTS_PATH%/cxx-flag-overrides.cmake" ^
      -DPACKAGE_ZIP=ON ^
      -DPACKAGE_DIR="%CD%/zips" ^
      "%ADDONS_PATH%"

nmake package-addons

According to cxx-flag-overrides.cmake CMAKE_CXX_FLAGS should be set to "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2", however checking the cflags afterwards:
Code:
$ grep -h CXX_FLAGS ./build/kodi-platform/src/kodi-platform-build/CMakeFiles/kodiplatform.dir/flags.make ./build/p8-platform/src/p8-platform-build/CMakeFiles/p8-platform.dir/flags.make ./build/tinyxml/src/tinyxml-build/CMakeFiles/tinyxml.dir/flags.make ./pvr.dvbviewer-prefix/src/pvr.dvbviewer-build/CMakeFiles/pvr.dvbviewer.dir/flags.make                                                                                                            
CXX_FLAGS =  /DWIN32 /D_WINDOWS /W3 /GR /EHsc /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1                                                                                                                                                              
CXX_FLAGS =  /DWIN32 /D_WINDOWS /W3 /GR /EHsc /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1                                                                                                                                                              
CXX_FLAGS =  /DWIN32 /D_WINDOWS /W3 /GR /EHsc /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1                                                                                                                                                              
CXX_FLAGS =  /DWIN32 /D_WINDOWS /W3 /GR /EHsc /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1

Additionalthe build will break after running "nmake package-addons" a second time. The reason for this is the build environment will now magically honor the custom cflags, but only for some dependencies:
Code:
$ grep -h CXX_FLAGS ./build/kodi-platform/src/kodi-platform-build/CMakeFiles/kodiplatform.dir/flags.make ./build/p8-platform/src/p8-platform-build/CMakeFiles/p8-platform.dir/flags.make ./build/tinyxml/src/tinyxml-build/CMakeFiles/tinyxml.dir/flags.make ./pvr.dvbviewer-prefix/src/pvr.dvbviewer-build/CMakeFiles/pvr.dvbviewer.dir/flags.make                                                                                                            
CXX_FLAGS = /MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2 /D_DEBUG /MDd /Ob0 /Od /RTC1 /D_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0                                                                                                    
CXX_FLAGS = /MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2 /D_DEBUG /MDd /Ob0 /Od /RTC1 /D_HAS_ITERATOR_DEBUGGING=0 /D_SECURE_SCL=0                                                                                                    
CXX_FLAGS =  /DWIN32 /D_WINDOWS /W3 /GR /EHsc /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1                                                                                                                                                              
CXX_FLAGS =  /DWIN32 /D_WINDOWS /W3 /GR /EHsc /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1

The only way to get the build environment honor the custom cflags all the time was to replace CMAKE_C/CXX_FLAGS and their companions with their ..._INIT counterparts. So CMAKE_CXX_FLAGS will become CMAKE_CXX_FLAGS_INIT, etc..

A second problem was that the call in https://github.com/xbmc/xbmc/blob/master...cmake#L109 results in an empty string. The only way to fix this was to use $<TARGET_PDB_FILE:${target}> in the INSTALL-command below.

Are those (especially the first) issues because of my build environment or is this actually a bug?
This is my first post here, so "Hi all!" Smile

I try to write an ebuild for gentoo for the new pvr.vdr.vnsi jarvis addon. It builds so fine, but it installs in the wrong location. I use the standard cmake procdure.

I clone from https://github.com/kodi-pvr/pvr.vdr.vnsi.git.

Cmake configures as:
-DADDONS_TO_BUILD=pvr.vdr.vnsi
-DADDON_SRC_PREFIX=$WORKDIR/$PF/src/

This "src" in ADDON_SRC_PREFIX is contains this data:
https://github.com/kodi-pvr/pvr.vdr.vnsi...master/src

- $WORKDIR/$PF/src/ translates to the source of the addon.
- The prefix for kodi and the addon is /usr.

At the install stage it installs the shared data correctly to "/usr/share/kodi/addons/pvr.vdr.vnsi/", but the so file gets installed to "/usr/lib64/addons/pvr.vdr.vnsi". I expect it to get installed to "/usr/lib64/kodi/addons/pvr.vdr.vnsi"

Do i need to use the "zip stage" to install it to the correct place or is there another cmake option to tune the location for the library but keep the share data at the correct place?

I tried "-DCMAKE_INSTALL_PREFIX=/usr/lib/xbmc/addons" with "-DOVERRIDE_PATHS=1" but it was now all shifted (like expected) to /usr/lib/xbmc/addons.

So, how do i tweak it that the library gets installed at the right place?
To answer my own question: I solved it with that options for cmake
Code:
        -DADDONS_TO_BUILD=pvr.vdr.vnsi
        -DCMAKE_BUILD_TYPE=Release
        -DADDON_SRC_PREFIX=$WORKDIR/$PF/src/
        -DCMAKE_INSTALL_LIBDIR=$PREFIX/lib/kodi/

Sorry for the noise ...
/usr/lib64/kodi/addons/pvr.vdr.vns is the correct location, provided that kodi's binaries are in /usr/lib64/kodi

also, as I've repeated several times in this and other threads on this forum:
Standard addon building procedure on linux is:
1. install dependencies(libp8-platform, kodiplatform....), via your package manager of choice or manually
2. make sure kodi headers are installed (this includes kodi-config.cmake, see 1)
3. clone addon (take care to match the branch to your kodi version)
4. cd [addon srcdir]
5. cmake .
6. make && sudo make install
I would like to compile the modified Pvr iptv simple with multiple playlist for kodi 16.0 running on Amazon Firetv stick...android device...
My computer is a pc running Windows 7 professional 64 bit....and that's what I would be compiling it on and porting to kodi on my
firetv stick.
I had a Mac Pro tower and Mac Book Pro laptop both running Mountain lion but my unix is not that good anymore due to non-use so I prefer the pc box...
My version of Pvr iptv simple just stops playing tv channels after only a few minutes and I was told that this version of the Pvr was
the fix for my issue.
if anyone has a pre-compiled version of this, that would save me the trouble of trying to compile my own.

I'm also running Pvr iptv on a AppleTV 1st gen box with openelec 6.0 - kodi and that one has no issues as of yet but I might consider a version for that box as well...

So, which version of what files do I need for which box and what are the compile commands and steps ?

thanks
You cannor compile kodi and its addons for android on windows. Linux is the only supported platform for that. Some made it work on mac osx as wel, but we don't really support it
Hi lads

i am a bit lost here still could not compile PVR.hts on windows to use with kodi compiled also on windows is there any link i can check out for the full steps for compiling PVR.hts tvheadend on the source and build all of it together with kodi?
(2015-02-21, 22:58)FernetMenta Wrote: [ -> ]We have changed the build system for PVR addons. Now they are built with cmake and every addon has its own repository.
CMake (http://www.cmake.org/Wiki/CMake) generates the build environment required for a particular platform.

Team-Kodi provides the infrastructure to build PVR addons for the supported plattforms. The addons are maintained in their
own repositories from where the build process loads them. The repository is specified in a .txt file in the Kodi source
tree. For the pvr.demo addon this is in home/xbmc/progs/src/xbmc/project/cmake/addons/addons/pvr.demo/pvr.demo.txt.
You can clone this repository to any location of your system. You also need to clone the Kodi repository which contains
common files, libs, and API for the addons.

For setup of an development environment follow these steps. The examples are with absolute paths. You can substitute
the path to match your systems.



Windows:

Change to addons folder:
Code:
cd D:\Projects\xbmx\xbmc\project\cmake\addons\build

Generate build environment with config for debugging. This command generates a Visual Studio 2013 solution.
Code:
cmake -DADDONS_TO_BUILD="pvr.demo" -DADDON_SRC_PREFIX="D:\Projects" -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 12"  -DCMAKE_USER_MAKE_RULES_OVERRIDE="D:\Projects\xbmx\xbmc\project\cmake\scripts\windows\c-flag-overrides.cmake" -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="D:\Projects\xbmx\xbmc\project\cmake\scripts\windows\cxx-flag-overrides.cmake" -DCMAKE_INSTALL_PREFIX="D:\Projects\xbmx\xbmc\addons" -DBUILD_DIR="D:\Projects\xbmx\xbmc\project\cmake\addons\build" -DPACKAGE_ZIP=1 "D:\Projects\xbmx\xbmc\project\cmake\addons"

Open Visual Studio, load and build this solution:
Code:
D:\Projects\xbmx\xbmc\project\cmake\addons\build\kodi-addons.sln

Setup Development Environment.

Open Visual Studio, load Kodi solution. Then add existing solution:
Code:
D:\Projects\xbmx\xbmc\project\cmake\addons\build\pvr.demo-prefix\src\pvr.demo-build\pvr.demo.sln

Create post-build step. Required to copy files for debugging

Create Post-Build Event in Visual Studio
Code:
tbd

For a more convenient method see post #9, credits to Montellese who provided this script.




Hi lads

i am getting issue to compile the pvr.demo addon.

basically its saing that i have a cmake generator error.

i am using vs2013 with 12.0 v120 to compile kodi 16 jarvis without any issues i can buil setup install.exe ok and kodi.exe app exe just fine no issues at all my only issue is building it with the addon also this is my log

This is my message log


Quote:opensource@opensource-PC MINGW64 /c/xbmc/project/cmake/addons/build (Jarvis)

$ cmake -DADDONS_TO_BUILD="pvr.demo" -DADDON_SRC_PREFIX="C:\xbmc" -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 12" -DCMAKE_USER_MAKE_RULES_OVERRIDE="C:\xbmc\project\cmake\scripts\windows\c-flag-overrides.cmake" -DCMAKE_USER_MAKE_RULES_OVERRIDE_CXX="c:\xbmc\project\cmake\scripts\windows\cxx-flag-overrides.cmake" -DCMAKE_INSTALL_PREFIX="C:\xbmc\addons" -DBUILD_DIR="C:\xbmc\project\cmake\addons\build" -DPACKAGE_ZIP=1 "C:\xbmc\project\cmake\addons"

CMake Error: Error: generator : Visual Studio 12 2013
Does not match the generator used previously: NMake Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

btw i am using cmake.exe 3.5x is that an issue or do i need a previous version?
as it says this means something has already generated nmake files in your build directory (or possibly on top of the source directory). clean your directories. or stick to nmake (change the -G argument).

don't think cmake 3.5 is a problem.
Hi,

I have problem with compile PVR iptvsimple on linux (windows method work fine).
I used kodi and pvr addon from Jarvin brunch.

I used:
Quote:sudo cmake -DADDONS_TO_BUILD=pvr.iptvsimple -DADDON_SRC_PREFIX=/home/plyczko/kodi/
-DCMAKE_BUILD_TYPE=Debug -DPACKAGE_ZIP=1 /home/plyczko/kodi/xbmc/project/cmake/addons

in result:

Quote:-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Addon source tarball caching is enabled
-- ZIP packaging enabled (destination: /home/plyczko/kodi/pvr.iptvsimple/build/build/zips)
-- Building following addons: pvr.iptvsimple
-- Overriding addon source directory prefix: /home/plyczko/kodi
-- Processing /home/plyczko/kodi/xbmc/project/cmake/addons/depends/common/platform/platform.txt
-- platform url: https://github.com/Pulse-Eight/platform.git
-- Processing /home/plyczko/kodi/xbmc/project/cmake/addons/depends/common/kodi-platform/kodi-platform.txt
-- kodi-platform url: https://github.com/xbmc/kodi-platform
-- kodi-platform depends: tinyxml;platform
-- Processing /home/plyczko/kodi/xbmc/project/cmake/addons/depends/common/tinyxml/tinyxml.txt
-- tinyxml url: http://mirrors.kodi.tv/build-deps/source...2_2.tar.gz
-- No platform specific file /home/plyczko/kodi/xbmc/project/cmake/addons/depends/linux/CMakeLists.txt found
-- Configuring done
-- Generating done
-- Build files have been written to: /home/plyczko/kodi/pvr.iptvsimple/build

after make:

http://pastebin.com/zZQbnmLj

No .so file in output. Proces finished on "kodi-platform"

The same method I used to compile "pvr.demo" and everything works fine.

Can anyone tell what is wrong?
did you stick the pvr.iptvsimple sources in the given folder? if not, drop the -DADDON_SRC_PREFIX parameter.

does 'make pvr.iptvsimple' do anything?
I have a backend up and running, but am hoping to create a Kodi PVR client for it. I've had a look at pvr.demo.

I built that OK, but it crashes, not clear why right now.

However my real question is this: I also tried to build pvr.python to see if that would be helpful, but when I did that the cmake pre-build failed as it could not find any information about pvr.python in the Kodi addon build tree, and looking at other pvr entries, all of these contain information pointing to a Kodi GIT repository for the pvr client.

It seems to me therefore that the whole pvr cleint cmake process relies on the fact that the pvr client in question is held and maintained in a centralised GIT Kodi repository. Is that right? Will it not allow me to build a totally local pvr addon? The reason for this is that right now I am only experimenting and whatever I do is likely to be throw away code. Since this is also a backend customised specifically for me and my needs, it is most unlikely it would ever be made public, and therefore the same would apply to the client.

So, what I want to do is find a way of maintaining and building this test pvr client purely locally. Is this possible?
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13