Managing RDEPENDS into a recipe

From KoanSoftware Wiki
Jump to: navigation, search

Managing RDEPENDS into a recipe with Yocto Project / Openembedded

If you need to add a shared library into a final image you have to use the RDEPENDS keyword into the recipe. Although the official Yocto Project / Openembedded documentation state that you have to use a simple RDEPENDS keyword specifying the name of the package providing quch library, in some cases you need to specify the '-lib' version of the package providing the library.

For example using 'ncurses' you could expect to use this syntax

 RDEPENDS_${PN} = "ncurses"

which will get you only these files

 $ tar tjvf core-image-minimal-qemuarm.tar.bz2 | grep -i ncurses
 -rw-r--r-- root/root       645 2018-07-25 10:48 ./var/lib/opkg/info/ncurses-terminfo-base.control
 -rw-r--r-- root/root       685 2018-07-25 10:48 ./var/lib/opkg/info/ncurses.control
 -rw-r--r-- root/root       514 2018-07-25 10:48 ./var/lib/opkg/info/ncurses-terminfo-base.list
 -rw-r--r-- root/root       142 2018-07-25 10:48 ./var/lib/opkg/info/ncurses.list


but actually you need to specify this

 RDEPENDS_${PN} = "ncurses-libncurses"

that gives you what needed

 $ tar tjvf core-image-minimal-qemuarm.tar.bz2 | grep -i ncurses
 -rwxr-xr-x root/root    116932 2018-07-25 10:47 ./lib/libncurses.so.5.9
 lrwxrwxrwx root/root         0 2018-07-25 10:47 ./lib/libncurses.so.5 -> libncurses.so.5.9
 -rw-r--r-- root/root       645 2018-07-25 12:24 ./var/lib/opkg/info/ncurses-terminfo-base.control
 -rw-r--r-- root/root       402 2018-07-25 12:24 ./var/lib/opkg/info/libncurses5.control
 -rw-r--r-- root/root        44 2018-07-25 12:24 ./var/lib/opkg/info/libncurses5.list
 -rwxr-xr-x root/root        90 2018-07-25 12:24 ./var/lib/opkg/info/libncurses5.postinst
 -rw-r--r-- root/root       514 2018-07-25 12:24 ./var/lib/opkg/info/ncurses-terminfo-base.list