[meta-oracle-java][PATCH V2 1/2] On headless arm, do_package() complains about missing libX11.so.6 provider.


Vincent Prince
 

Full JRE created by jrecreate contains awt/swing dynamic libraries linked to libX11.
We patch binaries to remove libX11 dependencies

Signed-off-by: Vincent Prince <vincent.prince.fr@...>
---
recipes-devtools/oracle-java/oracle-jse-ejre.inc | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/recipes-devtools/oracle-java/oracle-jse-ejre.inc b/recipes-devtools/oracle-java/oracle-jse-ejre.inc
index d7a4b33..114a7dc 100644
--- a/recipes-devtools/oracle-java/oracle-jse-ejre.inc
+++ b/recipes-devtools/oracle-java/oracle-jse-ejre.inc
@@ -11,7 +11,7 @@ DESCRIPTION = "This is the proprietary JRE from Sun/Oracle, with the Hotspot JVM
JDK_JRE = "ejre"
require oracle-jse.inc

-DEPENDS = "virtual/java-native"
+DEPENDS = "virtual/java-native patchelf-native"

LIC_FILES_CHKSUM = "\
file://${LICENSE_DIR}/COPYRIGHT;md5=3dc1bfbd5bed75d650ad0506a0df5930 \
@@ -22,4 +22,16 @@ do_compile() {
DEST=${S}/${JDK_JRE}${PV}_${PV_UPDATE}
rm -rf ${DEST}
JAVA_HOME=${STAGING_DIR_NATIVE}/${JDK_HOME} ejdk${PV}_${PV_UPDATE}/bin/jrecreate.sh --dest ${DEST}
+
+ PATCHELF_DIR=${STAGING_DIR_NATIVE}/usr/bin
+ ${PATCHELF_DIR}/patchelf --remove-needed libX11.so.6 ${DEST}/bin/policytool
+
+ ${PATCHELF_DIR}/patchelf --remove-needed libX11.so.6 \
+ --remove-needed libXext.so.6 ${DEST}/lib/arm/libsplashscreen.so
+
+ ${PATCHELF_DIR}/patchelf --remove-needed libX11.so.6 \
+ --remove-needed libXrender.so.1 \
+ --remove-needed libXtst.so.6 \
+ --remove-needed libXi.so.6 \
+ --remove-needed libXext.so.6 ${DEST}/lib/arm/libawt_xawt.so
}
--
2.7.4

Join yocto@lists.yoctoproject.org to automatically receive all group messages.