Skip to contentSkip to conversation

libcec needs to be patched to provide a correct libcec.pc

Buildroot Yann E. MORIN 2 participants 3 messages Jun 13, 2014 – Jun 14, 2014

lore
Share & tools
lore
#0 lore raw

Bernd, All,

You previously said (on IRC) that "libcec needs to be patched in order to provide a correct libcec.pc"

What I saw is that libcec.pc has:

    Libs: -L${libdir} -lcec

Do you mean it should also have -ludev, like:

    Libs: -L${libdir} -lcec -ludev

The issue I see with adding -ludev is:
- libcec can not be built static, so it is always built as a .so
- libcec.so has a DT_NEEDED tag on libudev.so.1
- normally, the linker will follow the DT_NEEDED flags of .so

So, linking a program against -lcec should be enough (unless that program itself requires -ludev, but then it should specify it, and that's unrelated to libcec)

Can you elaborate a bit on why and how we should patch libcec.pc, please?

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#1 lore raw

Hi Yann,

"Yann E. MORIN" <[email protected]> wrote in news:20140613212754.GB16169 at free.fr:

Quoted 2 lines

Can you elaborate a bit on why and how we should patch libcec.pc, please?

when libcec finds libudev during configure output/staging/usr/lib/pkgconfig/libcec.pc will contain

Requires: udev

When xbmc configure searches for libcec it finds this requirement and tries to find udev.pc, which fails when only libudev is present:

checking for UDEV... yes
configure: == libusb disabled. ==
checking for CEC... no
configure: error: == libcec disabled. CEC adapter support will not be available. ==

xbmc/config.log shows:

configure:29084: $PKG_CONFIG --exists --print-errors "libcec >= 2.1.0" Package udev was not found in the pkg-config search path. Perhaps you should add the directory containing `udev.pc' to the PKG_CONFIG_PATH environment variable
No package 'udev' found

So we need to patch libcec/configure.ac in line 237 from

REQUIRES="$REQUIRES udev"

to

REQUIRES="$REQUIRES libudev"

to make xbmc happy.

Regards, Bernd

#2 lore raw

Bernd, All,

On 2014-06-14 05:52 +0200, Bernd Kuhls spake thusly:

Quoted 29 lines

"Yann E. MORIN" <[email protected]> wrote in news:20140613212754.GB16169 at free.fr:

Quoted 2 lines

Can you elaborate a bit on why and how we should patch libcec.pc, please?

when libcec finds libudev during configure output/staging/usr/lib/pkgconfig/libcec.pc will contain

Requires: udev

When xbmc configure searches for libcec it finds this requirement and tries to find udev.pc, which fails when only libudev is present:

checking for UDEV... yes
configure: == libusb disabled. ==
checking for CEC... no
configure: error: == libcec disabled. CEC adapter support will not be available. ==

xbmc/config.log shows:

configure:29084: $PKG_CONFIG --exists --print-errors "libcec >= 2.1.0" Package udev was not found in the pkg-config search path. Perhaps you should add the directory containing `udev.pc' to the PKG_CONFIG_PATH environment variable
No package 'udev' found

So we need to patch libcec/configure.ac in line 237 from

Quoted 7 lines

REQUIRES="$REQUIRES udev"

to

REQUIRES="$REQUIRES libudev"

to make xbmc happy.

Ah! OK, I get it now! Thanks for the thorough explanations. :-)

And indeed, my libudev-only small test-case obviously demonstrates the above:

    $ ls -l staging/usr/lib/pkgconfig/
    total 8
    -rw-r--r-- 1 ymorin ymorin 278 Jun 13 22:58 libcec.pc
->  -rw-r--r-- 1 ymorin ymorin 509 Jun 13 22:49 libudev.pc
    $ cat staging/usr/lib/pkgconfig/libcec.pc
    prefix=/usr
    exec_prefix=/usr
    libdir=${exec_prefix}/lib
    includedir=${prefix}/include

Name: libcec
Description: Pulse-Eight CEC adapter library
URL: http://www.pulse-eight.com/
Version: 2:1:0
-> Requires: udev

    Libs: -L${libdir} -lcec
    Cflags: -I${includedir} -I${includedir}/libcec

So, in case we only provide a libudev, can't we just simlink udev.pc to libudev.pc (or the other way around) as we won't patch every and all packages in the wild?

I'll do the symlinking unless there is a good reason not to.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'