[oe-commits] [openembedded-core] 01/14: multilib_script: Add support for multilib scripts

git at git.openembedded.org git at git.openembedded.org
Tue Jul 31 21:56:11 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 18e837433d07cfdce4019c13f682c6676425a2ad
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Mon Jul 30 13:09:29 2018 +0000

    multilib_script: Add support for multilib scripts
    
    Whilst the package managers handle multilib ELF binaries well, they don't
    handle scripts in the *bindir directories well. This adds support for
    marking these up so that they can be handled using update-alternatives.
    
    Its done this way so that non-multilib systems don't see any changes and
    there is standardisation amongst the multilibs on how the alternatives are
    named and prioritiesd. The priotitisation code needs to be added but this
    change means there is somewhere to add it.
    
    Recipe needs to set MULTILIB_SCRIPTS in the form <pkgname>:<scriptname>, e.g.
    MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/file1 ${PN}:${base_bindir}/file2"
    to indicate which script files to process from which packages.
    
    libtool is used a as a reference to stop the libtool scripts conflicting
    in a multilib case and allows the kernel-devsrc change to be merged.
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/classes/multilib_script.bbclass           | 32 ++++++++++++++++++++++++++
 meta/recipes-devtools/libtool/libtool_2.4.6.bb |  4 ++++
 2 files changed, 36 insertions(+)

diff --git a/meta/classes/multilib_script.bbclass b/meta/classes/multilib_script.bbclass
new file mode 100644
index 0000000..a5a552b
--- /dev/null
+++ b/meta/classes/multilib_script.bbclass
@@ -0,0 +1,32 @@
+#
+# Recipe needs to set MULTILIB_SCRIPTS in the form <pkgname>:<scriptname>, e.g.
+# MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/file1 ${PN}:${base_bindir}/file2"
+# to indicate which script files to process from which packages.
+#
+
+inherit update-alternatives
+
+MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}"
+
+PACKAGE_PREPROCESS_FUNCS += "multilibscript_rename"
+
+multilibscript_rename() {
+	:
+}
+
+python () {
+    # Do nothing if multilib isn't being used
+    if not d.getVar("MULTILIB_VARIANTS"):
+       return
+    # Do nothing for native/cross
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d):
+       return
+
+    for entry in (d.getVar("MULTILIB_SCRIPTS", False) or "").split():
+       pkg, script = entry.split(":")
+       scriptname = os.path.basename(script)
+       d.setVar("ALTERNATIVE_" + pkg, scriptname)
+       d.setVarFlag("ALTERNATIVE_LINK_NAME", scriptname, script)
+       d.setVarFlag("ALTERNATIVE_TARGET", scriptname, script + "-${MULTILIB_SUFFIX}")
+       d.appendVar("multilibscript_rename",  "\n	mv ${PKGD}" + script + " ${PKGD}" + script + "-${MULTILIB_SUFFIX}")
+}
diff --git a/meta/recipes-devtools/libtool/libtool_2.4.6.bb b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
index b02620b..b8a5240 100644
--- a/meta/recipes-devtools/libtool/libtool_2.4.6.bb
+++ b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -26,3 +26,7 @@ do_install_append () {
             -e "s@${HOSTTOOLS_DIR}/@@g" \
             -i ${D}${bindir}/libtool
 }
+
+inherit multilib_script
+
+MULTILIB_SCRIPTS = "${PN}:${bindir}/libtool"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list