1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# Copyright (C) 2012-2016 Freescale Semiconductor
# Copyright (C) 2017-2025 NXP
# Copyright 2018 (C) O.S. Systems Software LTDA.
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "i.MX multimedia codec libraries"
DESCRIPTION = "Freescale Multimedia codec libs"
HOMEPAGE = "https://www.nxp.com/"
SECTION = "multimedia"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://COPYING;md5=a93b654673e1bc8398ed1f30e0813359"
# Backward compatibility
PROVIDES += "libfslcodec"
SRC_URI = "${FSL_MIRROR}/${BPN}-${PV}-${IMX_SRCREV_ABBREV}.bin;fsl-eula=true"
SRC_URI[sha256sum] = "82242219e0d3536aeff31d9c215543bfe5541540bdb4fa8d61e83067b015e31f"
IMX_SRCREV_ABBREV = "464e9d8"
inherit fsl-eula-unpack autotools pkgconfig
S = "${UNPACKDIR}/${BPN}-${PV}-${IMX_SRCREV_ABBREV}"
PACKAGECONFIG ??= "${PACKAGECONFIG_VPU}"
# Support Chips&Media VPU only
PACKAGECONFIG_VPU = ""
PACKAGECONFIG_VPU:mx6q-nxp-bsp = "vpu"
PACKAGECONFIG_VPU:mx6dl-nxp-bsp = "vpu"
PACKAGECONFIG[vpu] = "--enable-vpu,--disable-vpu,virtual/imxvpu"
# Choose between 32-bit and 64-bit binaries and between Soft Float-Point and Hard Float-Point
EXTRA_OECONF = "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '--enable-armv8', \
bb.utils.contains('TUNE_FEATURES', 'callconvention-hard', '--enable-fhw', '', d), d)}"
do_install:append() {
# LTIB move the files around or gst-fsl-plugin won't find them
for p in $(find ${D}${libdir}/imx-mm -mindepth 2 -maxdepth 2 -not -type d); do
mv $p ${D}${libdir}
done
rmdir ${D}${libdir}/imx-mm/video-codec
# Fixup ownership of files
chown -R root:root ${D}
}
python __set_insane_skip() {
# Ensure we have PACKAGES expanded
bb.build.exec_func("read_subpackage_metadata", d)
for p in d.getVar('PACKAGES').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 == 'imx-codec-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")
}
__set_insane_skip[doc] = "Set DEBIAN_NOAUTONAME and INSANE_SKIP for the prebuilt codec plugin packages."
do_package_qa[prefuncs] += "__set_insane_skip"
python __split_libfslcodec_plugins() {
codecdir = bb.data.expand('${libdir}', d)
do_split_packages(d, codecdir, r'^lib_([^_]*).*_arm.*_elinux\.so\..*',
aux_files_pattern='${libdir}/imx-mm/audio-codec/wrap/lib_%sd_wrap_arm*_elinux.so.*',
output_pattern='imx-codec-%s',
description='Freescale i.MX Codec (%s)',
extra_depends='')
pkgs = d.getVar('PACKAGES').split()
for pkg in pkgs:
meta = pkg[10:]
if meta != '':
d.setVar('RREPLACES:%s' % pkg, ' libfslcodec-%s' % meta)
d.setVar('RPROVIDES:%s' % pkg, ' libfslcodec-%s' % meta)
d.setVar('RCONFLICTS:%s' % pkg, ' libfslcodec-%s' % meta)
else :
d.setVar('RREPLACES:%s' % pkg, ' libfslcodec')
d.setVar('RPROVIDES:%s' % pkg, ' libfslcodec')
d.setVar('RCONFLICTS:%s' % pkg, ' libfslcodec')
}
__split_libfslcodec_plugins[doc] = "Split the codec plugin .so files into per-codec packages."
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)
codec_pkgs = filter(lambda x: x not in ['imx-codec-test-bin', 'imx-codec-test-source'],
codec_pkgs)
d.appendVar('RDEPENDS:imx-codec-meta', ' ' + ' '.join(codec_pkgs))
}
__set_metapkg_rdepends[doc] = "Make the -meta package RDEPEND on all split codec packages."
PACKAGESPLITFUNCS =+ "__split_libfslcodec_plugins __set_metapkg_rdepends"
PACKAGE_ARCH = "${MACHINE_SOCARCH}"
# We need to ensure we don't have '-src' package overrided
PACKAGE_DEBUG_SPLIT_STYLE = 'debug-without-src'
PACKAGES_DYNAMIC = "${PN}-*"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
PACKAGES += "${PN}-meta ${PN}-test-bin ${PN}-test-source"
ALLOW_EMPTY:${PN} = "1"
ALLOW_EMPTY:${PN}-meta = "1"
# Reset PN's default FILES to empty so any unpackaged file is flagged as a
# warning instead of silently landing in the main package.
# nooelint: oelint.var.filesoverride
FILES:${PN} = ""
FILES:${PN}-dev += "${libdir}/imx-mm/*/*${SOLIBSDEV} \
${libdir}/imx-mm/*/*/*${SOLIBSDEV} \
${libdir}/pkgconfig/*.pc ${includedir}/imx-mm/*"
FILES:${PN}-test-bin += "${datadir}/imx-mm/*/examples/*/bin"
FILES:${PN}-test-source += "${datadir}/imx-mm/*"
# FIXME: The wrap and lib names does not match
FILES:${PN}-oggvorbis += "${libdir}/imx-mm/audio-codec/wrap/lib_vorbisd_wrap_arm*_elinux.so.*"
FILES:${PN}-nb += "${libdir}/imx-mm/audio-codec/wrap/lib_nbamrd_wrap_arm*_elinux.so.*"
FILES:${PN}-wb += "${libdir}/imx-mm/audio-codec/wrap/lib_wbamrd_wrap_arm*_elinux.so.*"
COMPATIBLE_MACHINE = "(imx-nxp-bsp)"
|