diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-02 19:27:48 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-02 19:27:48 -0300 |
commit | 8dd1e1460282f5fc992d838ec2411f4d1bc7b2b7 (patch) | |
tree | 5b6e88d37869bad4a23cfd52424e91fa34d34176 /src | |
parent | 672b4f191ac5723ee460e469d58fff2ca2cb386b (diff) | |
download | luarocks-8dd1e1460282f5fc992d838ec2411f4d1bc7b2b7.tar.gz luarocks-8dd1e1460282f5fc992d838ec2411f4d1bc7b2b7.tar.bz2 luarocks-8dd1e1460282f5fc992d838ec2411f4d1bc7b2b7.zip |
Experimental Windows cross-compiled binary build
This commit consolidates the work that has been ongoing over the
last few weeks in producing the single-binary builds of LuaRocks
based on the new distribution model described in
https://github.com/luarocks/luarocks/wiki/Project:-LuaRocks-new-distribution-model
The single-binary build is in a good shape for Linux,
it's a work-in-progress for Windows (binaries do build,
but some work on the dependencies is still necessary),
and is untested in macOS.
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/cmd.lua | 13 | ||||
-rw-r--r-- | src/luarocks/core/cfg.lua | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/luarocks/cmd.lua b/src/luarocks/cmd.lua index 53e0c60a..4200959c 100644 --- a/src/luarocks/cmd.lua +++ b/src/luarocks/cmd.lua | |||
@@ -348,6 +348,19 @@ function cmd.run_command(description, commands, ...) | |||
348 | project_dir = flags["project-tree"]:gsub("[/\\][^/\\]+$", "") | 348 | project_dir = flags["project-tree"]:gsub("[/\\][^/\\]+$", "") |
349 | end | 349 | end |
350 | 350 | ||
351 | -- FIXME A quick hack for the experimental Windows build | ||
352 | if os.getenv("LUAROCKS_CROSS_COMPILING") then | ||
353 | cfg.each_platform = function() | ||
354 | local i = 0 | ||
355 | local plats = { "unix", "linux" } | ||
356 | return function() | ||
357 | i = i + 1 | ||
358 | return plats[i] | ||
359 | end | ||
360 | end | ||
361 | fs.init() | ||
362 | end | ||
363 | |||
351 | ----------------------------------------------------------------------------- | 364 | ----------------------------------------------------------------------------- |
352 | local ok, err = cfg.init(lua_data, project_dir, util.warning) | 365 | local ok, err = cfg.init(lua_data, project_dir, util.warning) |
353 | if not ok then | 366 | if not ok then |
diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index e160d69b..af57e7ca 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua | |||
@@ -276,7 +276,7 @@ local function make_defaults(lua_version, target_cpu, platforms, home) | |||
276 | local localappdata = os.getenv("LOCALAPPDATA") | 276 | local localappdata = os.getenv("LOCALAPPDATA") |
277 | if not localappdata then | 277 | if not localappdata then |
278 | -- for Windows versions below Vista | 278 | -- for Windows versions below Vista |
279 | localappdata = os.getenv("USERPROFILE").."/Local Settings/Application Data" | 279 | localappdata = (os.getenv("USERPROFILE") or "c:/Users/All Users").."/Local Settings/Application Data" |
280 | end | 280 | end |
281 | defaults.local_cache = localappdata.."/LuaRocks/Cache" | 281 | defaults.local_cache = localappdata.."/LuaRocks/Cache" |
282 | defaults.web_browser = "start" | 282 | defaults.web_browser = "start" |