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

add new platform: MXE #491

Closed
wants to merge 1 commit into from
Closed

add new platform: MXE #491

wants to merge 1 commit into from

Conversation

starius
Copy link

@starius starius commented Jan 30, 2016

MXE (M cross environment) is a Makefile that compiles a cross compiler and cross compiles many free libraries such as SDL and Qt. Target OS is MinGW.

MXE has a plugin called "luarocks" which adds a luarocks itself and dozens of packages. It applies a patch to luarocks to make it usable in MXE. I have done this work for luarocks 2.2.2 and then have to rebase this patch for luarocks 2.3.0. This pull request is equal to that patch.

See also mxe/mxe#1017 and mxe/mxe#1182

@@ -137,6 +140,7 @@ local platform_order = {
linux = 7,
macosx = 8,
cygwin = 9,
mxe = 13,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ordering is weird... please put the numbers in order (you can change the other numbers if needed)

@hishamhm
Copy link
Member

This sounds really specific. The code assumes that LuaRocks was installed in the same prefix as your MXE tools (in other words, that it is being installed by your MXE script/makefile). If the only way to use this is in conjunction with the MXE environment anyway, it seems to me that this custom config belongs there rather than here.

Another important observation is that virtually all changes are in configuration. Instead of patching LuaRocks, you could obtain the same results writing a config.lua file for your environment that sets these values. The only thing that would break is if you want to add "mxe" platform-overrides to your rockspecs, but if you are patching them, that's not the case, I assume.

Apart from that, the only real change in the could would be

if cfg.is_platform("cygwin") or cfg.is_platform("mxe") then

which we could change to make non-cygwin-specific, by changing it to a setting like cfg.link_lua_explicitly (set by default to true on cygwin only). With this one-line change to LuaRocks and a custom config.lua, I think you could use it on MXE without patching LuaRocks.

@starius
Copy link
Author

starius commented Oct 22, 2016

You are right: most of my changes can be moved to config.lua.
But two changes can not be moved to config.

Can you add "mxe" to the list of platforms to remove one of the remaining changes, please?

if cfg.is_platform("cygwin") or cfg.is_platform("mxe") then

which we could change to make non-cygwin-specific, by changing it to a setting like cfg.link_lua_explicitly (set by default to true on cygwin only).

+1 for that change. Can you do it, please?

@hishamhm
Copy link
Member

@starius I just made a significant change to make it possible for you to set platforms = { "unix", "mxe" } in the config file, and I also added the setting link_lua_explicitly = true. With these changes, I think everything can be done via config file. Please try the latest code in Git!

@hishamhm hishamhm closed this Oct 26, 2016
starius added a commit to LuaAndC/mxe that referenced this pull request Dec 3, 2016
starius added a commit to LuaAndC/mxe that referenced this pull request Dec 5, 2016
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

3 participants