HOw to add a vdr - plugin to LE build?

  • Hi there - i am currently playing around with LE 8.0 build-system.
    I'd like to add a certain plugin for vdr to the distribution/image - how is that being done?
    Or how can i manage to crosscompile the plugin for that specific Architecture?

  • Hi - i don't have it yet - but i am on my way - even if i continue my investigation - would be nice if some one (re)points me just in case i am wrong.

    Here is what i did so far:
    in packages/addons/addon-depends/vdr-plugins i created a folder vdr-plugin-epg2vdr that contains
    a package.mk:

    When issuing "scripts/build vdr-plugin-epg2vdr" this gets the current(latest) plugin-source (Tagged ones have gone yesterday :( ) and starts trying to compile it.

    I needed to patch the source a little bit - some includes were not located well (uuid, zlib)
    I also needed to create packages for libarchive and jansson (required by the plugin)

    Currently linking fails with:

    Code
    /home/lutz/libreelec-8.0/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-g++ -march=x86-64 -m64 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -mmmx -msse -msse2 -mfpmath=sse -ggdb -O0 -fPIC -Wreturn-type -Wall -Wno-parentheses -Wformat -pedantic -Wno-long-long -Wunused-variable -Wunused-label -Wno-unused-result -Wunused-value -Wunused-but-set-variable -Wunused-function -Wno-variadic-macros -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_FORMAT_MACROS -march=x86-64 -m64 -fomit-frame-pointer -Wall -pipe -Os -flto -ffat-lto-objects -mmmx -msse -msse2 -mfpmath=sse -fPIC -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -march=x86-64 -m64 -Wl,--as-needed -fuse-ld=gold -fuse-linker-plugin -flto -shared epg2vdr.o service.o update.o plgconfig.o parameters.o timer.o recording.o recinfofile.o status.o ttools.o svdrpclient.o menu.o menusched.o menutimers.o menudone.o menusearchtimer.o -L./lib -lhorchi -lrt -larchive -lcrypto -luuid -L/home/lutz/libreelec-8.0/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl -lpthread -ldl  -lutil -lm  -lpython2.7 -I/home/lutz/libreelec-8.0/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/include -L/home/lutz/libreelec-8.0/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/x86_64-libreelec-linux-gnu/sysroot/usr/lib -ljansson -o libvdr-epg2vdr.so
    /home/lutz/libreelec-8.0/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/lib/gcc/x86_64-libreelec-linux-gnu/6.2.0/../../../../x86_64-libreelec-linux-gnu/bin/ld.gold: error: cannot find -lpython2.7
    lto1: fatal error: bytecode stream generated with LTO version 4.1 instead of the expected 5.1
    compilation terminated.
    lto-wrapper: fatal error: /home/lutz/libreelec-8.0/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/bin/x86_64-libreelec-linux-gnu-g++-6.2.0 returned 1 exit status
    compilation terminated.
    /home/lutz/libreelec-8.0/build.LibreELEC-Generic.x86_64-8.0-devel/toolchain/lib/gcc/x86_64-libreelec-linux-gnu/6.2.0/../../../../x86_64-libreelec-linux-gnu/bin/ld.gold: fatal error: lto-wrapper failed
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:160: libvdr-epg2vdr.so] Error 1

    i have no clue what to do with the lto_wrapper stuff and i don't understand why he does not find python

    Edited once, last by magicamun (March 6, 2017 at 5:58 PM).

  • first off I would try to use current master instead of legacy LE 8.0 - there is also VDR 2.3.8 at current master (error sounds like some messed up build dir)

    I tried to include that plugin as well but you need an full blown mysql db server for that - there is no sqlite or similar supported. So you need to add an mysql daemon too. So the whole package (with its dependencies) is such an mess I dropped the idea to include that.

    Not that helpful advice, if you need an proper Webui use Tvheadend instead ;)

  • You don't need the mysql-server to run on the box itself - my use case would be a wetek play 2 with vdr and epg2vdr on it, and the mysql-daemon is running on my backend-server (nas)


    Build - dir was freshly checked out two days ago and the vanilla image built fine.

    if you think it helps, i will setup a fresh vm for that and try again For compatibility reasons i need to stick to Krypton atm

    Edited 2 times, last by magicamun (February 24, 2018 at 11:58 AM).

  • then you are at the wrong branch, current Krypton is 8.2

    As stated in wiki i did:

    Code
    git clone https://github.com/LibreELEC/LibreELEC.tv.git
    
    and 
    
    git checkout 8.2.3
    
    ...

    Anyway - i jut setup a plain VM and am currently building the image (Master) - after that i will try again with the additional packages

  • Ok - back again - what i did:


    - cloned the git - as described here

    pre-downloaded the tools

    Code
    PROJECT=Generic ARCH=x86_64 tools/download-tool

    started (and finished) building an initial (vanilla) image

    Code
    PROJECT=Generic ARCH=x86_64 make image

    works fine upt to here.

    i then added jansson.mk as a package - it is required for epg2vdr

    xxxx@libreelec:/develop/http://LibreELEC.tv/packages/addons/addon-depends$ ls -l jansson/

    insgesamt 4

    -rw-rw-r-- 1 xxxx xxxx 1428 Mär 6 2017 package.mk


    jansson-package.txt


    that builds fine with :

    Code
    xxxx@libreelec:/develop/LibreELEC.tv$ PROJECT=Generic ARCH=x86_64 scripts/build jansson

    i then created a package for epg2vdr:

    Code
    xxxx@libreelec:/develop/LibreELEC.tv/packages/addons/addon-depends/vdr-plugins/vdr-plugin-epg2vdr$ ls -linsgesamt 4-rw-rw-r-- 1 xxxx xxxx 2003 Mär  7  2017 package.mk

    epg2vdr-package.txt

    the build fails with:

    It seems python is "missing" - but i would assume that the build-instructions for epg2vdr need to be tweaked to match a cross-compiling - environment?

  • whoops - that was quick - but unfortunately the version of epg2vdr you took needs tinyxml2 - Version2 - that fails with the packages included LE (Version 1 only!?!)

    I am around the python-stuff though - the Makefiles for epg2vdr need to be tweaked to use pkg-config. i recognized that in some directories of packages there are also patches - are those patches applied automatically or how does that work? For the time beeing i would need to patch the epg2vdr-plugin's Makefile to compile .... -

    right now i am cleaning up everything and start the initial build from scratch - i ended put with the lto - errors ....

    Edited once, last by magicamun (March 3, 2018 at 1:11 PM).

  • Hi again - as stated above - i started over (cleaned everything), took a snapshot of the VM, then tried to build the the package again.

    I am currently trying to get 1.1.91 to be build (just for the records) - so your two commits.

    Here is what happens:

    The error "has no member named 'SetText' ... indicates that it uses Old- Version of tinyxml2 - see here for example.

    I found that under packages/textproc there are two tinyxml's - neither seems suitable to me - what to do?

  • I am around the python-stuff though - the Makefiles for epg2vdr need to be tweaked to use pkg-config. i recognized that in some directories of packages there are also patches - are those patches applied automatically or how does that work? For the time beeing i would need to patch the epg2vdr-plugin's Makefile to compile .... -

    Yes, those patches get applied automagically when the package is being built. The patch file name needs to obey to some naming scheme, however: It needs to start with the name of the package and needs to end with ".patch". And the patch needs to apply with "-p1". Just have a look at patches of some other package to get the idea.

    Unfortunately I cannot help with your other issues; but I'm following this thread as I'm a VDR user myself. Thanks for working on this!

  • The error "has no member named 'SetText' ... indicates that it uses Old- Version of tinyxml2 - see here for example.

    I found that under packages/textproc there are two tinyxml's - neither seems suitable to me - what to do?

    These two versions are tinyxml and tinyxml2 and can be considered two distinct packages. But I assume the tinyxml2 is just a too old version for you (it is at 1.0.12 while the newest version available seems to be 6.1.0). See here. You could try to modify the package.mk of tinyxml2 to use the newer version. However I do not know if this might break other parts of the system.

  • Yes, those patches get applied automagically when the package is being built. The patch file name needs to obey to some naming scheme, however: It needs to start with the name of the package and needs to end with ".patch". And the patch needs to apply with "-p1". Just have a look at patches of some other package to get the idea.

    Unfortunately I cannot help with your other issues; but I'm following this thread as I'm a VDR user myself. Thanks for working on this!

    Works like charm ;) - Thx

    Patch #1 for fixing Makefile and lib/Makefile (python-config to be replaced by pkg-config ...) put under

    vdr-plugin-epg2vdr/patches/01_Makefile-python.patch

  • Works like charm ;) - Thx

    Patch #1 for fixing Makefile and lib/Makefile (python-config to be replaced by pkg-config ...) put under

    vdr-plugin-epg2vdr/patches/01_Makefile-python.patch

    Ahh, so the name of the patch file does not need to start with the package name! This kind of information is not documented anywhere AFAIK, so one needs to learn by try and error and investigating other packages.

    Anyway, I really love libreELEC's build system :)