Skip to content
Snippets Groups Projects
Commit 1c66a319 authored by Esben Haabendal's avatar Esben Haabendal
Browse files

openharmony-standard: New recipe for building OH components


This recipe builds a subset of OpenHarmony 1st party components and installs
them into /usr/lib and /usr/bin.  Intended purpose is to use these OpenHarmony
components to build OpenHarmony compatibility into other projects and
products.

Signed-off-by: default avatarEsben Haabendal <esben.haabendal@huawei.com>
parent bf0480be
No related branches found
No related tags found
1 merge request!1Initial code import
Showing
with 27236 additions and 0 deletions
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
DEPENDS += "oniro-openharmony-bundle oniro-openharmony-toolchain-integration-native oniro-openharmony-thirdparty-integration-native"
DEPENDS += "gn-native ninja-native"
DEPENDS += "hc-gen-native"
DEPENDS += "clang-native compiler-rt-native libcxx-native"
do_configure_oniro_ohos[dirs] = "${S}"
do_configure_oniro_ohos() {
# Merge /usr/share/oniro-ohos from recipe-sysroot and
# recipe-sysroot-native into //build/oniro
rm -rf oniro
mkdir oniro
if [ -d ${RECIPE_SYSROOT}${datadir}/oniro-openharmony ] ; then
cp -rv ${RECIPE_SYSROOT}${datadir}/oniro-openharmony/* oniro/
fi
if [ -d ${RECIPE_SYSROOT_NATIVE}${datadir_native}/oniro-openharmony ] ; then
cp -rv ${RECIPE_SYSROOT_NATIVE}${datadir_native}/oniro-openharmony/* oniro/
fi
mkdir oniro/sysroots
ln -s ${RECIPE_SYSROOT} oniro/sysroots/target
ln -s ${RECIPE_SYSROOT_NATIVE} oniro/sysroots/host
./oniro/setup.sh -f
}
do_configure[prefuncs] += "do_configure_oniro_ohos"
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
This diff is collapsed.
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Remove path prefix so bison executable can be found even if not in the
standard binary location.
Signed-off-by: Thierry Escande <thierry.escande@huawei.com>
Upstream-Status: Inappropriate
--- a/parser.sh
+++ b/parser.sh
@@ -1 +1 @@
-/usr/bin/bison $*
+bison $*
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
diff --git a/drivers/peripheral/display/hal/BUILD.gn b/drivers/peripheral/display/hal/BUILD.gn
index a232730b..3e374d56 100644
--- a/drivers/peripheral/display/hal/BUILD.gn
+++ b/drivers/peripheral/display/hal/BUILD.gn
@@ -15,6 +15,77 @@ if (defined(ohos_lite)) {
group("hdi_display") {
public_deps = [ "//device/${device_company}/hardware/display:hdi_display" ]
}
+} else if (true) {
+ import("//build/ohos.gni")
+
+ config("display_hdi_public_config") {
+ visibility = [ ":*" ]
+ include_dirs = [
+ "//drivers/peripheral/base",
+ "//drivers/peripheral/display/interfaces/include",
+ "//drivers/peripheral/display/hal",
+ "//drivers/framework/include/utils",
+ "//drivers/adapter/uhdf2/osal/include",
+ "//base/hiviewdfx/hilog/interfaces/native/innerkits/include",
+ "//third_party/bounds_checking_function/include",
+ ]
+ }
+
+ group("hdi_display") {
+ deps = [
+ ":hdi_display_device",
+ ":hdi_display_gfx",
+ ":hdi_display_gralloc",
+ ":hdi_display_layer",
+ ]
+ }
+
+ ohos_shared_library("hdi_display_device") {
+ sources = [
+ "//drivers/peripheral/display/hal/default/standard_system/display_device.c",
+ ]
+ public_configs = [ ":display_hdi_public_config" ]
+ subsystem_name = "hdf"
+ part_name = "mocks"
+ }
+
+ ohos_shared_library("hdi_display_layer") {
+ sources = [
+ "//device/qemu/hardware/display/display_layer.c",
+ ]
+ deps = [
+ "//third_party/bounds_checking_function:libsec_static",
+ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog"
+ ]
+ public_configs = [ ":display_hdi_public_config" ]
+ subsystem_name = "hdf"
+ part_name = "mocks"
+ }
+
+ ohos_shared_library("hdi_display_gfx") {
+ sources = [
+ "//device/qemu/hardware/display/display_gfx.c",
+ ]
+ deps = [
+ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog"
+ ]
+ public_configs = [ ":display_hdi_public_config" ]
+ subsystem_name = "hdf"
+ part_name = "mocks"
+ }
+
+ ohos_shared_library("hdi_display_gralloc") {
+ sources = [
+ "//device/qemu/hardware/display/display_gralloc.c",
+ ]
+ deps = [
+ "//third_party/bounds_checking_function:libsec_static",
+ "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog"
+ ]
+ public_configs = [ ":display_hdi_public_config" ]
+ subsystem_name = "hdf"
+ part_name = "mocks"
+ }
} else {
config("display_hdi_public_config") {
visibility = [ ":*" ]
diff --git a/drivers/adapter/uhdf2/ohos.build b/drivers/adapter/uhdf2/ohos.build
index f56e333..f897f4b 100644
--- a/drivers/adapter/uhdf2/ohos.build
+++ b/drivers/adapter/uhdf2/ohos.build
@@ -6,43 +6,16 @@
"//drivers/adapter/uhdf2/osal:libhdf_utils",
"//drivers/adapter/uhdf2/ipc:libhdf_ipc_adapter",
"//drivers/adapter/uhdf2/hdi:libhdi",
- "//drivers/adapter/uhdf2/manager:hdf_devmgr",
- "//drivers/adapter/uhdf2/manager:hdf_devmgr.rc",
- "//drivers/adapter/uhdf2/host:hdf_devhost",
- "//drivers/adapter/uhdf2/host:libhdf_host",
- "//drivers/adapter/uhdf2/config:libhdf_hcs",
- "//drivers/adapter/uhdf2/host/test/unittest/sample_driver:libsample_driver",
- "//drivers/adapter/uhdf2/hcs:hdf_default.hcb",
- "//drivers/peripheral/input/hal:hdi_input",
- "//drivers/peripheral/display/hal:hdi_display",
- "//drivers/peripheral/wlan/client:wifi_driver_client",
- "//drivers/peripheral/wlan/hal:wifi_hal",
- "//drivers/peripheral/base:hdf_peripheral.rc",
- "//drivers/peripheral/sensor/hal:hdi_sensor",
- "//device/hisilicon/drivers/firmware/common/wlan:wifi_firmware",
- "//drivers/peripheral/wlan/hdi_service:wifi_hdi_device",
- "//drivers/peripheral/wlan/hdi_service:wifi_hdi_c_device",
- "//drivers/peripheral/audio:hdi_audio",
- "//drivers/peripheral/audio:audio_sample_client",
- "//drivers/peripheral/usb:libusb_ddk",
- "//drivers/peripheral/camera/hal:camera_hal",
- "//drivers/peripheral/misc/vibrator/hal:hdi_vibrator",
- "//drivers/peripheral/input/udriver:libhdf_input_hotplug",
- "//drivers/peripheral/codec/hdi_service:codec_client",
- "//drivers/peripheral/codec/hdi_service:codec_service"
+ "//drivers/peripheral/display/interfaces/hdi_cpp/client:display_client",
+ "//drivers/peripheral/camera/interfaces/include/client:libcamera_client"
],
"test_list": [
- "//drivers/peripheral/wlan/test:hdf_test_wifi",
- "//drivers/peripheral/sensor/test:hdf_test_sensor",
- "//drivers/adapter/uhdf2/test:hdf_test_uhdf",
- "//drivers/adapter/uhdf2/osal/test:unittest",
- "//drivers/adapter/uhdf2/host/test:unittest",
- "//drivers/adapter/uhdf2/hdi/test:unittest",
- "//drivers/peripheral/misc/vibrator/test:hdf_test_vibrator",
- "//drivers/peripheral/wlan/test/hdi_service:unittest",
- "//drivers/peripheral/audio/test/systemtest:systemtest",
- "//drivers/peripheral/usb/test:hdf_test_usb",
- "//drivers/peripheral/audio/test:hdf_test_audio"
+ "//drivers/adapter/uhdf2/osal/test:unittest"
+ ]
+ },
+ "mocks": {
+ "module_list": [
+ "//drivers/peripheral/display/hal:hdi_display"
]
}
}
/*
* SPDX-FileCopyrightText: Huawei Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "display_device.h"
#include "display_type.h"
// MAX_BRIGHTNESS as defined in:
// base/powermgr/display_manager/service/native/include/screen_action.h
#define MAX_BRIGHTNESS 255
static uint32_t backlight_level = MAX_BRIGHTNESS;
static DispPowerStatus power_status = POWER_STATUS_ON;
int32_t SetDisplayPowerStatus(uint32_t devId, DispPowerStatus status)
{
if (devId == 0 && status < POWER_STATUS_BUTT) {
power_status = status;
return DISPLAY_SUCCESS;
}
return DISPLAY_PARAM_ERR;
}
int32_t GetDisplayPowerStatus(uint32_t devId, DispPowerStatus *status)
{
if (devId == 0 && status != NULL) {
*status = power_status;
return DISPLAY_SUCCESS;
}
return DISPLAY_PARAM_ERR;
}
int32_t SetDisplayBacklight(uint32_t devId, uint32_t level)
{
if (devId == 0 && level <= MAX_BRIGHTNESS) {
backlight_level = level;
return DISPLAY_SUCCESS;
}
return DISPLAY_PARAM_ERR;
}
int32_t GetDisplayBacklight(uint32_t devId, uint32_t *level)
{
if (devId == 0 && level != NULL) {
*level = backlight_level;
return DISPLAY_SUCCESS;
}
return DISPLAY_PARAM_ERR;
}
int32_t DeviceInitialize(DeviceFuncs **funcs)
{
if (funcs == NULL) {
return DISPLAY_NULL_PTR;
}
DeviceFuncs *dFuncs = (DeviceFuncs *)calloc(1, sizeof(DeviceFuncs));
if (funcs == NULL) {
return DISPLAY_NOMEM;
}
dFuncs->SetDisplayPowerStatus = SetDisplayPowerStatus;
dFuncs->GetDisplayPowerStatus = GetDisplayPowerStatus;
dFuncs->SetDisplayBacklight = SetDisplayBacklight;
dFuncs->GetDisplayBacklight = GetDisplayBacklight;
*funcs = dFuncs;
return DISPLAY_SUCCESS;
}
int32_t DeviceUninitialize(DeviceFuncs *funcs)
{
if (funcs == NULL) {
return DISPLAY_NULL_PTR;
}
free(funcs);
return DISPLAY_SUCCESS;
}
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Disable copy of FlexLexer.h. It's done by bitbake from the Yocto native
sysroot. This avoids the installation of libfl-dev on the host system.
Also comment out the useless PATH modification.
Signed-off-by: Thierry Escande <thierry.escande@huawei.com>
Upstream-Status: Inappropriate
--- a/services/script/bison.sh
+++ b/services/script/bison.sh
@@ -18,6 +18,6 @@ if [ ! -d ./yacc ]; then
mkdir -p ./yacc
fi
-export PATH=/usr/share/bison:$PATH
+#export PATH=/usr/share/bison:$PATH
-cp /usr/include/FlexLexer.h ./yacc
+#cp /usr/include/FlexLexer.h ./yacc
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Don't copy prebuilt node binaries to the out folder and use sysroot
Yocto node executable by removing the relative path to access it.
Apply to repo third_party/jsframework
Signed-off-by: Thierry Escande <thierry.escande@huawei.com>
Upstream-Status: Inappropriate
diff --git a/js_framework_build.sh b/js_framework_build.sh
index 2b5a6b8..561eb1f 100755
--- a/js_framework_build.sh
+++ b/js_framework_build.sh
@@ -44,18 +44,18 @@ cp -r $8 $9
if [ -d "$prebuilts_path" ]; then
echo "prebuilts exists"
# address problme of parallzing compile
- rm -rf "$9/node-v12.18.4-linux-x64"
- rm -rf "$9/node-v12.18.4-darwin-x64"
- cp -r $2 $9
+# rm -rf "$9/node-v12.18.4-linux-x64"
+# rm -rf "$9/node-v12.18.4-darwin-x64"
+# cp -r $2 $9
cd $9
if [ "${11}" == 'true' ];then
./node-v12.18.4-darwin-x64/bin/node build.js
# run unit test
./node-v12.18.4-darwin-x64/bin/node node_modules/.bin/mocha -r ts-node/register test/lib.ts test/ut/**/*.ts test/ut/*.ts
else
- ./node-v12.18.4-linux-x64/bin/node build.js
+ node build.js
# run unit test
- ./node-v12.18.4-linux-x64/bin/node node_modules/.bin/mocha -r ts-node/register test/lib.ts test/ut/**/*.ts test/ut/*.ts
+# ./node-v12.18.4-linux-x64/bin/node node_modules/.bin/mocha -r ts-node/register test/lib.ts test/ut/**/*.ts test/ut/*.ts
fi
else
npm run build
#!/bin/sh
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# Create directories required by hilogd and hilog
mkdir -p /dev/unix/socket
mkdir -p /data/log/hilog
# Add /system/bin to PATH
export PATH="/system/bin:${PATH}"
hilogd &
HILOGD_PID=$!
./HiLogNDKTest
TEST_RESULT=$?
kill "${HILOGD_PID}"
if test "$TEST_RESULT" -eq 0; then
echo "PASS: HiLogNDKTest"
else
echo "FAIL: HiLogNDKTest"
fi
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
The path to node exectuable is set by the node_path arg and must point
to the Yocto native sysroot. Since node_path is declared as a gn
argument it can be set though GN_ARGS and thus it must not be
overwritten for the Linux host toolchain configurtion.
This patch remove node_path config from ts2abc_config.gni which is now
set in GN_ARGS by the openharmony-standard-system-components recipe to
node_path="${RECIPE_SYSROOT_NATIVE}/usr/bin".
Apply to repo ark/ts2abc
Signed-off-by: Thierry Escande <thierry.escande@huawei.com>
Upstream-Status: Inappropriate
diff --git a/ts2panda/ts2abc_config.gni b/ts2panda/ts2abc_config.gni
index a86ae80..cd05aa0 100755
--- a/ts2panda/ts2abc_config.gni
+++ b/ts2panda/ts2abc_config.gni
@@ -51,7 +51,6 @@ if (host_toolchain == buildtool_mac) {
ts2abc_build_path =
get_label_info("//ark/ts2abc/ts2panda:ts2abc_build($buildtool_linux)",
"root_out_dir") + "/obj/ark/ts2abc/ts2panda/build"
- node_path = "${nodejs_dir}/node-v12.18.4-linux-x64/bin/"
}
# Generate js plugin.
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
Replace hardcoded path with product company and name variables.
Apply to drivers/peripheral
Signed-off-by: Thierry Escande <thierry.escande@huawei.com>
Upstream-Status: Inappropriate
diff --git a/camera/hal/adapter/platform/v4l2/BUILD.gn b/camera/hal/adapter/platform/v4l2/BUILD.gn
index a6d86af7..a8d3f749 100755
--- a/camera/hal/adapter/platform/v4l2/BUILD.gn
+++ b/camera/hal/adapter/platform/v4l2/BUILD.gn
@@ -6,7 +6,7 @@ import("//drivers/peripheral/camera/hal/camera.gni")
action("build_camera_host_config") {
script = "$hdf_framework_path/tools/hc-gen/build_hcs.py"
sources = [ rebase_path(
- "//vendor/hisilicon/Hi3516DV300/hdf_config/uhdf/camera/hal/v4l2/rpi4b/hdi_impl/camera_host_config.hcs") ]
+ "//vendor/${product_company}/${product_name}/hdf_config/uhdf/camera/hal/v4l2/rpi4b/hdi_impl/camera_host_config.hcs") ]
outputs = [ "$target_gen_dir/config/hdi_impl/camera_host_config.hcb" ]
args = [
"-o",
@@ -27,7 +27,7 @@ ohos_prebuilt_etc("camera_host_config.hcb") {
action("build_stream_supported_config") {
script = "$hdf_framework_path/tools/hc-gen/build_hcs.py"
sources = [ rebase_path(
- "//vendor/hisilicon/Hi3516DV300/hdf_config/uhdf/camera/hal/v4l2/rpi4b/hdi_impl/stream_supported_config.hcs") ]
+ "//vendor/${product_company}/${product_name}/hdf_config/uhdf/camera/hal/v4l2/rpi4b/hdi_impl/stream_supported_config.hcs") ]
outputs = [ "$target_gen_dir/config/hdi_impl/stream_supported_config.hcb" ]
args = [
"-o",
@@ -56,7 +56,7 @@ ohos_prebuilt_etc("config.c") {
"$camera_path/pipeline_core/pipeline_impl/src/strategy/config/config.c"),
"-t",
rebase_path(
- "//vendor/hisilicon/Hi3516DV300/hdf_config/uhdf/camera/hal/v4l2/rpi4b/pipeline_core/config.hcs"),
+ "//vendor/${product_company}/${product_name}/hdf_config/uhdf/camera/hal/v4l2/rpi4b/pipeline_core/config.hcs"),
],
"")
}
@@ -72,7 +72,7 @@ ohos_prebuilt_etc("params.c") {
"$camera_path/pipeline_core/pipeline_impl/src/strategy/config/params.c"),
"-t",
rebase_path(
- "//vendor/hisilicon/Hi3516DV300/hdf_config/uhdf/camera/hal/v4l2/rpi4b/pipeline_core/params.hcs"),
+ "//vendor/${product_company}/${product_name}/hdf_config/uhdf/camera/hal/v4l2/rpi4b/pipeline_core/params.hcs"),
],
"")
}
@@ -80,7 +80,7 @@ ohos_prebuilt_etc("params.c") {
action("build_ipp_algo_config") {
script = "$hdf_framework_path/tools/hc-gen/build_hcs.py"
sources = [ rebase_path(
- "//vendor/hisilicon/Hi3516DV300/hdf_config/uhdf/camera/hal/v4l2/rpi4b/pipeline_core/ipp_algo_config.hcs") ]
+ "//vendor/${product_company}/${product_name}/hdf_config/uhdf/camera/hal/v4l2/rpi4b/pipeline_core/ipp_algo_config.hcs") ]
outputs = [ "$target_gen_dir/pipeline_core/ipp_algo_config.hcb" ]
args = [
"-o",
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment