package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
2.1 KiB

6 years ago
package("libcurl")
set_homepage("https://curl.haxx.se/")
set_description("The multiprotocol file transfer library.")
set_urls("https://curl.haxx.se/download/curl-$(version).tar.bz2",
"http://curl.mirror.anstey.ca/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})
6 years ago
add_versions("7.64.1", "4cc7c738b35250d0680f29e93e0820c4cb40035f43514ea3ec8d60322d41a45d")
if is_plat("linux") then
add_deps("openssl")
6 years ago
elseif is_plat("windows") then
add_deps("cmake")
6 years ago
end
if is_plat("macosx") then
6 years ago
add_frameworks("Security", "CoreFoundation")
elseif is_plat("linux") then
add_syslinks("pthread")
6 years ago
end
6 years ago
on_install("windows", function (package)
6 years ago
import("package.tools.cmake").install(package)
6 years ago
end)
6 years ago
on_install("macosx", "linux", "iphoneos", function (package)
6 years ago
import("package.tools.autoconf")
local envs = autoconf.buildenvs(package)
6 years ago
local configs = {"--disable-silent-rules", "--disable-dependency-tracking", "--enable-shared=no"}
if package:debug() then
table.insert(configs, "--enable-debug")
else
table.insert(configs, "--disable-debug")
end
if is_plat("macosx") then
6 years ago
-- https://github.com/curl/curl/issues/2835
local target_minver = get_config("target_minver")
if target_minver then
envs.CFLAGS = "-mmacosx-version-min=" .. target_minver
end
6 years ago
table.insert(configs, "--with-darwinssl")
6 years ago
end
table.insert(configs, "--without-ca-bundle")
table.insert(configs, "--without-ca-path")
table.insert(configs, "--without-zlib")
table.insert(configs, "--without-librtmp")
6 years ago
table.insert(configs, "--disable-ares")
table.insert(configs, "--disable-ldap")
6 years ago
autoconf.install(package, configs, {envs = envs})
6 years ago
end)
on_test(function (package)
assert(package:has_cfuncs("curl_version", {includes = "curl/curl.h"}))
end)