!2 [rust-openssl]Add GN Build Files and Custom Modifications to Rust Third-party Libraries

Merge pull request !2 from peizhe/master
This commit is contained in:
openharmony_ci
2023-04-19 01:28:49 +00:00
committed by Gitee
5 changed files with 149 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
[
{
"Name": "openssl",
"License": "Apache License V2.0, MIT",
"License File": "LICENSE-APACHE, LICENSE-MIT",
"Version Number": "0.10.47",
"Owner": "xuelei3@huawei.com",
"Upstream URL": "https://github.com/sfackler/rust-openssl",
"Description": "OpenSSL bindings."
}
]
+31
View File
@@ -0,0 +1,31 @@
# Copyright (c) 2023 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_cargo_crate("lib") {
crate_name = "openssl_macros"
crate_type = "proc-macro"
crate_root = "src/lib.rs"
sources = [ "src/lib.rs" ]
edition = "2018"
cargo_pkg_version = "0.1.0"
cargo_pkg_name = "openssl-macros"
cargo_pkg_description = "Internal macros used by the openssl crate."
deps = [
"//third_party/rust/crates/proc-macro2:lib",
"//third_party/rust/crates/quote:lib",
"//third_party/rust/crates/syn:lib",
]
}
+53
View File
@@ -0,0 +1,53 @@
# Copyright (c) 2023 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_cargo_crate("lib") {
crate_name = "openssl_sys"
crate_type = "rlib"
crate_root = "src/lib.rs"
sources = [ "src/lib.rs" ]
edition = "2018"
cargo_pkg_version = "0.9.82"
cargo_pkg_authors = "Alex Crichton <alex@alexcrichton.com>, Steven Fackler <sfackler@gmail.com>"
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",
]
rustflags = [
"--cfg=const_fn",
"--cfg=openssl",
"--cfg=osslconf=\"OPENSSL_NO_BF\"",
"--cfg=osslconf=\"OPENSSL_NO_IDEA\"",
"--cfg=osslconf=\"OPENSSL_NO_CAMELLIA\"",
"--cfg=osslconf=\"OPENSSL_NO_CAST\"",
"--cfg=osslconf=\"OPENSSL_NO_RMD160\"",
"--cfg=osslconf=\"OPENSSL_NO_SSL3_METHOD\"",
"--cfg=ossl101",
"--cfg=ossl102",
"--cfg=ossl102f",
"--cfg=ossl102h",
"--cfg=ossl110",
"--cfg=ossl110f",
"--cfg=ossl110g",
"--cfg=ossl110h",
"--cfg=ossl111",
"--cfg=ossl111b",
"--cfg=ossl111c",
]
}
+53
View File
@@ -0,0 +1,53 @@
# Copyright (c) 2023 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_cargo_crate("lib") {
crate_name = "openssl"
crate_type = "rlib"
crate_root = "src/lib.rs"
sources = [ "src/lib.rs" ]
edition = "2018"
cargo_pkg_version = "0.10.47"
cargo_pkg_authors = "Steven Fackler <sfackler@gmail.com>"
cargo_pkg_name = "openssl"
cargo_pkg_description = "OpenSSL bindings"
deps = [
"//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 = [
"--cfg=osslconf=\"OPENSSL_NO_BF\"",
"--cfg=osslconf=\"OPENSSL_NO_IDEA\"",
"--cfg=osslconf=\"OPENSSL_NO_CAMELLIA\"",
"--cfg=osslconf=\"OPENSSL_NO_CAST\"",
"--cfg=osslconf=\"OPENSSL_NO_RMD160\"",
"--cfg=osslconf=\"OPENSSL_NO_SSL3_METHOD\"",
"--cfg=ossl101",
"--cfg=ossl102",
"--cfg=ossl110",
"--cfg=ossl110g",
"--cfg=ossl110h",
"--cfg=ossl111",
"-Copt-level=3",
"-Cprefer-dynamic",
]
}
+1
View File
@@ -126,6 +126,7 @@ pub use ffi::init;
use libc::c_int;
extern crate openssl_sys as ffi;
use crate::error::ErrorStack;
#[macro_use]