diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2017-04-17 09:29:31 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2017-04-17 09:29:31 -0300 |
| commit | 9c853b1e7ec0f30e0e539fb56d7c81edbe5c8d7d (patch) | |
| tree | 2f4333ff660a28d9d51a29dfd526398a672d66d6 | |
| parent | 21a37f56fa39eeb57493a4971863fa86466b55e2 (diff) | |
| download | luarocks-9c853b1e7ec0f30e0e539fb56d7c81edbe5c8d7d.tar.gz luarocks-9c853b1e7ec0f30e0e539fb56d7c81edbe5c8d7d.tar.bz2 luarocks-9c853b1e7ec0f30e0e539fb56d7c81edbe5c8d7d.zip | |
Add sanity check for lua.h
| -rw-r--r-- | src/luarocks/build/builtin.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/luarocks/build/builtin.lua b/src/luarocks/build/builtin.lua index 59c530a4..403a8aaf 100644 --- a/src/luarocks/build/builtin.lua +++ b/src/luarocks/build/builtin.lua | |||
| @@ -53,6 +53,7 @@ function builtin.run(rockspec) | |||
| 53 | 53 | ||
| 54 | local build = rockspec.build | 54 | local build = rockspec.build |
| 55 | local variables = rockspec.variables | 55 | local variables = rockspec.variables |
| 56 | local checked_lua_h = false | ||
| 56 | 57 | ||
| 57 | local function add_flags(extras, flag, flags) | 58 | local function add_flags(extras, flag, flags) |
| 58 | if flags then | 59 | if flags then |
| @@ -240,6 +241,14 @@ function builtin.run(rockspec) | |||
| 240 | end | 241 | end |
| 241 | end | 242 | end |
| 242 | if type(info) == "table" then | 243 | if type(info) == "table" then |
| 244 | if not checked_lua_h then | ||
| 245 | local lua_incdir, lua_h = variables.LUA_INCDIR, "lua.h" | ||
| 246 | if not fs.exists(dir.path(lua_incdir, lua_h)) then | ||
| 247 | return nil, "Lua header file "..lua_h.." not found (looked in "..lua_incdir.."). \n" .. | ||
| 248 | "You need to install the Lua development package for your system." | ||
| 249 | end | ||
| 250 | checked_lua_h = true | ||
| 251 | end | ||
| 243 | local objects = {} | 252 | local objects = {} |
| 244 | local sources = info.sources | 253 | local sources = info.sources |
| 245 | if info[1] then sources = info end | 254 | if info[1] then sources = info end |
