From 501e1bc52cc41c3695f5afa5aba8ee9b2fdcdbb4 Mon Sep 17 00:00:00 2001
From: Esben Haabendal <esben.haabendal@huawei.com>
Date: Mon, 27 Jun 2022 17:13:00 +0200
Subject: [PATCH] musl: Switch to distro-neutral openharmony override

This allows building OpenHarmony compatible musl using any distro configuration
which enables "openharmony" in its DISTROOVERRIDES.

Signed-off-by: Esben Haabendal <esben.haabendal@huawei.com>
---
 recipes-core/musl/musl_%.bbappend | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/recipes-core/musl/musl_%.bbappend b/recipes-core/musl/musl_%.bbappend
index 82812d40..460b14ab 100644
--- a/recipes-core/musl/musl_%.bbappend
+++ b/recipes-core/musl/musl_%.bbappend
@@ -2,14 +2,14 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 
-BASEVER:oniro-openharmony-linux = "1.2.0"
-SRCREV:oniro-openharmony-linux = "040c1d16b468c50c04fc94edff521f1637708328"
-LIC_FILES_CHKSUM:oniro-openharmony-linux = "file://COPYRIGHT;md5=f95ee848a08ad253c04723da00cedb01"
-FILESEXTRAPATHS:prepend:oniro-openharmony-linux := "${THISDIR}/openharmony-${OPENHARMONY_VERSION}:"
-SRC_URI:append:oniro-openharmony-linux = " file://openharmony-common.patch"
-SRC_URI:append:oniro-openharmony-linux = " file://openharmony-linux-user.patch"
+BASEVER:openharmony = "1.2.0"
+SRCREV:openharmony = "040c1d16b468c50c04fc94edff521f1637708328"
+LIC_FILES_CHKSUM:openharmony = "file://COPYRIGHT;md5=f95ee848a08ad253c04723da00cedb01"
+FILESEXTRAPATHS:prepend:openharmony := "${THISDIR}/openharmony-${OPENHARMONY_VERSION}:"
+SRC_URI:append:openharmony = " file://openharmony-common.patch"
+SRC_URI:append:openharmony = " file://openharmony-linux-user.patch"
 # This conflicts with libcap, so we have to go with libcap instead
-#SRC_URI:append:oniro-openharmony-linux = " file://openharmony-linux-user-capability_h.patch"
+#SRC_URI:append:openharmony = " file://openharmony-linux-user-capability_h.patch"
 
 # As musl links with -nostdlib, we need to add linking with
 # libclang_rt.builtins.a manually as needed
@@ -22,9 +22,9 @@ LDFLAGS:append:toolchain-clang = " ${@bb.utils.contains('COMPILER_RT', '-rtlib=c
 # with `-nostdinc` argument.
 # Possible fix is to rewrite the hooks implementation to use the musl internal
 # atomic.h functions instead.
-#CFLAGS:append:oniro-openharmony-linux = "-DHOOK_ENABLE"
+#CFLAGS:append:openharmony = "-DHOOK_ENABLE"
 
-do_install:append:oniro-openharmony-linux () {
+do_install:append:openharmony () {
     for folder in ${MUSL_LDSO_PATHS}; do
         echo "${libdir}/${folder}" >> ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path
     done
-- 
GitLab