From: Otavio Salvador Date: Fri, 11 Jul 2014 19:32:17 +0000 (-0300) Subject: libfslcodec: Use python functions to split and amend metadata X-Git-Tag: 2.1~907 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=cf138e7067f6151d91cac915da1545f143092cbb;p=meta-freescale.git libfslcodec: Use python functions to split and amend metadata The metadata amending, to include the INSANE_SKIP hacks, need to be done before we run the QA checks. This has change now that the QA checks are run in a separate task. To accomodate the code to this the recipe needed to be reworked to use separated methods to: - split the packages for the plugins; - generate the needed rdepends for the meta package; - apply the quirks; Signed-off-by: Otavio Salvador --- diff --git a/meta-fsl-arm/recipes-multimedia/libfslcodec/libfslcodec.inc b/meta-fsl-arm/recipes-multimedia/libfslcodec/libfslcodec.inc index 8ce80bc9..8bc3e487 100644 --- a/meta-fsl-arm/recipes-multimedia/libfslcodec/libfslcodec.inc +++ b/meta-fsl-arm/recipes-multimedia/libfslcodec/libfslcodec.inc @@ -40,25 +40,36 @@ do_install_append() { } -python populate_packages_prepend() { - codecdir = bb.data.expand('${libdir}', d) - do_split_packages(d, codecdir, '^lib_([^_]*).*_arm.*_elinux\.so\..*', - aux_files_pattern='${libdir}/imx-mm/audio-codec/wrap/lib_%sd_wrap_arm*_elinux.so.*', - output_pattern='libfslcodec-%s', - description='Freescale i.MX Codec (%s)', - extra_depends='') +python __set_insane_skip() { + # Ensure we have PACKAGES expanded + bb.build.exec_func("read_subpackage_metadata", d) - # FIXME: All binaries lack GNU_HASH in elf binary but as we don't have - # the source we cannot fix it. Disable the insane check for now. for p in d.getVar('PACKAGES', True).split(): + # Even though we are packaging libraries those are plugins so we + # shouldn't rename the packages to follow its sonames. d.setVar("DEBIAN_NOAUTONAME_%s" % p, "1") + # FIXME: All binaries lack GNU_HASH in elf binary but as we don't have + # the source we cannot fix it. Disable the insane check for now. if p == 'libfslcodec-test-bin': # FIXME: includes the DUT .so files so we need to deploy those d.setVar("INSANE_SKIP_%s" % p, "ldflags textrel libdir") else: d.setVar("INSANE_SKIP_%s" % p, "ldflags textrel") +} +do_package_qa[prefuncs] += "__set_insane_skip" + +python __split_libfslcodec_plugins() { + codecdir = bb.data.expand('${libdir}', d) + do_split_packages(d, codecdir, '^lib_([^_]*).*_arm.*_elinux\.so\..*', + aux_files_pattern='${libdir}/imx-mm/audio-codec/wrap/lib_%sd_wrap_arm*_elinux.so.*', + output_pattern='libfslcodec-%s', + description='Freescale i.MX Codec (%s)', + extra_depends='') +} + +python __set_metapkg_rdepends() { # Allow addition of all codecs in a image; useful specially for # debugging. codec_pkgs = oe.utils.packages_filter_out_system(d) @@ -67,6 +78,8 @@ python populate_packages_prepend() { d.appendVar('RDEPENDS_libfslcodec-meta', ' ' + ' '.join(codec_pkgs)) } +PACKAGESPLITFUNCS =+ "__split_libfslcodec_plugins __set_metapkg_rdepends" + # Ensure we get warnings if we miss something FILES_${PN} = ""