From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] uninative/mtools: Set GCONV_PATH centrally to ensure the correct value
Date: Sat, 05 Mar 2016 09:40:04 +0000 [thread overview]
Message-ID: <1457170804.2804.72.camel@linuxfoundation.org> (raw)
The existing GCONV_PATH set in the mcopy wrapper doens't work with the updated
uninative directory layout. It also means that it might not work correctly in the
native case when uninative is not in use.
Tweak uninative to set GCONV_PATH into the environment for everything to
avoid these problems. Refactoring the code in uninative into a function
is beneficial at this point.
Based on a patch from Randy Witt.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 7f242de..6abcbed 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -57,9 +57,7 @@ python uninative_event_fetchloader() {
cmd = d.expand("mkdir -p ${STAGING_DIR}-uninative; cd ${STAGING_DIR}-uninative; tar -xjf ${UNINATIVE_DLDIR}/${UNINATIVE_TARBALL}; ${STAGING_DIR}-uninative/relocate_sdk.py ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${STAGING_DIR}-uninative/${BUILD_ARCH}-linux/${bindir_native}/patchelf-uninative")
subprocess.check_call(cmd, shell=True)
- d.setVar("NATIVELSBSTRING", "universal")
- d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
- d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
+ enable_uninative(d)
except bb.fetch2.BBFetchException as exc:
bb.warn("Disabling uninative as unable to fetch uninative tarball: %s" % str(exc))
@@ -76,14 +74,21 @@ python uninative_event_enable() {
This event handler is called in the workers and is responsible for setting
up uninative if a loader is found.
"""
+ enable_uninative(d)
+}
+def enable_uninative(d):
loader = d.getVar("UNINATIVE_LOADER", True)
if os.path.exists(loader):
bb.debug(2, "Enabling uninative")
d.setVar("NATIVELSBSTRING", "universal")
+
+ uninative_dir = "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux"
d.appendVar("SSTATEPOSTUNPACKFUNCS", " uninative_changeinterp")
- d.prependVar("PATH", "${STAGING_DIR}-uninative/${BUILD_ARCH}-linux${bindir_native}:")
-}
+ d.prependVar("PATH", "%s${bindir_native}:" % uninative_dir)
+ # We need this so mcopy (mtools) can find codepages correctly for example
+ d.setVar("GCONV_PATH", "%s${libdir_native}/gconv" % uninative_dir)
+ d.setVarFlag("GCONV_PATH", "export", "1")
python uninative_changeinterp () {
import subprocess
diff --git a/meta/recipes-devtools/mtools/mtools_3.9.9.bb b/meta/recipes-devtools/mtools/mtools_3.9.9.bb
index 26d52a9..3423917 100644
--- a/meta/recipes-devtools/mtools/mtools_3.9.9.bb
+++ b/meta/recipes-devtools/mtools/mtools_3.9.9.bb
@@ -51,8 +51,3 @@ do_install_prepend () {
mkdir -p ${D}/${bindir}
mkdir -p ${D}/${datadir}
}
-
-do_install_append_class-native () {
- create_wrapper ${D}${bindir}/mcopy \
- GCONV_PATH=${libdir}/gconv
-}
diff --git a/meta/recipes-devtools/mtools/mtools_4.0.18.bb b/meta/recipes-devtools/mtools/mtools_4.0.18.bb
index 479fd32..efde547 100644
--- a/meta/recipes-devtools/mtools/mtools_4.0.18.bb
+++ b/meta/recipes-devtools/mtools/mtools_4.0.18.bb
@@ -48,8 +48,3 @@ do_install_prepend () {
mkdir -p ${D}/${bindir}
mkdir -p ${D}/${datadir}
}
-
-do_install_append_class-native () {
- create_wrapper ${D}${bindir}/mcopy \
- GCONV_PATH=${libdir}/gconv
-}
reply other threads:[~2016-03-05 9:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457170804.2804.72.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox