|
|
|
@ -1,13 +1,17 @@ |
|
|
|
|
package("mbedtls") |
|
|
|
|
set_homepage("https://tls.mbed.org") |
|
|
|
|
set_description("An SSL library") |
|
|
|
|
set_description("An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API") |
|
|
|
|
set_license("Apache-2.0") |
|
|
|
|
|
|
|
|
|
add_urls("https://github.com/Mbed-TLS/mbedtls/releases/download/$(version).tar.bz2", {version = function (version) |
|
|
|
|
return string.format("%s/mbedtls-%s", version, tostring(version):sub(2)) |
|
|
|
|
end}) |
|
|
|
|
add_urls("https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/$(version).zip", {version = function (version) |
|
|
|
|
return version:ge("v2.23.0") and version or ("mbedtls-" .. tostring(version):sub(2)) |
|
|
|
|
end}) |
|
|
|
|
add_urls("https://github.com/Mbed-TLS/mbedtls.git") |
|
|
|
|
|
|
|
|
|
add_versions("v3.6.0", "3ecf94fcfdaacafb757786a01b7538a61750ebd85c4b024f56ff8ba1490fcd38") |
|
|
|
|
add_versions("v3.5.1", "959a492721ba036afc21f04d1836d874f93ac124cf47cf62c9bcd3a753e49bdb") |
|
|
|
|
add_versions("v3.4.0", "9969088c86eb89f6f0a131e699c46ff57058288410f2087bd0d308f65e9fccb5") |
|
|
|
|
add_versions("v2.28.3", "0c0abbd6e33566c5c3c15af4fc19466c8edb62fa483d4ce98f1ba3f656656d2d") |
|
|
|
@ -35,6 +39,7 @@ package("mbedtls") |
|
|
|
|
io.replace("library/constant_time_impl.h", "extern volatile", "__declspec(dllimport) volatile", {plain = true}) |
|
|
|
|
io.replace("include/mbedtls/x509_crt.h", "extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb;", "__declspec(dllimport) const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_suiteb;", {plain = true}) |
|
|
|
|
io.replace("include/mbedtls/x509_crt.h", "extern const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_default;", "__declspec(dllimport) const mbedtls_x509_crt_profile mbedtls_x509_crt_profile_default;", {plain = true}) |
|
|
|
|
io.replace("library/psa_util_internal.h", "extern const mbedtls_error_pair_t psa_to_ssl_errors[7];", "__declspec(dllimport) const mbedtls_error_pair_t psa_to_ssl_errors[7];", {plain = true}) |
|
|
|
|
end |
|
|
|
|
else |
|
|
|
|
table.insert(configs, "-DUSE_SHARED_MBEDTLS_LIBRARY=OFF") |
|
|
|
|