mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
180 lines
3.5 KiB
Python
180 lines
3.5 KiB
Python
load("//Config:buck_rule_macros.bzl", "static_library", "gen_header_targets")
|
|
|
|
openssl_headers = [
|
|
"aes.h",
|
|
"asn1.h",
|
|
"asn1_mac.h",
|
|
"asn1err.h",
|
|
"asn1t.h",
|
|
"async.h",
|
|
"asyncerr.h",
|
|
"bio.h",
|
|
"bioerr.h",
|
|
"blowfish.h",
|
|
"bn.h",
|
|
"bnerr.h",
|
|
"buffer.h",
|
|
"buffererr.h",
|
|
"camellia.h",
|
|
"cast.h",
|
|
"cmac.h",
|
|
"cms.h",
|
|
"cmserr.h",
|
|
"comp.h",
|
|
"comperr.h",
|
|
"conf.h",
|
|
"conf_api.h",
|
|
"conferr.h",
|
|
"crypto.h",
|
|
"cryptoerr.h",
|
|
"ct.h",
|
|
"cterr.h",
|
|
"des.h",
|
|
"dh.h",
|
|
"dherr.h",
|
|
"dsa.h",
|
|
"dsaerr.h",
|
|
"dtls1.h",
|
|
"e_os2.h",
|
|
"ebcdic.h",
|
|
"ec.h",
|
|
"ecdh.h",
|
|
"ecdsa.h",
|
|
"ecerr.h",
|
|
"engine.h",
|
|
"engineerr.h",
|
|
"err.h",
|
|
"evp.h",
|
|
"evperr.h",
|
|
"hmac.h",
|
|
"idea.h",
|
|
"kdf.h",
|
|
"kdferr.h",
|
|
"lhash.h",
|
|
"md2.h",
|
|
"md4.h",
|
|
"md5.h",
|
|
"mdc2.h",
|
|
"modes.h",
|
|
"obj_mac.h",
|
|
"objects.h",
|
|
"objectserr.h",
|
|
"ocsp.h",
|
|
"ocsperr.h",
|
|
"opensslconf.h",
|
|
"opensslv.h",
|
|
"ossl_typ.h",
|
|
"pem.h",
|
|
"pem2.h",
|
|
"pemerr.h",
|
|
"pkcs12.h",
|
|
"pkcs12err.h",
|
|
"pkcs7.h",
|
|
"pkcs7err.h",
|
|
"rand.h",
|
|
"rand_drbg.h",
|
|
"randerr.h",
|
|
"rc2.h",
|
|
"rc4.h",
|
|
"rc5.h",
|
|
"ripemd.h",
|
|
"rsa.h",
|
|
"rsaerr.h",
|
|
"safestack.h",
|
|
"seed.h",
|
|
"sha.h",
|
|
"srp.h",
|
|
"srtp.h",
|
|
"ssl.h",
|
|
"ssl2.h",
|
|
"ssl3.h",
|
|
"sslerr.h",
|
|
"stack.h",
|
|
"store.h",
|
|
"storeerr.h",
|
|
"symhacks.h",
|
|
"tls1.h",
|
|
"ts.h",
|
|
"tserr.h",
|
|
"txt_db.h",
|
|
"ui.h",
|
|
"uierr.h",
|
|
"whrlpool.h",
|
|
"x509.h",
|
|
"x509_vfy.h",
|
|
"x509err.h",
|
|
"x509v3.h",
|
|
"x509v3err.h",
|
|
]
|
|
|
|
openssl_header_paths = ["openssl/" + header for header in openssl_headers]
|
|
|
|
archs = ["arm64", "armv7", "x86_64"]
|
|
|
|
rules = [
|
|
genrule(
|
|
name = "openssl_build_" + arch,
|
|
srcs = glob([
|
|
"build-openssl-buck.sh",
|
|
"*.tar.gz",
|
|
"*.patch",
|
|
]),
|
|
bash = "sh $SRCDIR/build-openssl-buck.sh $OUT $SRCDIR " + arch,
|
|
out = "openssl_" + arch,
|
|
visibility = [
|
|
"//submodules/openssl:...",
|
|
]
|
|
) for arch in archs
|
|
]
|
|
|
|
genrule(
|
|
name = "openssl_build_merged",
|
|
srcs = [
|
|
"pack-openssl.sh",
|
|
],
|
|
bash = "sh $SRCDIR/pack-openssl.sh $OUT $(location :openssl_build_arm64)/out/include " +
|
|
" ".join(["$(location :openssl_build_" + arch + ")/out/lib/libcrypto.a" for arch in archs]),
|
|
out = "openssl",
|
|
visibility = [
|
|
"PUBLIC",
|
|
]
|
|
)
|
|
|
|
genrule(
|
|
name = "openssl_libssl_merged",
|
|
srcs = [
|
|
"pack-libssl.sh",
|
|
],
|
|
bash = "sh $SRCDIR/pack-libssl.sh $OUT $(location :openssl_build_arm64)/out/include " +
|
|
" ".join(["$(location :openssl_build_" + arch + ")/out/lib/libssl.a" for arch in archs]),
|
|
out = "libssl",
|
|
visibility = [
|
|
"PUBLIC",
|
|
]
|
|
)
|
|
|
|
|
|
openssl_header_targets = gen_header_targets(openssl_header_paths, "openssl_header_", "", "openssl_build_arm64", "out/include")
|
|
|
|
apple_library(
|
|
name = "openssl",
|
|
visibility = [
|
|
"PUBLIC",
|
|
],
|
|
header_namespace = "openssl",
|
|
exported_headers = openssl_header_targets,
|
|
linker_flags = [
|
|
"-L$(location :openssl_build_merged)/lib",
|
|
"-L$(location :openssl_libssl_merged)/lib",
|
|
"-lcrypto",
|
|
"-lssl",
|
|
],
|
|
exported_linker_flags = [
|
|
"-L$(location :openssl_build_merged)/lib",
|
|
"-L$(location :openssl_libssl_merged)/lib",
|
|
"-lcrypto",
|
|
"-lssl",
|
|
],
|
|
deps = [":openssl_build_" + arch for arch in ["arm64"]],
|
|
)
|