From aa9de3469e1d34f70e162de0faefb40e634b9dcb Mon Sep 17 00:00:00 2001 From: "S. Lockwood-Childs" Date: Wed, 12 Jul 2017 01:36:34 -0700 Subject: java-library.bbclass: compatibility with per-recipe sysroots The removebinaries task was intended to remove pre-built .jar and .class files from the unpacked source, but when per-recipe sysroots were implemented and ended up under WORKDIR, .jar or .class in those sysroots inadvertently started getting killed as well. For instance, ${WORKDIR}/recipe-sysroot-native/usr/share/java/ecj-bootstrap.jar was deleted when attempting to build jlex-native... which made javac in that sysroot rather unhappy. Solve by excluding both recipe-sysroot and recipe-sysroot-native dirs from the search-and-destroy operation. Signed-off-by: S. Lockwood-Childs Signed-off-by: Maxin B. John (cherry picked from commit c4b9b97c7c60ad5c0c3392ccf143b2e4e6c7df24) --- classes/java-library.bbclass | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'classes/java-library.bbclass') diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass index 58d5a40..ce1cd28 100644 --- a/classes/java-library.bbclass +++ b/classes/java-library.bbclass @@ -50,8 +50,10 @@ ALTJARFILENAMES = "${BPN}.jar" # Java "source" distributions often contain precompiled things # we want to delete first. do_removebinaries() { - find ${WORKDIR} -name "*.jar" -exec rm {} \; - find ${WORKDIR} -name "*.class" -exec rm {} \; + find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \ + -name "*.jar" -exec rm {} \; + find ${WORKDIR} ! -path "${RECIPE_SYSROOT}/*" ! -path "${RECIPE_SYSROOT_NATIVE}/*" \ + -name "*.class" -exec rm {} \; } addtask removebinaries after do_unpack before do_patch -- cgit v1.2.3-54-g00ecf