python-sdbus++: remove sdbus++ executable
When moving all packages over to use ${PYTHON_PN}-sdbus++ instead of
the (python2-based) sdbus++ alias, I ran into frequent problems where
BOTH python-sdbus++ and python3-sdbus++ were in the DEPEND-chain. When
this happens, bitbake is upset because both packages install the sdbus++
executable. (Both are in the DEPEND-chain because some packages have
transitioned to python3 and some have not.)
There are two reasons someone might depend on the python-sdbus++-native
package:
1. They need to use the sdbus++ executable to generate code.
2. They wrote their own scripts leveraging sdbus++'s module.
For #1, we can force everyone to use the python3 varient by adding
a DEPEND on python3-sdbus++-native and then removing sdbus++ (the
executable). This will continue to install the python modules for #2.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ibb55ff061f94ff0abdb48d432b8d344b501b694e
diff --git a/recipes-extended/sdbusplus/python-sdbus++_git.bb b/recipes-extended/sdbusplus/python-sdbus++_git.bb
index 7bb0198..de4d6ba 100644
--- a/recipes-extended/sdbusplus/python-sdbus++_git.bb
+++ b/recipes-extended/sdbusplus/python-sdbus++_git.bb
@@ -7,3 +7,12 @@
# new package name.
PROVIDES_class-native += "sdbusplus-native sdbus++-native"
PROVIDES_class-nativesdk += "sdbusplus-nativesdk sdbus++-nativesdk"
+
+# If anyone wanted the sdbus++ executable, make them use the python3 version.
+# This avoids issues where both packages attempt to install the executable
+# into /usr/bin.
+DEPENDS += "python3-sdbus++-native"
+do_install_append() {
+ rm ${D}${bindir}/sdbus++
+ rmdir ${D}${bindir} || true
+}