From ab19119fd2e459c16c44d263f657734ae68ce74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=9C=AA=E6=9D=A5?= Date: Thu, 19 Sep 2024 11:10:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85bunlde.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 徐未来 --- bundle.json | 52 +++++++++++++++++++++++++++++++++++++++++ openssl-macros/BUILD.gn | 2 +- openssl-sys/BUILD.gn | 13 +++++++---- openssl/BUILD.gn | 9 ++++--- 4 files changed, 67 insertions(+), 9 deletions(-) create mode 100644 bundle.json diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000..5ce2713 --- /dev/null +++ b/bundle.json @@ -0,0 +1,52 @@ +{ + "name": "@ohos/rust_rust-openssl", + "description": "FFI bindings to OpenSSL", + "version": "5.0", + "publishAs": "code-segment", + "license": "Apache License 2.0", + "language": "Rust", + "segment": { + "destPath": "third_party/rust/crates/rust-openssl" + }, + "dirs": {}, + "scripts": {}, + "readmePath": { + "en": "README.md" + }, + "component": { + "name": "rust_rust-openssl", + "subsystem": "thirdparty", + "features": [], + "adapted_system_type": [ + "standard" + ], + "rom": "100KB", + "ram": "~200KB", + "deps": { + "components": [ "openssl" ], + "third_party": [] + }, + "build": { + "sub_component": [], + "inner_kits": [ + { + "name": "//third_party/rust/crates/rust-openssl/openssl:openssl" + }, + { + "name": "//third_party/rust/crates/rust-openssl/openssl-sys:openssl_sys" + } + ], + "inner_api": [ + { + "type": "rlib", + "name": "//third_party/rust/crates/rust-openssl/openssl:openssl" + }, + { + "type": "rlib", + "name": "//third_party/rust/crates/rust-openssl/openssl-sys:openssl_sys" + } + ], + "test": [] + } + } +} diff --git a/openssl-macros/BUILD.gn b/openssl-macros/BUILD.gn index cc4d329..55fe247 100644 --- a/openssl-macros/BUILD.gn +++ b/openssl-macros/BUILD.gn @@ -13,7 +13,7 @@ import("//build/ohos.gni") -ohos_cargo_crate("lib") { +ohos_cargo_crate("openssl_macros") { crate_name = "openssl_macros" crate_type = "proc-macro" crate_root = "src/lib.rs" diff --git a/openssl-sys/BUILD.gn b/openssl-sys/BUILD.gn index 5d243d3..b5d04a8 100644 --- a/openssl-sys/BUILD.gn +++ b/openssl-sys/BUILD.gn @@ -13,7 +13,10 @@ import("//build/ohos.gni") -ohos_cargo_crate("lib") { +ohos_cargo_crate("openssl_sys") { + part_name = "rust_rust-openssl" + subsystem_name = "thirdparty" + crate_name = "openssl_sys" crate_type = "rlib" crate_root = "src/lib.rs" @@ -24,10 +27,10 @@ ohos_cargo_crate("lib") { cargo_pkg_authors = "Alex Crichton , Steven Fackler " cargo_pkg_name = "openssl-sys" cargo_pkg_description = "FFI bindings to OpenSSL" - deps = [ - "//third_party/openssl:libcrypto_shared", - "//third_party/openssl:libssl_shared", - "//third_party/rust/crates/libc:lib", + deps = [ "//third_party/rust/crates/libc:lib" ] + external_deps = [ + "openssl:libcrypto_shared", + "openssl:libssl_shared", ] rustflags = [ "--cfg=const_fn", diff --git a/openssl/BUILD.gn b/openssl/BUILD.gn index ec6f648..aa0a268 100644 --- a/openssl/BUILD.gn +++ b/openssl/BUILD.gn @@ -13,7 +13,10 @@ import("//build/ohos.gni") -ohos_cargo_crate("lib") { +ohos_cargo_crate("openssl") { + part_name = "rust_rust-openssl" + subsystem_name = "thirdparty" + crate_name = "openssl" crate_type = "rlib" crate_root = "src/lib.rs" @@ -25,13 +28,13 @@ ohos_cargo_crate("lib") { cargo_pkg_name = "openssl" cargo_pkg_description = "OpenSSL bindings" deps = [ + "../openssl-macros:openssl_macros(${host_toolchain})", + "../openssl-sys:openssl_sys", "//third_party/rust/crates/bitflags:lib", "//third_party/rust/crates/cfg-if:lib", "//third_party/rust/crates/foreign-types/foreign-types/:lib", "//third_party/rust/crates/libc:lib", "//third_party/rust/crates/once_cell:lib", - "//third_party/rust/crates/rust-openssl/openssl-macros:lib(${host_toolchain})", - "//third_party/rust/crates/rust-openssl/openssl-sys:lib", ] features = [ "default" ] rustflags = [ -- Gitee