From 2f83a50da46d51105ba3ba78f58c6287a3e75e7e Mon Sep 17 00:00:00 2001
From: Esben Haabendal <esben.haabendal@huawei.com>
Date: Tue, 7 Sep 2021 16:44:07 +0200
Subject: [PATCH] openjdk-7: Fix recipe parsing for riscv32 machines

Using current meta-java in a project configured for a riscv32 machine gives
the following error:

    ERROR: ExpansionError during parsing /home/esben/ostc/openharmony/poky/meta-java/recipes-core/openjdk/openjdk-7_99b00-2.6.5.bb
    Traceback (most recent call last):
      File "Var <LLVM_CONFIGURE_ARCH>", line 1, in <module>
      File "/home/esben/ostc/openharmony/poky/meta-java/classes/openjdk-build-helper.bbclass", line 86, in openjdk_build_helper_get_llvm_configure_arch(d=<bb.data_smart.DataSmart object at 0x7fc729388940>):
             else:
        >        if 'shark' in d.getVar('PACKAGECONFIG').split():
                     bb.warn("%s does not support %s in Shark builds yet" % (d.getVar('PN'), arch) );
    bb.data_smart.ExpansionError: Failure expanding variable LLVM_CONFIGURE_ARCH, expression was ${@openjdk_build_helper_get_llvm_configure_arch(d)} which triggered exception AttributeError: 'NoneType' object has no attribute 'split'

Which is caused by the attempt to expand PACKAGECONFIG variable, which is only
set for selected architectures.  Defaulting it to empty is a sane fix to that.

A patch for meta-java doing the same have been submitted.

Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com>
---
 .../meta-java/recipes-core/openjdk/openjdk-7_%.bbappend      | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 meta-ohos-staging/dynamic-layers/meta-java/recipes-core/openjdk/openjdk-7_%.bbappend

diff --git a/meta-ohos-staging/dynamic-layers/meta-java/recipes-core/openjdk/openjdk-7_%.bbappend b/meta-ohos-staging/dynamic-layers/meta-java/recipes-core/openjdk/openjdk-7_%.bbappend
new file mode 100644
index 00000000..25a6dae0
--- /dev/null
+++ b/meta-ohos-staging/dynamic-layers/meta-java/recipes-core/openjdk/openjdk-7_%.bbappend
@@ -0,0 +1,5 @@
+# SPDX-FileCopyrightText: Huawei Inc.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+PACKAGECONFIG ??= ""
-- 
GitLab