summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/file
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2023-01-17 12:06:30 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-18 16:42:28 +0000
commitb5ef95f6b1ee83791ce798fbb11c819eaaa694be (patch)
tree9c824d477d4bfaaac6c43fa4aac365ff0f54c34d /meta/recipes-devtools/file
parent1949009c5381c0937e834e6ccbcf263513d56033 (diff)
downloadpoky-b5ef95f6b1ee83791ce798fbb11c819eaaa694be.tar.gz
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>
Diffstat (limited to 'meta/recipes-devtools/file')
-rw-r--r--meta/recipes-devtools/file/file_5.44.bb7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/recipes-devtools/file/file_5.44.bb b/meta/recipes-devtools/file/file_5.44.bb
index b3d821518a..d4b49341b7 100644
--- a/meta/recipes-devtools/file/file_5.44.bb
+++ b/meta/recipes-devtools/file/file_5.44.bb
@@ -32,6 +32,7 @@ EXTRA_OEMAKE:append:class-target = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/fi
32EXTRA_OEMAKE:append:class-nativesdk = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file" 32EXTRA_OEMAKE:append:class-nativesdk = " -e FILE_COMPILE=${STAGING_BINDIR_NATIVE}/file-native/file"
33 33
34FILES:${PN} += "${datadir}/misc/*.mgc" 34FILES:${PN} += "${datadir}/misc/*.mgc"
35FILES:${PN}:append:class-nativesdk = " ${SDKPATHNATIVE}/environment-setup.d/file.sh"
35 36
36do_compile:append:class-native() { 37do_compile:append:class-native() {
37 oe_runmake check 38 oe_runmake check
@@ -43,8 +44,10 @@ do_install:append:class-native() {
43} 44}
44 45
45do_install:append:class-nativesdk() { 46do_install:append:class-nativesdk() {
46 create_cmdline_wrapper ${D}/${bindir}/file \ 47 mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
47 --magic-file ${datadir}/misc/magic.mgc 48 cat <<- EOF > ${D}${SDKPATHNATIVE}/environment-setup.d/file.sh
49 export MAGIC="$OECORE_NATIVE_SYSROOT${datadir}/misc/magic.mgc"
50 EOF
48} 51}
49 52
50BBCLASSEXTEND = "native nativesdk" 53BBCLASSEXTEND = "native nativesdk"