depot/third_party/nixpkgs/pkgs/development/tools/misc/luarocks/darwin-3.1.3.patch
Default email 9405df4a82 Project import generated by Copybara.
GitOrigin-RevId: 8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17
2021-04-26 15:14:03 -04:00

24 lines
1.2 KiB
Diff

diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua
index c5af5a2..1949fdc 100644
--- a/src/luarocks/core/cfg.lua
+++ b/src/luarocks/core/cfg.lua
@@ -425,7 +425,7 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
defaults.external_lib_extension = "dylib"
defaults.arch = "macosx-"..target_cpu
defaults.variables.LIBFLAG = "-bundle -undefined dynamic_lookup -all_load"
- local version = util.popen_read("sw_vers -productVersion")
+ local version = os.getenv("MACOSX_DEPLOYMENT_TARGET") or "@darwinMinVersion@"
version = tonumber(version and version:match("^[^.]+%.([^.]+)")) or 3
if version >= 10 then
version = 8
@@ -434,8 +434,8 @@ local function make_defaults(lua_version, target_cpu, platforms, home)
else
defaults.gcc_rpath = false
end
- defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." gcc"
- defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." gcc"
+ defaults.variables.CC = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." clang"
+ defaults.variables.LD = "env MACOSX_DEPLOYMENT_TARGET=10."..version.." clang"
defaults.web_browser = "open"
end