LinuxMCE Forums

General => Users => Topic started by: gazlang on May 27, 2008, 12:11:51 pm

Title: VDR Plugins How-to?
Post by: gazlang on May 27, 2008, 12:11:51 pm
Hi,

I want to get some plugins for VDR running on x64 LMCE, one of which is the lcdproc plugin. I am not 100% on what I should do to compile plugins in LMCE.

I have read this how-to http://smart-home-blog.com/writes/configure-imon-padvfd-in-plutohome but don't really understand what the VDR sources are, where the "<your_vdr_src_dir>/PLUGINS/src" is, or whether I need to patch the plugin sources as well.

I also notice that the link for the x64 pre-built deb package is no longer available, so can't do it the easy way :-)

I would be greatful if someone could give me a comprehensive step by step on this.

Cheers
Title: Re: VDR Plugins How-to?
Post by: nite_man on May 28, 2008, 03:43:48 pm
gazlang, when I built LCD VDR plugin I just downloaded VDR 1.4.7, installed VDR headers from LinuxMCE and used them to compile the plugin. I'll fix the link tonight. So, you'll be able to download plugin's package. But note that for the latest LinuxMCE version you should use VDR 1.6.0 not 1.4.7.
Title: Re: VDR Plugins How-to?
Post by: gazlang on May 28, 2008, 04:11:40 pm
Cheers niteman.


I assume VDR headers is vdr-dev, but how do I use this to build a plugin??
And also, I assume I just download VDR 1.6.0 and NOT attempt to make / install, but just extract it and put the plugin into the PLUGIN folder and run make plugins?

If I just download and run the .deb package (if you fix it) do I need to Download VDR and headers?

--Obviosly completely new to VDR and plugins :) --
Title: Re: VDR Plugins How-to?
Post by: nite_man on May 29, 2008, 08:31:24 am
Well, I refreshed my memory a bit and found the way how I built plug-ins. I installed vdr-dev contained patched headers from LinuxMCE. Then I downloaded from Ubuntu repository sources of desired plug-in (vdr-lcdproc, in my case). Unpacked them and built deb package using
Code: [Select]
dpkg-buildpackage -rfakeroot. That's it.

I prefer to use deb package because it'll be much easily to install it on others PC.

Hope it helped you.
Title: Re: VDR Plugins How-to?
Post by: gazlang on May 29, 2008, 12:10:11 pm
So do I just:

Code: [Select]
sudo apt-get install vdr-dev
Then download and untar the vdr-lcdproc-plugin

enter the vdr-lcdproc-plugin directory and run

Code: [Select]
dpkg-buildpackage -rfakeroot

Title: Re: VDR Plugins How-to?
Post by: nite_man on May 29, 2008, 02:39:05 pm
Before run dpkg-buildpackage -rfakeroot you should apply ubuntu patch - <some_package_name.diff>. It can be found in the source section:

Code: [Select]
patch -p1 < ../vdr-plugin-<plugin_name>.diff
Note: you should be in the plugin directory. After applying the patch the new directory will be created there - debian. It contains package definitions. Also you should change node of file debian/rules to make it executable.
Title: Re: VDR Plugins How-to?
Post by: gazlang on May 29, 2008, 11:44:40 pm
Cheers,

I got as far as building the package, but it failed on a dependency - which I guess is lcdproc (even though I have lcdproc installed from source)

I guess it is lcdproc as I downloaded a pre-built lcdproc-plugin.deb from ubuntu and that too required installation of lcdproc. After installing the .deb successfully (and adding another lcdproc) I restarted vdr and had the message:
Quote
WARNING: The following plugins have been left out due to possible binary incompatibility: lcdproc.
I uninstalled the plugin and tried installing it following these instructions:
Quote
Download and untar somewhere appropriate version of VDR sources (1.4.7 in case of LinuxMCE)
Download the latest version of vdr-lcdproc plug-in
Untar it into <your_vdr_src_dir>/PLUGINS/src and make a symlink - ln -s lcdproc-0.0.10-jw2 lcdproc
Build plug-in: make plugins. Note, for AMD64 you should add option -fPIC to the CXXFLAGS into lcdproc Makefile. Otherwise you’ll get this error:
 /usr/bin/ld: lcdproc.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
 lcdproc.o: could not read symbols: Bad value
Copy <your_vdr_src_dir>/PLUGINS/lib/libvdr-lcdproc.so.1.4.5 to the /usr/lib/vdr/plugins
Add a new config file plugin.lcdproc.conf into /etc/vdr/plugins and put there following options:
 -h 127.0.0.1
 -p 13666

restarted vdr, and get the same message - lcdproc plugin left out!

Any ideas?
Title: Re: VDR Plugins How-to?
Post by: nite_man on May 30, 2008, 09:00:31 am
Ok, let's start from the beginning:
1. Download vdr-plugin-lcdproc from the Ubuntu site - http://tinyurl.com/5qngff (http://tinyurl.com/5qngff). Actually it's sources from hardy but I think it should be ok for gutsy as well.
2. Download Ubuntu patch - http://tinyurl.com/3khrdk (http://tinyurl.com/3khrdk).
3. Install vdr-dev from LinuxMCE - apt-get install vdr-dev.
4. Untar vdr-plugin-lcdproc somewhere.
5. Goto vdr-plugin-lcdproc directory.
6. Unzip Ubuntu patch somewhere.
7. Apply Ubuntu patch to the vdr-plugin-lcdproc: patch -p1 < path_to_ubuntu_patch_file. Note: you should be inside vdr-plugin-lcdproc directory.
8. Find and replace hardy by gutsy in the created by patch directory debian.
9. Change mode of file debian/rules - chmod +x debian/rules.
10. Build your package - dpkg-buildpackage -rfakeroot. If you'll get that error - Note, for AMD64 you should add option -fPIC to the CXXFLAGS into lcdproc Makefile ... just add option -fPIC to theCXXFLAGS in the  Makefile and run dpkg-buildpackage -rfakeroot again.
11. As result you should get an Ubuntu package and its service files outside vdr-plugin-lcdproc directory.
12. Install built package and restart vdr.
Title: Re: VDR Plugins How-to?
Post by: gazlang on May 30, 2008, 07:01:17 pm
Cheers nite_man, worked like a charm.
Adding the -fPIC option to the makefile results in an error as the deb adds a patch to change this (and fails if it has already changed).
I also removed the lcdproc dependancy from /debian/control before running dpkg... (don't know why it can't detect my lcd-proc!)

Anyway, thanks again