From 36e11d0acb1b37a1afb193d6c7aaff42e0da086a Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 4 May 2019 22:14:09 +0800 Subject: [PATCH] improve libcurl --- packages/l/libcurl/xmake.lua | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/l/libcurl/xmake.lua b/packages/l/libcurl/xmake.lua index 33ed95d7d..c6e5fc858 100644 --- a/packages/l/libcurl/xmake.lua +++ b/packages/l/libcurl/xmake.lua @@ -16,17 +16,18 @@ package("libcurl") end if is_plat("macosx") then - add_frameworks("Security") + add_frameworks("Security", "CoreFoundation") elseif is_plat("linux") then add_syslinks("pthread") end on_install("windows", function (package) - local configs = {} - import("package.tools.cmake").install(package, configs) + import("package.tools.cmake").install(package) end) on_install("macosx", "linux", "iphoneos", function (package) + import("package.tools.autoconf") + local envs = autoconf.buildenvs(package) local configs = {"--disable-silent-rules", "--disable-dependency-tracking", "--enable-shared=no"} if package:debug() then table.insert(configs, "--enable-debug") @@ -34,17 +35,12 @@ package("libcurl") table.insert(configs, "--disable-debug") end if is_plat("macosx") then - local with_darwinssl = false - local xcode_sdkver = get_config("xcode_sdkver") - if xcode_sdkver then - -- fix undefined symbols: _SSLCopyALPNProtocols, _SSLSetALPNProtocols - with_darwinssl = import("core.base.semver").compare(xcode_sdkver, "9.4.1") > 0 - end - if with_darwinssl then - table.insert(configs, "--with-darwinssl") - else - table.insert(configs, "--without-darwinssl") + -- 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 + table.insert(configs, "--with-darwinssl") end table.insert(configs, "--without-ca-bundle") table.insert(configs, "--without-ca-path") @@ -52,7 +48,7 @@ package("libcurl") table.insert(configs, "--without-librtmp") table.insert(configs, "--disable-ares") table.insert(configs, "--disable-ldap") - import("package.tools.autoconf").install(package, configs) + autoconf.install(package, configs, {envs = envs}) end) on_test(function (package)