Patchwork [meta-oe,1/9] libav: Convert to use dynamic packages to split libraries

login
register
mail settings
Submitter Otavio Salvador
Date Oct. 4, 2012, 4:03 a.m.
Message ID <1349323389-16520-2-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/37755/
State Accepted
Commit 0c6871b1f628485cc43629b99cefce41a03bc35a
Headers show

Comments

Otavio Salvador - Oct. 4, 2012, 4:03 a.m.
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta-oe/recipes-multimedia/libav/libav.inc |   76 ++++++++++++----------------
 1 files changed, 33 insertions(+), 43 deletions(-)
Martin Jansa - Oct. 5, 2012, 12:25 p.m.
On Thu, Oct 04, 2012 at 01:03:01AM -0300, Otavio Salvador wrote:
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
>  meta-oe/recipes-multimedia/libav/libav.inc |   76 ++++++++++++----------------
>  1 files changed, 33 insertions(+), 43 deletions(-)
> 
> diff --git a/meta-oe/recipes-multimedia/libav/libav.inc b/meta-oe/recipes-multimedia/libav/libav.inc
> index fc0b021..21b57b7 100644
> --- a/meta-oe/recipes-multimedia/libav/libav.inc
> +++ b/meta-oe/recipes-multimedia/libav/libav.inc
> @@ -11,7 +11,7 @@ ARM_INSTRUCTION_SET = "arm"
>  # faac faad2 lame schroedinger libgsm
>  DEPENDS = "virtual/libsdl zlib libogg libvorbis libvpx libtheora ${@base_conditional('ENTERPRISE_DISTRO', '1', '', 'liba52', d)}"
>  
> +PACKAGES_DYNAMIC = "lib*"

Please limit this a bit

NOTE: multiple providers are available for runtime libpurple-protocol-msn (libav, pidgin)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-msn
NOTE: multiple providers are available for runtime libpurple-protocol-icq (libav, pidgin)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-icq
NOTE: multiple providers are available for runtime libpurple-plugin-ssl-gnutls (libav, pidgin)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-plugin-ssl-gnutls
NOTE: multiple providers are available for runtime libpurple-protocol-irc (libav, pidgin)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-irc
NOTE: multiple providers are available for runtime libpurple-protocol-xmpp (libav, pidgin)
NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-xmpp

Cheers,
Otavio Salvador - Oct. 5, 2012, 12:31 p.m.
On Fri, Oct 5, 2012 at 9:25 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> On Thu, Oct 04, 2012 at 01:03:01AM -0300, Otavio Salvador wrote:
>> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>> ---
>>  meta-oe/recipes-multimedia/libav/libav.inc |   76 ++++++++++++----------------
>>  1 files changed, 33 insertions(+), 43 deletions(-)
>>
>> diff --git a/meta-oe/recipes-multimedia/libav/libav.inc b/meta-oe/recipes-multimedia/libav/libav.inc
>> index fc0b021..21b57b7 100644
>> --- a/meta-oe/recipes-multimedia/libav/libav.inc
>> +++ b/meta-oe/recipes-multimedia/libav/libav.inc
>> @@ -11,7 +11,7 @@ ARM_INSTRUCTION_SET = "arm"
>>  # faac faad2 lame schroedinger libgsm
>>  DEPENDS = "virtual/libsdl zlib libogg libvorbis libvpx libtheora ${@base_conditional('ENTERPRISE_DISTRO', '1', '', 'liba52', d)}"
>>
>> +PACKAGES_DYNAMIC = "lib*"
>
> Please limit this a bit
>
> NOTE: multiple providers are available for runtime libpurple-protocol-msn (libav, pidgin)
> NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-msn
> NOTE: multiple providers are available for runtime libpurple-protocol-icq (libav, pidgin)
> NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-icq
> NOTE: multiple providers are available for runtime libpurple-plugin-ssl-gnutls (libav, pidgin)
> NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-plugin-ssl-gnutls
> NOTE: multiple providers are available for runtime libpurple-protocol-irc (libav, pidgin)
> NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-irc
> NOTE: multiple providers are available for runtime libpurple-protocol-xmpp (libav, pidgin)
> NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-xmpp

I just doesn't understand why it didn't happen here...

I try it here to reproduce it and then see how to fix it.
Martin Jansa - Oct. 5, 2012, 1:04 p.m.
On Fri, Oct 05, 2012 at 09:31:03AM -0300, Otavio Salvador wrote:
> On Fri, Oct 5, 2012 at 9:25 AM, Martin Jansa <martin.jansa@gmail.com> wrote:
> > On Thu, Oct 04, 2012 at 01:03:01AM -0300, Otavio Salvador wrote:
> >> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> >> ---
> >>  meta-oe/recipes-multimedia/libav/libav.inc |   76 ++++++++++++----------------
> >>  1 files changed, 33 insertions(+), 43 deletions(-)
> >>
> >> diff --git a/meta-oe/recipes-multimedia/libav/libav.inc b/meta-oe/recipes-multimedia/libav/libav.inc
> >> index fc0b021..21b57b7 100644
> >> --- a/meta-oe/recipes-multimedia/libav/libav.inc
> >> +++ b/meta-oe/recipes-multimedia/libav/libav.inc
> >> @@ -11,7 +11,7 @@ ARM_INSTRUCTION_SET = "arm"
> >>  # faac faad2 lame schroedinger libgsm
> >>  DEPENDS = "virtual/libsdl zlib libogg libvorbis libvpx libtheora ${@base_conditional('ENTERPRISE_DISTRO', '1', '', 'liba52', d)}"
> >>
> >> +PACKAGES_DYNAMIC = "lib*"
> >
> > Please limit this a bit
> >
> > NOTE: multiple providers are available for runtime libpurple-protocol-msn (libav, pidgin)
> > NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-msn
> > NOTE: multiple providers are available for runtime libpurple-protocol-icq (libav, pidgin)
> > NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-icq
> > NOTE: multiple providers are available for runtime libpurple-plugin-ssl-gnutls (libav, pidgin)
> > NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-plugin-ssl-gnutls
> > NOTE: multiple providers are available for runtime libpurple-protocol-irc (libav, pidgin)
> > NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-irc
> > NOTE: multiple providers are available for runtime libpurple-protocol-xmpp (libav, pidgin)
> > NOTE: consider defining a PREFERRED_PROVIDER entry to match libpurple-protocol-xmpp
> 
> I just doesn't understand why it didn't happen here...
> 
> I try it here to reproduce it and then see how to fix it.

You need to pull libpurple-protocol-* as RDEPENDS to your image
together with libav to reproduce it

Cheers,
> 
> -- 
> Otavio Salvador                             O.S. Systems
> E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

Patch

diff --git a/meta-oe/recipes-multimedia/libav/libav.inc b/meta-oe/recipes-multimedia/libav/libav.inc
index fc0b021..21b57b7 100644
--- a/meta-oe/recipes-multimedia/libav/libav.inc
+++ b/meta-oe/recipes-multimedia/libav/libav.inc
@@ -11,7 +11,7 @@  ARM_INSTRUCTION_SET = "arm"
 # faac faad2 lame schroedinger libgsm
 DEPENDS = "virtual/libsdl zlib libogg libvorbis libvpx libtheora ${@base_conditional('ENTERPRISE_DISTRO', '1', '', 'liba52', d)}"
 
-INC_PR = "r4"
+INC_PR = "r5"
 
 inherit autotools pkgconfig
 
@@ -73,7 +73,7 @@  do_install_append() {
 FFMPEG_LIBS = "libavcodec libavdevice libavformat \
                libavutil libpostproc libswscale libavfilter"
 
-PACKAGES += "${PN}-vhook-dbg ${PN}-vhook"
+PACKAGES += "${PN}-vhook-dbg ${PN}-vhook ffmpeg-x264-presets"
 
 RSUGGESTS_${PN} = "mplayer"
 FILES_${PN} = "${bindir}"
@@ -82,51 +82,41 @@  FILES_${PN}-dev = "${includedir}/${PN}"
 FILES_${PN}-vhook = "${libdir}/vhook"
 FILES_${PN}-vhook-dbg += "${libdir}/vhook/.debug"
 
-
-PACKAGES += "ffmpeg-x264-presets \
-             libavcodec  libavcodec-dev  libavcodec-dbg \
-             libavdevice libavdevice-dev libavdevice-dbg \
-             libavformat libavformat-dev libavformat-dbg \
-             libavutil   libavutil-dev   libavutil-dbg \
-             libpostproc libpostproc-dev libpostproc-dbg \
-             libswscale  libswscale-dev  libswscale-dbg \
-             libavfilter libavfilter-dev libavfilter-dbg \
-             libavcore   libavcore-dev   libavcore-dbg \
-            "
-
 FILES_ffmpeg-x264-presets = "${datadir}/*.ffpreset"
 
 LEAD_SONAME = "libavcodec.so"
 
 FILES_${PN}-dev = "${includedir}"
-FILES_libavcodec = "${libdir}/libavcodec*.so.*"
-FILES_libavcodec-dev = "${libdir}/libavcodec*.so ${libdir}/pkgconfig/libavcodec.pc ${libdir}/libavcodec*.a"
-FILES_libavcodec-dbg += "${libdir}/.debug/libavcodec*"
-
-FILES_libavdevice = "${libdir}/libavdevice*.so.*"
-FILES_libavdevice-dev = "${libdir}/libavdevice*.so ${libdir}/pkgconfig/libavdevice.pc ${libdir}/libavdevice*.a"
-FILES_libavdevice-dbg += "${libdir}/.debug/libavdevice*"
-
-FILES_libavformat = "${libdir}/libavformat*.so.*"
-FILES_libavformat-dev = "${libdir}/libavformat*.so ${libdir}/pkgconfig/libavformat.pc ${libdir}/libavformat*.a"
-FILES_libavformat-dbg += "${libdir}/.debug/libavformat*"
 
-FILES_libavutil = "${libdir}/libavutil*.so.*"
-FILES_libavutil-dev = "${libdir}/libavutil*.so ${libdir}/pkgconfig/libavutil.pc ${libdir}/libavutil*.a"
-FILES_libavutil-dbg += "${libdir}/.debug/libavutil*"
-
-FILES_libpostproc = "${libdir}/libpostproc*.so.*"
-FILES_libpostproc-dev = "${libdir}/libpostproc*.so  ${libdir}/pkgconfig/libpostproc.pc ${libdir}/libpostproc*.a ${includedir}/postproc"
-FILES_libpostproc-dbg += "${libdir}/.debug/libpostproc*"
-
-FILES_libswscale = "${libdir}/libswscale*.so.*"
-FILES_libswscale-dev = "${libdir}/libswscale*.so ${libdir}/pkgconfig/libswscale.pc ${libdir}/libswscale*.a"
-FILES_libswscale-dbg += "${libdir}/.debug/libswscale*"
-
-FILES_libavfilter = "${libdir}/libavfilter*.so.*"
-FILES_libavfilter-dev = "${libdir}/libavfilter*.so ${libdir}/pkgconfig/libavfilter.pc ${libdir}/libavfilter*.a"
-FILES_libavfilter-dbg += "${libdir}/.debug/libavfilter*"
+python populate_packages_prepend() {
+    av_libdir = bb.data.expand('${libdir}', d)
+    av_pkgconfig = bb.data.expand('${libdir}/pkgconfig', d)
+
+    # Runtime package
+    do_split_packages(d, av_libdir, '^lib(.*)\.so\..*',
+                      output_pattern='lib%s',
+                      description='libav %s library',
+                      prepend=True,
+                      allow_links=True)
+
+    # Development packages (-dev, -staticdev)
+    do_split_packages(d, av_libdir, '^lib(.*)\.so$',
+                      output_pattern='lib%s-dev',
+                      description='libav %s development package',
+                      extra_depends='${PN}-dev',
+                      prepend=True,
+                      allow_links=True)
+    do_split_packages(d, av_pkgconfig, '^lib(.*)\.pc$',
+                      output_pattern='lib%s-dev',
+                      description='libav %s development package',
+                      extra_depends='${PN}-dev',
+                      prepend=True)
+    do_split_packages(d, av_libdir, '^lib(.*)\.a$',
+                      output_pattern='lib%s-staticdev',
+                      description='libav %s development package - static library',
+                      extra_depends='${PN}-dev',
+                      prepend=True,
+                      allow_links=True)
+}
 
-FILES_libavcore = "${libdir}/libavcore*.so.*"
-FILES_libavcore-dev = "${libdir}/libavcore*.so ${libdir}/pkgconfig/libavcore.pc ${libdir}/libavcore*.a"
-FILES_libavcore-dbg += "${libdir}/.debug/libavcore*"
+PACKAGES_DYNAMIC = "lib*"