diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-07-30 13:09:29 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-25 22:27:46 +0000 |
commit | 6bbdd7b56941bc96dcd12c488d4404234f1bfc2f (patch) | |
tree | 1b0d738a8fe6d85d94b73cf013d3deda0ad103bf /meta/classes | |
parent | 5d249ac250e50e8e0f8f33ac34fc2eeb23ca1b5e (diff) | |
download | poky-6bbdd7b56941bc96dcd12c488d4404234f1bfc2f.tar.gz |
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.
(From OE-Core rev: 18e837433d07cfdce4019c13f682c6676425a2ad)
(From OE-Core rev: 97e2d65d1c406bc58fe693e500fcc939459bac1a)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/multilib_script.bbclass | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/meta/classes/multilib_script.bbclass b/meta/classes/multilib_script.bbclass new file mode 100644 index 0000000000..a5a552b716 --- /dev/null +++ b/meta/classes/multilib_script.bbclass | |||
@@ -0,0 +1,32 @@ | |||
1 | # | ||
2 | # Recipe needs to set MULTILIB_SCRIPTS in the form <pkgname>:<scriptname>, e.g. | ||
3 | # MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/file1 ${PN}:${base_bindir}/file2" | ||
4 | # to indicate which script files to process from which packages. | ||
5 | # | ||
6 | |||
7 | inherit update-alternatives | ||
8 | |||
9 | MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}" | ||
10 | |||
11 | PACKAGE_PREPROCESS_FUNCS += "multilibscript_rename" | ||
12 | |||
13 | multilibscript_rename() { | ||
14 | : | ||
15 | } | ||
16 | |||
17 | python () { | ||
18 | # Do nothing if multilib isn't being used | ||
19 | if not d.getVar("MULTILIB_VARIANTS"): | ||
20 | return | ||
21 | # Do nothing for native/cross | ||
22 | if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d): | ||
23 | return | ||
24 | |||
25 | for entry in (d.getVar("MULTILIB_SCRIPTS", False) or "").split(): | ||
26 | pkg, script = entry.split(":") | ||
27 | scriptname = os.path.basename(script) | ||
28 | d.setVar("ALTERNATIVE_" + pkg, scriptname) | ||
29 | d.setVarFlag("ALTERNATIVE_LINK_NAME", scriptname, script) | ||
30 | d.setVarFlag("ALTERNATIVE_TARGET", scriptname, script + "-${MULTILIB_SUFFIX}") | ||
31 | d.appendVar("multilibscript_rename", "\n mv ${PKGD}" + script + " ${PKGD}" + script + "-${MULTILIB_SUFFIX}") | ||
32 | } | ||