|
@@ -5,8 +5,7 @@ package("libcurl")
|
|
|
set_description("The multiprotocol file transfer library.")
|
|
|
set_license("MIT")
|
|
|
|
|
|
- set_urls("https://curl.haxx.se/download/curl-$(version).tar.bz2",
|
|
|
- "http://curl.mirror.anstey.ca/curl-$(version).tar.bz2")
|
|
|
+ set_urls("https://curl.haxx.se/download/curl-$(version).tar.bz2")
|
|
|
add_urls("https://github.com/curl/curl/releases/download/curl-$(version).tar.bz2",
|
|
|
{version = function (version) return (version:gsub("%.", "_")) .. "/curl-" .. version end})
|
|
|
if add_versionfiles then
|
|
@@ -17,9 +16,11 @@ package("libcurl")
|
|
|
|
|
|
add_patches("7.84.0", path.join(os.scriptdir(), "patches", "7.84.0", "sched.patch"), "e79f56f840cbc6996a153f19d9266bd46fe4154e6b494c8ee0478cb5b87662d3")
|
|
|
add_patches("8.7.1", path.join(os.scriptdir(), "patches", "8.7.1", "android_armv7.patch"), "b172fd25063fcf4bce987b47a3d95d9d79bcf80f45e7e45dbf4aba72c685fb24")
|
|
|
+ add_patches("8.9.0", path.join(os.scriptdir(), "patches", "8.9.0", "fix-apple-sdk-bug.patch"), "9503db07a76d828ab7d33565c6aa65c9df80626c11248a4b670aaf10b42e4de7")
|
|
|
|
|
|
add_configs("cares", {description = "Enable c-ares support.", default = false, type = "boolean"})
|
|
|
add_configs("openssl", {description = "Enable OpenSSL for SSL/TLS.", default = false, type = "boolean"})
|
|
|
+ add_configs("openssl3", {description = "Enable OpenSSL-3 for SSL/TLS.", default = false, type = "boolean"})
|
|
|
add_configs("mbedtls", {description = "Enable mbedTLS for SSL/TLS.", default = false, type = "boolean"})
|
|
|
add_configs("nghttp2", {description = "Use Nghttp2 library.", default = false, type = "boolean"})
|
|
|
add_configs("openldap", {description = "Use OpenLDAP library.", default = false, type = "boolean"})
|
|
@@ -30,11 +31,14 @@ package("libcurl")
|
|
|
add_configs("libssh2", {description = "Use libSSH2 library.", default = false, type = "boolean"})
|
|
|
add_configs("libpsl", {description = "Use libpsl library.", default = false, type = "boolean"})
|
|
|
|
|
|
+ if is_plat("android") and is_host("windows") then
|
|
|
+ add_deps("ninja")
|
|
|
+ set_policy("package.cmake_generator.ninja", true)
|
|
|
+ end
|
|
|
+
|
|
|
-- we init all configurations in on_load, because package("curl") need it.
|
|
|
on_load(function (package)
|
|
|
- if package:is_plat("linux", "android", "cross") then
|
|
|
- package:config_set("openssl", true)
|
|
|
- end
|
|
|
+ assert(not (package:config("openssl") and package:config("openssl3")), "OpenSSL and OpenSSL-3 cannot be enabled at the same time.")
|
|
|
|
|
|
if package:is_plat("macosx", "iphoneos") then
|
|
|
package:add("frameworks", "Security", "CoreFoundation", "SystemConfiguration")
|
|
@@ -61,6 +65,7 @@ package("libcurl")
|
|
|
package:add("deps", "cmake")
|
|
|
local configdeps = {cares = "c-ares",
|
|
|
openssl = "openssl",
|
|
|
+ openssl3 = "openssl3",
|
|
|
mbedtls = "mbedtls",
|
|
|
nghttp2 = "nghttp2",
|
|
|
openldap = "openldap",
|
|
@@ -94,7 +99,6 @@ package("libcurl")
|
|
|
end
|
|
|
|
|
|
local configopts = {cares = "ENABLE_ARES",
|
|
|
- openssl = (version:ge("7.81") and "CURL_USE_OPENSSL" or "CMAKE_USE_OPENSSL"),
|
|
|
mbedtls = (version:ge("7.81") and "CURL_USE_MBEDTLS" or "CMAKE_USE_MBEDTLS"),
|
|
|
nghttp2 = "USE_NGHTTP2",
|
|
|
libidn2 = "USE_LIBIDN2",
|
|
@@ -106,6 +110,8 @@ package("libcurl")
|
|
|
for name, opt in pairs(configopts) do
|
|
|
table.insert(configs, "-D" .. opt .. "=" .. (package:config(name) and "ON" or "OFF"))
|
|
|
end
|
|
|
+ table.insert(configs, "-D" .. (version:ge("7.81") and "CURL_USE_OPENSSL" or "CMAKE_USE_OPENSSL") .. "=" .. ((package:config("openssl") or package:config("openssl3")) and "ON" or "OFF"))
|
|
|
+
|
|
|
if not package:config("openldap") then
|
|
|
table.insert(configs, "-DCURL_DISABLE_LDAP=ON")
|
|
|
end
|
|
@@ -160,6 +166,7 @@ package("libcurl")
|
|
|
end
|
|
|
handledependency("brotli", "brotli", "BROTLI_INCLUDE_DIR", {BROTLICOMMON_LIBRARY = "brotlicommon", BROTLIDEC_LIBRARY = "brotlidec"})
|
|
|
handledependency("openssl", "openssl", "OPENSSL_INCLUDE_DIR", {OPENSSL_CRYPTO_LIBRARY = "crypto", OPENSSL_SSL_LIBRARY = "ssl"})
|
|
|
+ handledependency("openssl3", "openssl3", "OPENSSL_INCLUDE_DIR", {OPENSSL_CRYPTO_LIBRARY = "crypto", OPENSSL_SSL_LIBRARY = "ssl"})
|
|
|
handledependency("mbedtls", "mbedtls", "MBEDTLS_INCLUDE_DIRS", {MBEDTLS_LIBRARY = "mbedtls", MBEDX509_LIBRARY = "mbedx509", MBEDCRYPTO_LIBRARY = "mbedcrypto"})
|
|
|
handledependency("zlib", "zlib", "ZLIB_INCLUDE_DIR", "ZLIB_LIBRARY")
|
|
|
handledependency("zstd", "zstd", "Zstd_INCLUDE_DIR", "Zstd_LIBRARY")
|