mirror of
https://git.yoctoproject.org/poky
synced 2026-04-05 08:02:25 +02:00
file: export MAGIC in SDK
Previously, a wrapper is used for file, which adds '--magic-file' option to it. But other components might use libmagic and in such case, if there's no MAGIC environent variable set correctly, things do not work. For example, rpmbuild makes use of libmagic and it requries MAGIC to be set correctly. (From OE-Core rev: 47db876d09d9a4394048579c21d0b394450ce681) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -32,6 +32,7 @@ EXTRA_OEMAKE:append:class-target = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/fi
|
||||
EXTRA_OEMAKE:append:class-nativesdk = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
|
||||
|
||||
FILES:${PN} += "${datadir}/misc/*.mgc"
|
||||
FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/file.sh"
|
||||
|
||||
do_compile:append:class-native() {
|
||||
oe_runmake check
|
||||
@@ -43,8 +44,10 @@ do_install:append:class-native() {
|
||||
}
|
||||
|
||||
do_install:append:class-nativesdk() {
|
||||
create_cmdline_wrapper ${D}/${bindir}/file \
|
||||
--magic-file ${datadir}/misc/magic.mgc
|
||||
mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
|
||||
cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/file.sh
|
||||
export MAGIC="$OECORE_NATIVE_SYSROOT${datadir}/misc/magic.mgc"
|
||||
EOF
|
||||
}
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
Reference in New Issue
Block a user