Skip to content

Commit eb34d4c

Browse files
authored
Add Android.bp blueprints (#6985)
* add blueprints for aosp build * extract shared libraries we depend on * whitespace --------- Co-authored-by: Yavor Georgiev <[email protected]>
1 parent 0d21faa commit eb34d4c

File tree

4 files changed

+230
-1
lines changed

4 files changed

+230
-1
lines changed

Android.bp

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
package {
2+
default_applicable_licenses: [
3+
"external_realm_license",
4+
"external_realm_dep_intel_math_library_license",
5+
"external_realm_dep_mpark_variant_license",
6+
"external_realm_dep_nlohmann_json_license",
7+
"external_realm_dep_s2_license",
8+
],
9+
}
10+
11+
license {
12+
name: "external_realm_license",
13+
visibility: [":__subpackages__"],
14+
license_kinds: [
15+
"SPDX-license-identifier-Apache-2.0",
16+
],
17+
license_text: [
18+
"LICENSE",
19+
],
20+
}
21+
22+
license {
23+
name: "external_realm_dep_intel_math_library_license",
24+
visibility: [":__subpackages__"],
25+
license_kinds: [
26+
"legacy_notice",
27+
],
28+
license_text: [
29+
"src/external/IntelRDFPMathLib20U2/eula.txt",
30+
],
31+
}
32+
33+
license {
34+
name: "external_realm_dep_mpark_variant_license",
35+
visibility: [":__subpackages__"],
36+
license_kinds: [
37+
"SPDX-license-identifier-BSL-1.0",
38+
],
39+
license_text: [
40+
"src/external/mpark/LICENSE.md",
41+
],
42+
}
43+
44+
license {
45+
name: "external_realm_dep_nlohmann_json_license",
46+
visibility: [":__subpackages__"],
47+
license_kinds: [
48+
"SPDX-license-identifier-MIT",
49+
],
50+
license_text: [
51+
"src/external/json/LICENSE.MIT",
52+
],
53+
}
54+
55+
license {
56+
name: "external_realm_dep_s2_license",
57+
visibility: [":__subpackages__"],
58+
license_kinds: [
59+
"SPDX-license-identifier-Apache-2.0",
60+
],
61+
license_text: [
62+
"src/external/s2/LICENSE-2.0.txt",
63+
],
64+
}
65+
66+
cc_object {
67+
name: "IntelRDFPMathLib20U2",
68+
srcs: [
69+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c",
70+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c",
71+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c",
72+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c",
73+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c",
74+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c",
75+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c",
76+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c",
77+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c",
78+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c",
79+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c",
80+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c",
81+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c",
82+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c",
83+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c",
84+
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c",
85+
],
86+
}
87+
88+
cc_object {
89+
name: "s2",
90+
srcs: ["src/external/s2/**/*.cc"],
91+
defaults: [
92+
"realm_consumer_defaults",
93+
"realm_defaults",
94+
],
95+
local_include_dirs: [
96+
"src",
97+
"src/external",
98+
"src/external/s2",
99+
],
100+
cflags: [
101+
"-Wno-deprecated-declarations",
102+
"-Wno-ignored-qualifiers",
103+
"-Wno-macro-redefined",
104+
"-Wno-missing-prototypes",
105+
"-Wno-shorten-64-to-32",
106+
"-Wno-undefined-var-template",
107+
"-Wno-unknown-pragmas",
108+
"-Wno-unused-const-variable",
109+
"-Wno-unused-function",
110+
"-Wno-unused-local-typedefs",
111+
"-Wno-unused-parameter",
112+
],
113+
}
114+
115+
genrule {
116+
name: "version_numbers.hpp",
117+
srcs: [
118+
"dependencies.list",
119+
"src/realm/version_numbers.hpp.in",
120+
],
121+
out: ["realm/version_numbers.hpp"],
122+
tool_files: ["tools/generate-version-numbers-for-soong.sh"],
123+
cmd: "$(location) $(in) > $(out)",
124+
}
125+
126+
cc_defaults {
127+
name: "realm_consumer_defaults",
128+
cpp_std: "c++17",
129+
rtti: true,
130+
cppflags: [
131+
"-fexceptions",
132+
],
133+
debug: {
134+
cflags: ["-DREALM_DEBUG"],
135+
},
136+
shared_libs: [
137+
"liblog",
138+
"libandroid",
139+
"libz",
140+
"libcrypto",
141+
"libssl",
142+
],
143+
}
144+
145+
cc_defaults {
146+
name: "realm_defaults",
147+
cflags: [
148+
"-fPIC",
149+
"-DREALM_NO_CONFIG",
150+
"-DREALM_HAVE_OPENSSL=1",
151+
"-DREALM_ENABLE_ENCRYPTION=1",
152+
"-DREALM_ENABLE_SYNC=1",
153+
"-DREALM_ENABLE_GEOSPATIAL=1",
154+
"-DREALM_HAVE_EPOLL=1",
155+
"-Wno-non-virtual-dtor",
156+
"-Wno-missing-field-initializers",
157+
],
158+
lto: {
159+
thin: true,
160+
},
161+
include_build_directory: false,
162+
generated_headers: ["version_numbers.hpp"],
163+
}
164+
165+
cc_library_static {
166+
name: "realm",
167+
defaults: [
168+
"realm_consumer_defaults",
169+
"realm_defaults",
170+
],
171+
cflags: [
172+
"-fvisibility=hidden",
173+
],
174+
local_include_dirs: ["src/external"],
175+
export_include_dirs: ["src"],
176+
export_generated_headers: ["version_numbers.hpp"],
177+
srcs: [
178+
":IntelRDFPMathLib20U2",
179+
":s2",
180+
"src/realm/**/*.cpp",
181+
],
182+
exclude_srcs: [
183+
"src/realm/tools/**/*",
184+
"src/realm/exec/**/*",
185+
"src/realm/sync/tools/**/*",
186+
"src/realm/object-store/c_api/**/*",
187+
"src/realm/object-store/impl/apple/**/*",
188+
"src/realm/object-store/impl/emscripten/**/*",
189+
"src/realm/object-store/impl/generic/**/*",
190+
"src/realm/object-store/impl/windows/**/*",
191+
"src/realm/object-store/sync/impl/emscripten/**/*",
192+
],
193+
export_shared_lib_headers: ["libcrypto"],
194+
}

src/external/json/LICENSE.MIT

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2013-2022 Niels Lohmann
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

src/realm/sync/network/network_ssl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ void Context::ssl_use_verify_file(const std::string& path, std::error_code& ec)
371371
ec = std::error_code();
372372
}
373373

374-
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
374+
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) && !defined(OPENSSL_IS_BORINGSSL)
375375
class Stream::BioMethod {
376376
public:
377377
BIO_METHOD* bio_method;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
source $1
4+
5+
version_and_extra=( ${VERSION//-/ } )
6+
version_only=${version_and_extra[0]}
7+
extra=${version_and_extra[1]}
8+
9+
semver=( ${version_only//./ } )
10+
major=${semver[0]}
11+
minor=${semver[1]}
12+
patch=${semver[2]}
13+
14+
sed "s/@CONFIG_VERSION_MAJOR@/$major/g; s/@CONFIG_VERSION_MINOR@/$minor/g; s/@CONFIG_VERSION_PATCH@/$patch/g; s/@CONFIG_VERSION_TWEAK@/$extra/g; s/@CONFIG_VERSION@/$VERSION/g" $2

0 commit comments

Comments
 (0)