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?
HOw to add a vdr - plugin to LE build?
-
magicamun -
February 27, 2017 at 1:13 PM -
Thread is Unresolved
-
-
I'd like to push this - i would like to get vdr-plugin-epg2vdr running on my LE 8 on Wetek.
How can i achieve that?
Build-Environment is available
-
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:
Code
Display More# # OpenELEC is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with OpenELEC. If not, see <http://www.gnu.org/licenses/>. ################################################################################ PKG_NAME="vdr-plugin-epg2vdr" PKG_VERSION="master" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="https://projects.vdr-developer.org/projects/plg-epg2vdr" PKG_URL="https://projects.vdr-developer.org/git/vdr-plugin-epg2vdr.git/snapshot/$PKG_NAME-$PKG_VERSION.tar.gz" PKG_DEPENDS_TARGET="toolchain zlib vdr mysql util-linux:libuuid jansson libarchive" PKG_SECTION="multimedia" PKG_SHORTDESC="vdr-epg2vdr" PKG_LONGDESC="vdr-epg2vdr" PKG_IS_ADDON="no" PKG_AUTORECONF="no" make_target() { VDR_DIR=$(get_build_dir vdr) export PKG_CONFIG_PATH=$VDR_DIR:$PKG_CONFIG_PATH export CPLUS_INCLUDE_PATH=$VDR_DIR/include make \ LIBDIR="." \ LOCDIR="./locale" \ all install-i18n } post_make_target() { VDR_DIR=$(get_build_dir vdr) VDR_APIVERSION=`sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$/\1/p' $VDR_DIR/config.h` LIB_NAME=lib${PKG_NAME/-plugin/} cp --remove-destination $ROOT/$PKG_BUILD/${LIB_NAME}.so $ROOT/$PKG_BUILD/${LIB_NAME}.so.${VDR_APIVERSION} $STRIP libvdr-*.so* } makeinstall_target() { : # installation not needed, done by create-addon script }
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
-
I'd like to push that again - any ideas about the lto-wrapper?
-
- Official Post
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
-
- Official Post
You don't need the mysql-server to run on the box itself
yea then you still need some second box that runs the db - so nothing to include for the masses
Build - dir was freshly checked out two days ago and the vanilla image built fine.
then you are at the wrong branch, current Krypton is 8.2
-
then you are at the wrong branch, current Krypton is 8.2
As stated in wiki i did:
Anyway - i jut setup a plain VM and am currently building the image (Master) - after that i will try again with the additional packages
-
- Official Post
If you have some progress just report, maybe we could use it in some way
-
Sure - still building the image - i ran out of space and had to reconfigure the mount (nfs-share) - i will report
-
Ok - back again - what i did:
- cloned the git - as described herepre-downloaded the tools
started (and finished) building an initial (vanilla) 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
that builds fine with :
i then created a package for epg2vdr:
Codexxxx@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
the build fails with:
Code
Display Morexxxx@libreelec:/develop/LibreELEC.tv$ PROJECT=Generic ARCH=x86_64 scripts/build vdr-plugin-epg2vdr BUILD vdr-plugin-epg2vdr (target) TOOLCHAIN make (auto-detect) (cd lib && make -s lib) make[1]: python-config: Command not found make[1]: python-config: Command not found Compile searchtimer ... In file included from searchtimer.c:8:0: python.h:11:20: fatal error: Python.h: No such file or directory compilation terminated. make[1]: *** [Makefile:90: searchtimer.o] Error 1 make: *** [Makefile:115: hlib] Error 2
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?
-
- Official Post
I am not too sure about the python-config, I asked if someone knows how it works.
I added your packes + converted it to LE9 + updated it to latest versions here (last 2 commits)
Commits · CvH/LibreELEC.tv · GitHub
btw pls use pastebin for your packages pastes uploading/downloading txt is too much work
-
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 ....
-
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:
Code
Display Morelutz@libreelec:/develop/LibreELEC.tv$ PROJECT=Generic ARCH=x86_64 scripts/build vdr-plugin-epg2vdr BUILD vdr-plugin-epg2vdr (target) TOOLCHAIN make (auto-detect) (cd lib && make -s lib) Compile xml ... xml.c: In member function 'tinyxml2::XMLNode* cXml::appendElement(const char*, const char*, tinyxml2::XMLNode*)': xml.c:53:13: error: 'class tinyxml2::XMLElement' has no member named 'SetText' element->SetText(value); ^ xml.c: In member function 'tinyxml2::XMLNode* cXml::appendElement(const char*, int, tinyxml2::XMLNode*)': xml.c:64:13: error: 'class tinyxml2::XMLElement' has no member named 'SetText' element->SetText(value); ^ make[1]: *** [Makefile:87: xml.o] Error 1 make: *** [Makefile:117: hlib] Error 2 lutz@libreelec:/develop/LibreELEC.tv$
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
-