In #51 I mentioned that the other Lua -sys crate bundles its Lua source. I heard recently from someone on IRC that buildscripts are not supposed to hit the network (though I can't find a documented source for this), so I was spurred to go ahead and try to make this change.
The environment var LUA_VERSION is removed, and LUA_LOCAL_SOURCE's meaning is changed: instead of pointing to a .tar.gz, it should point to the src/ directory of a copy of Lua. If this directory contains a liblua.a, it is used; otherwise Lua is built from these sources. If LUA_LOCAL_SOURCE is not provided, the copy of Lua bundled with the crate is used.
The Makefile is still invoked, so the dependency on make remains, but now neither curl nor wget is needed. The Makefile is invoked with extra parameters such that the output files end up inside Cargo's OUT_DIR. It would be easy to simplify the buildscript and remove the dependency on make by using the gcc crate directly, but the platform-specific configuration in Lua's Makefile would be lost.
This PR is in two commits: one adding a copy of Lua 5.3.3 sourced from where the buildscript was previously downloading it, and another modifying the buildscript.
In #51 I mentioned that the other Lua
-sys
crate bundles its Lua source. I heard recently from someone on IRC that buildscripts are not supposed to hit the network (though I can't find a documented source for this), so I was spurred to go ahead and try to make this change.The environment var
LUA_VERSION
is removed, andLUA_LOCAL_SOURCE
's meaning is changed: instead of pointing to a .tar.gz, it should point to thesrc/
directory of a copy of Lua. If this directory contains aliblua.a
, it is used; otherwise Lua is built from these sources. IfLUA_LOCAL_SOURCE
is not provided, the copy of Lua bundled with the crate is used.The Makefile is still invoked, so the dependency on
make
remains, but now neithercurl
norwget
is needed. The Makefile is invoked with extra parameters such that the output files end up inside Cargo'sOUT_DIR
. It would be easy to simplify the buildscript and remove the dependency onmake
by using thegcc
crate directly, but the platform-specific configuration in Lua's Makefile would be lost.This PR is in two commits: one adding a copy of Lua 5.3.3 sourced from where the buildscript was previously downloading it, and another modifying the buildscript.
Tested on Linux and Windows with no problems.