feat:add gn files and add tools for soft link files
This commit is contained in:
parent
4aa4f2e66f
commit
a160b5500e
65
0017-feat-add-script-to-create-soft-link.patch
Normal file
65
0017-feat-add-script-to-create-soft-link.patch
Normal file
@ -0,0 +1,65 @@
|
||||
From 2e6f009669ad3f5a7c5ab3d0f50ff612881820d5 Mon Sep 17 00:00:00 2001
|
||||
From: peng_langyuan <peng_langyuan@hoperun.com>
|
||||
Date: Fri, 16 Jun 2023 10:10:39 +0800
|
||||
Subject: [PATCH 2/3] feat:add script to create soft link
|
||||
|
||||
---
|
||||
openeuler/script/link.py | 46 ++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 46 insertions(+)
|
||||
create mode 100755 openeuler/script/link.py
|
||||
|
||||
diff --git a/openeuler/script/link.py b/openeuler/script/link.py
|
||||
new file mode 100755
|
||||
index 0000000..585123e
|
||||
--- /dev/null
|
||||
+++ b/openeuler/script/link.py
|
||||
@@ -0,0 +1,46 @@
|
||||
+#!/usr/bin/env python
|
||||
+# -*- coding: utf-8 -*-
|
||||
+# Copyright (c) 2021 Hoperun Device Co., Ltd.
|
||||
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+# you may not use this file except in compliance with the License.
|
||||
+# You may obtain a copy of the License at
|
||||
+#
|
||||
+# http://www.apache.org/licenses/LICENSE-2.0
|
||||
+#
|
||||
+# Unless required by applicable law or agreed to in writing, software
|
||||
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+# See the License for the specific language governing permissions and
|
||||
+# limitations under the License.
|
||||
+
|
||||
+import os
|
||||
+import sys
|
||||
+import argparse
|
||||
+
|
||||
+# create parent directory
|
||||
+def create_dir(dir):
|
||||
+ dir_items = dir.split("/")
|
||||
+ full_name = ""
|
||||
+ length = len(dir_items) - 1
|
||||
+ for i in range(length):
|
||||
+ full_name += "/" + dir_items[i]
|
||||
+ if not os.path.exists(full_name):
|
||||
+ os.mkdir(full_name)
|
||||
+
|
||||
+def main():
|
||||
+ parser = argparse.ArgumentParser()
|
||||
+ parser.add_argument('--src_target', required=True)
|
||||
+ parser.add_argument('--dest_target', required=True)
|
||||
+ args = parser.parse_args()
|
||||
+
|
||||
+ src_target = args.src_target
|
||||
+ dest_target = args.dest_target
|
||||
+
|
||||
+ if os.path.exists(dest_target):
|
||||
+ os.unlink(dest_target)
|
||||
+ create_dir(dest_target)
|
||||
+ return os.symlink(src_target, dest_target)
|
||||
+
|
||||
+if __name__ == '__main__':
|
||||
+ sys.exit(main())
|
||||
+
|
||||
--
|
||||
2.33.0
|
||||
|
||||
158
0018-feat-add-safwk-compile-gn-target.patch
Normal file
158
0018-feat-add-safwk-compile-gn-target.patch
Normal file
@ -0,0 +1,158 @@
|
||||
From 7aa47681e17926be40f9ef7074377816fdc76efe Mon Sep 17 00:00:00 2001
|
||||
From: peng_langyuan <peng_langyuan@hoperun.com>
|
||||
Date: Fri, 16 Jun 2023 10:09:08 +0800
|
||||
Subject: [PATCH 1/3] feat:add safwk compile gn target
|
||||
|
||||
---
|
||||
.../systemabilitymgr/safwk/bundle.json | 58 +++++++++++++++++++
|
||||
.../safwk/interfaces/innerkits/safwk/BUILD.gn | 41 +++++++++++++
|
||||
.../safwk/services/safwk/BUILD.gn | 22 +++++++
|
||||
3 files changed, 121 insertions(+)
|
||||
create mode 100644 openeuler/compiler_gn/foundation/systemabilitymgr/safwk/bundle.json
|
||||
create mode 100644 openeuler/compiler_gn/foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/BUILD.gn
|
||||
create mode 100644 openeuler/compiler_gn/foundation/systemabilitymgr/safwk/services/safwk/BUILD.gn
|
||||
|
||||
diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/bundle.json b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/bundle.json
|
||||
new file mode 100644
|
||||
index 0000000..1964532
|
||||
--- /dev/null
|
||||
+++ b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/bundle.json
|
||||
@@ -0,0 +1,58 @@
|
||||
+{
|
||||
+ "name": "@ohos/systemabilitymgr_safwk",
|
||||
+ "description": "system ability framework",
|
||||
+ "homePage": "https://gitee.com/openharmony",
|
||||
+ "version": "3.1",
|
||||
+ "license": "Apache License 2.0",
|
||||
+ "repository": "https://gitee.com/openharmony/systemabilitymgr_safwk",
|
||||
+ "publishAs": "code-segment",
|
||||
+ "segment": {
|
||||
+ "destPath": "foundation/systemabilitymgr/safwk"
|
||||
+ },
|
||||
+ "dirs": {},
|
||||
+ "scripts": {},
|
||||
+ "component": {
|
||||
+ "name": "safwk",
|
||||
+ "subsystem": "systemabilitymgr",
|
||||
+ "features": [ "safwk_feature_coverage = false" ],
|
||||
+ "adapted_system_type": [
|
||||
+ "standard"
|
||||
+ ],
|
||||
+ "rom": "200KB",
|
||||
+ "ram": "7130KB",
|
||||
+ "deps": {
|
||||
+ "components": [
|
||||
+ "hitrace_native",
|
||||
+ "hiviewdfx_hilog_native",
|
||||
+ "ipc",
|
||||
+ "samgr",
|
||||
+ "c_utils"
|
||||
+ ],
|
||||
+ "third_party": [ "libxml2" ]
|
||||
+ },
|
||||
+ "build": {
|
||||
+ "group_type": {
|
||||
+ "base_group": [
|
||||
+ "//foundation/systemabilitymgr/safwk/services/safwk:sa_main",
|
||||
+ "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk"
|
||||
+ ],
|
||||
+ "fwk_group": [],
|
||||
+ "service_group": []
|
||||
+ },
|
||||
+ "inner_kits": [
|
||||
+ {
|
||||
+ "header": {
|
||||
+ "header_base": "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk",
|
||||
+ "header_files": [
|
||||
+ "system_ability.h"
|
||||
+ ]
|
||||
+ },
|
||||
+ "name": "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk:system_ability_fwk"
|
||||
+ }
|
||||
+ ],
|
||||
+ "test": [
|
||||
+ "//foundation/systemabilitymgr/safwk/test:unittest"
|
||||
+ ]
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/BUILD.gn b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000..57dcce2
|
||||
--- /dev/null
|
||||
+++ b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/BUILD.gn
|
||||
@@ -0,0 +1,41 @@
|
||||
+# Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+# you may not use this file except in compliance with the License.
|
||||
+# You may obtain a copy of the License at
|
||||
+#
|
||||
+# http://www.apache.org/licenses/LICENSE-2.0
|
||||
+#
|
||||
+# Unless required by applicable law or agreed to in writing, software
|
||||
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+# See the License for the specific language governing permissions and
|
||||
+# limitations under the License.
|
||||
+
|
||||
+import("//build/ohos.gni")
|
||||
+import("//build/ohos_var.gni")
|
||||
+
|
||||
+# 建立所需头文件链接
|
||||
+exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/safwk/system_ability.h", "--dest_target",
|
||||
+ rebase_path("//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk/system_ability.h") ], "string")
|
||||
+
|
||||
+exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/safwk", "--dest_target",
|
||||
+ rebase_path("//foundation/systemabilitymgr/safwk/services/safwk/include") ], "string")
|
||||
+
|
||||
+config("system_ability_config") {
|
||||
+ visibility = [ ":*" ]
|
||||
+ include_dirs = [
|
||||
+ "../../../services/safwk/include",
|
||||
+ "//foundation/systemabilitymgr/safwk/interfaces/innerkits/safwk",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
+ohos_prebuilt_shared_library("system_ability_fwk") {
|
||||
+ source = "/usr/lib64/libsystem_ability_fwk.z.so"
|
||||
+
|
||||
+ public_configs = [ ":system_ability_config" ]
|
||||
+
|
||||
+ install_images = [ system_base_dir ]
|
||||
+ relative_install_dir = "platformsdk"
|
||||
+ part_name = "safwk"
|
||||
+ subsystem_name = "systemabilitymgr"
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/services/safwk/BUILD.gn b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/services/safwk/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000..a258444
|
||||
--- /dev/null
|
||||
+++ b/openeuler/compiler_gn/foundation/systemabilitymgr/safwk/services/safwk/BUILD.gn
|
||||
@@ -0,0 +1,22 @@
|
||||
+# Copyright (c) 2021 Huawei Device Co., Ltd.
|
||||
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+# you may not use this file except in compliance with the License.
|
||||
+# You may obtain a copy of the License at
|
||||
+#
|
||||
+# http://www.apache.org/licenses/LICENSE-2.0
|
||||
+#
|
||||
+# Unless required by applicable law or agreed to in writing, software
|
||||
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+# See the License for the specific language governing permissions and
|
||||
+# limitations under the License.
|
||||
+
|
||||
+import("//build/ohos.gni")
|
||||
+
|
||||
+ohos_prebuilt_executable("sa_main") {
|
||||
+ source = "/usr/bin/sa_main"
|
||||
+ install_enable = true
|
||||
+
|
||||
+ part_name = "safwk"
|
||||
+ subsystem_name = "systemabilitymgr"
|
||||
+}
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.33.0
|
||||
|
||||
171
0019-feat-add-devicemanager-gn-files.patch
Normal file
171
0019-feat-add-devicemanager-gn-files.patch
Normal file
@ -0,0 +1,171 @@
|
||||
From 7c774820edb327a81e0be9f7891d45bf4eee9ac7 Mon Sep 17 00:00:00 2001
|
||||
From: tian2020 <tian_hang@hoperun.com>
|
||||
Date: Fri, 16 Jun 2023 15:17:37 +0800
|
||||
Subject: [PATCH 3/3] feat:add devicemanager gn files
|
||||
|
||||
---
|
||||
.../device_manager/BUILD.gn | 17 ++++
|
||||
.../device_manager/bundle.json | 80 +++++++++++++++++++
|
||||
.../interfaces/inner_kits/native_cpp/BUILD.gn | 39 +++++++++
|
||||
3 files changed, 136 insertions(+)
|
||||
create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn
|
||||
create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json
|
||||
create mode 100644 openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn
|
||||
|
||||
diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000..df46546
|
||||
--- /dev/null
|
||||
+++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/BUILD.gn
|
||||
@@ -0,0 +1,17 @@
|
||||
+# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+# you may not use this file except in compliance with the License.
|
||||
+# You may obtain a copy of the License at
|
||||
+#
|
||||
+# http://www.apache.org/licenses/LICENSE-2.0
|
||||
+#
|
||||
+# Unless required by applicable law or agreed to in writing, software
|
||||
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+# See the License for the specific language governing permissions and
|
||||
+# limitations under the License.
|
||||
+group("device_manager_fwk") {
|
||||
+ deps = [
|
||||
+ "interfaces/inner_kits/native_cpp:devicemanagersdk",
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json
|
||||
new file mode 100644
|
||||
index 0000000..51c3d9a
|
||||
--- /dev/null
|
||||
+++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/bundle.json
|
||||
@@ -0,0 +1,80 @@
|
||||
+{
|
||||
+ "name": "@ohos/device_manager",
|
||||
+ "description": "device manager service",
|
||||
+ "version": "3.1",
|
||||
+ "license": "Apache License 2.0",
|
||||
+ "repository": "https://gitee.com/openharmony/device_manager",
|
||||
+ "publishAs": "code-segment",
|
||||
+ "segment": {
|
||||
+ "destPath": "foundation/distributedhardware/device_manager"
|
||||
+ },
|
||||
+ "dirs": {},
|
||||
+ "scripts": {},
|
||||
+ "component": {
|
||||
+ "name": "device_manager",
|
||||
+ "subsystem": "distributedhardware",
|
||||
+ "syscap":[ "SystemCapability.DistributedHardware.DeviceManager" ],
|
||||
+ "features":["device_manager_no_interaction_auth"],
|
||||
+ "adapted_system_type": [ "standard", "small" ],
|
||||
+ "rom": "2M",
|
||||
+ "ram": "16M",
|
||||
+ "hisysevent_config": [
|
||||
+ "//foundation/distributedhardware/device_manager/hisysevent.yaml"
|
||||
+ ],
|
||||
+ "deps": {
|
||||
+ "components": [
|
||||
+ "ability_base",
|
||||
+ "ability_runtime",
|
||||
+ "access_token",
|
||||
+ "appexecfwk_standard",
|
||||
+ "bundle_framework",
|
||||
+ "c_utils",
|
||||
+ "common_event_service",
|
||||
+ "device_auth",
|
||||
+ "dsoftbus",
|
||||
+ "hisysevent_native",
|
||||
+ "hitrace_native",
|
||||
+ "hiviewdfx_hilog_native",
|
||||
+ "init",
|
||||
+ "ipc",
|
||||
+ "napi",
|
||||
+ "os_account",
|
||||
+ "safwk",
|
||||
+ "samgr",
|
||||
+ "startup_l2"
|
||||
+ ],
|
||||
+ "third_party": [
|
||||
+ "json",
|
||||
+ "node",
|
||||
+ "googletest",
|
||||
+ "mbedtls"
|
||||
+ ]
|
||||
+ },
|
||||
+ "build": {
|
||||
+ "group_type": {
|
||||
+ "base_group": [],
|
||||
+ "fwk_group": [
|
||||
+ "//foundation/distributedhardware/device_manager:device_manager_fwk"
|
||||
+ ],
|
||||
+ "service_group": []
|
||||
+ },
|
||||
+ "inner_kits": [
|
||||
+ {
|
||||
+ "type": "so",
|
||||
+ "name": "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp:devicemanagersdk",
|
||||
+ "header": {
|
||||
+ "header_files": [
|
||||
+ "device_manager.h",
|
||||
+ "device_manager_callback.h",
|
||||
+ "dm_device_info.h",
|
||||
+ "dm_publish_info.h",
|
||||
+ "dm_subscribe_info.h"
|
||||
+ ],
|
||||
+ "header_base": "//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include"
|
||||
+ }
|
||||
+ }
|
||||
+ ],
|
||||
+ "test": []
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn
|
||||
new file mode 100644
|
||||
index 0000000..78c60d7
|
||||
--- /dev/null
|
||||
+++ b/openeuler/compiler_gn/foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/BUILD.gn
|
||||
@@ -0,0 +1,39 @@
|
||||
+# Copyright (c) 2022 Huawei Device Co., Ltd.
|
||||
+# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
+# you may not use this file except in compliance with the License.
|
||||
+# You may obtain a copy of the License at
|
||||
+#
|
||||
+# http://www.apache.org/licenses/LICENSE-2.0
|
||||
+#
|
||||
+# Unless required by applicable law or agreed to in writing, software
|
||||
+# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
+# See the License for the specific language governing permissions and
|
||||
+# limitations under the License.
|
||||
+import("//build/ohos.gni")
|
||||
+
|
||||
+exec_script("//build/openeuler/script/link.py", [ "--src_target", "/usr/include/device_manager", "--dest_target",
|
||||
+ rebase_path("//foundation/distributedhardware/device_manager/interfaces/inner_kits/native_cpp/include") ], "string")
|
||||
+
|
||||
+config("devicemanagersdk_config") {
|
||||
+ include_dirs = [
|
||||
+ "include",
|
||||
+ "include/ipc",
|
||||
+ "include/ipc/standard",
|
||||
+ "include/notify",
|
||||
+ "include/common/include",
|
||||
+ "include/common/include/ipc",
|
||||
+ "include/common/include/ipc/model",
|
||||
+ "include/common/include/ipc/standard",
|
||||
+ "include/common/include/dfx",
|
||||
+ "include/common/include/dfx/standard",
|
||||
+ ]
|
||||
+}
|
||||
+
|
||||
+ohos_prebuilt_shared_library("devicemanagersdk") {
|
||||
+ source = "/usr/lib64/libdevicemanagersdk.z.so"
|
||||
+ public_configs = [ ":devicemanagersdk_config" ]
|
||||
+
|
||||
+ subsystem_name = "distributedhardware"
|
||||
+ part_name = "device_manager"
|
||||
+}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
%global openHarmony_source_release OpenHarmony-v3.2-Release
|
||||
Name: distributed-build
|
||||
Version: 1.0.0
|
||||
Release: 3
|
||||
Release: 4
|
||||
Summary: openEuler embedded softbus build tools
|
||||
License: Apache-2.0
|
||||
URL: https://gitee.com/openharmony/build
|
||||
@ -24,6 +24,9 @@ Patch0013: 0013-feature-use-llvm-tools-version-15-for-build.patch
|
||||
Patch0014: 0014-feat-delete-the-default-sqlite-deps.patch
|
||||
Patch0015: 0015-feat-and-hilog-gn-files.patch
|
||||
Patch0016: 0016-fix-use-llvm15-path-on-x86_64.patch
|
||||
Patch0017: 0017-feat-add-script-to-create-soft-link.patch
|
||||
Patch0018: 0018-feat-add-safwk-compile-gn-target.patch
|
||||
Patch0019: 0019-feat-add-devicemanager-gn-files.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
@ -44,10 +47,13 @@ cp -rp %{_builddir}/build-%{openHarmony_source_release}/* %{buildroot}/opt/dist
|
||||
/opt/distributed-middleware-build
|
||||
|
||||
%changelog
|
||||
* Thu Jun 15 tianhang <tian_hang@hoperun.com> - 1.0.0-3
|
||||
* Fri Jun 16 2023 tianhang <tian_hang@hoperun.com> - 1.0.0-4
|
||||
- add gn files and add tools for soft link files
|
||||
|
||||
* Thu Jun 15 2023 tianhang <tian_hang@hoperun.com> - 1.0.0-3
|
||||
- use llvm15 path for strip on x86_64
|
||||
|
||||
* Thu Jun 15 tianhang <tian_hang@hoperun.com> - 1.0.0-2
|
||||
* Thu Jun 15 2023 tianhang <tian_hang@hoperun.com> - 1.0.0-2
|
||||
- add hilog compile gn files and remove default sqlite deps
|
||||
|
||||
* Tue May 30 2023 tianhang <tian_hang@hoperun.com> - 1.0.0-1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user