Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make package.path and package.cpath unique in win32 bin scripts. #587

Merged
merged 1 commit into from
Jul 11, 2016

Conversation

xpol
Copy link
Contributor

@xpol xpol commented Jul 11, 2016

It happens that I manually installed Lua and LuaRocks in the follow structure:

{ROOT}
|   config.lua
|   lua.exe
|   lua53.dll
|   lua53.lib
|   luacheck.bat
|   luarocks
|   luarocks.bat
|
+---cmod
|       lfs.dll
|
+---doc
|
+---include
|       lauxlib.h
|       lua.h
|       lua.hpp
|       luaconf.h
|       lualib.h
|
+---lua
|   +---luacheck
|   |       analyze.lua
|   |       ...
|   |       version.lua
|   |
|   \---luarocks
|       |   add.lua
|       |   ...
|       |   write_rockspec.lua
|       |
|       +---build
|       |       builtin.lua
|       |       cmake.lua
|       |       command.lua
|       |       make.lua
|       |
|       +---fetch
|       |       cvs.lua
|       |       ...
|       |       svn.lua
|       |
|       +---fs
|       |   |   lua.lua
|       |   |   unix.lua
|       |   |   win32.lua
|       |   |
|       |   +---unix
|       |   |       tools.lua
|       |   |
|       |   \---win32
|       |           tools.lua
|       |
|       +---tools
|       |       patch.lua
|       |       tar.lua
|       |       zip.lua
|       |
|       \---upload
|               api.lua
|               multipart.lua
|
+---rocks
|   |   manifest
|   |
|   +---luacheck
|   |   \---0.15.1-1
|   |       |   luacheck-0.15.1-1.rockspec
|   |       |   rock_manifest
|   |       |
|   |       +---bin
|   |       |       luacheck
|   |       |
|   |       +---doc
|   |       \---lua
|   \---luafilesystem
|       \---1.6.3-2
|           |   luafilesystem-1.6.3-2.rockspec
|           |   rock_manifest
|           |
|           +---doc
|           \---tests
|
\---tools
        7z.exe
        ...
        wget.exe

in config.lua:

rocks_trees = {
  {
    root="{ROOT}",
    bin_dir="{ROOT}",
    lib_dir="{ROOT}/cmod",
    lua_dir="{ROOT}/lua"
  }
}

in site_config.lua:

site_config.LUAROCKS_PREFIX=[[{ROOT}]]
  • The extra_luarocks_module_dir (site_config.LUAROCKS_PREFIX..'lua/?.lua' == {ROOT}/lua/?.lua)
  • And rocks_trees.lua_dir .. '/?.lua' == {ROOT}/lua/?.lua

That is in this case of configuration. extra_luarocks_module_dir is duplicated with lua directory for the tree.

So I:

  1. add 2 lines in src/luarocks/fs/win32.lua to remove duplicated path in lpath and lcpath.
  2. use / instead of \\ in extra_luarocks_module_dir.

@hishamhm hishamhm merged commit 187f0de into luarocks:master Jul 11, 2016
@hishamhm
Copy link
Member

Patch looks fine, thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants