|
| 1 | +REM https://github.com/bluebird75/luaunit/blob/80e5b37e0f3e0016dcf7dff0004a4d065cd4ee61/.appveyor/install-lua.cmd |
| 2 | +REM BSD license: https://github.com/bluebird75/luaunit/blob/7382208f9e7ff433e0bf3feeb1990bcab1de9877/LICENSE.txt |
| 3 | + |
| 4 | +REM This is a batch file to help with setting up the desired Lua environment. |
| 5 | +REM It is intended to be run as "install" step from within AppVeyor. |
| 6 | + |
| 7 | +REM version numbers and file names for binaries from http://sf.net/p/luabinaries/ |
| 8 | +set VER_51=5.1.5 |
| 9 | +set VER_52=5.2.4 |
| 10 | +set VER_53=5.3.3 |
| 11 | +set ZIP_51=lua-%VER_51%_Win32_bin.zip |
| 12 | +set ZIP_52=lua-%VER_52%_Win32_bin.zip |
| 13 | +set ZIP_53=lua-%VER_53%_Win32_bin.zip |
| 14 | + |
| 15 | +:cinst |
| 16 | +@echo off |
| 17 | +if NOT "%LUAENV%"=="cinst" goto lua51 |
| 18 | +echo Chocolatey install of Lua ... |
| 19 | +if NOT EXIST "C:\Program Files (x86)\Lua\5.1\lua.exe" ( |
| 20 | + @echo on |
| 21 | + cinst lua |
| 22 | +) else ( |
| 23 | + @echo on |
| 24 | + echo Using cached version of Lua |
| 25 | +) |
| 26 | +set LUA="C:\Program Files (x86)\Lua\5.1\lua.exe" |
| 27 | +@echo off |
| 28 | +goto :EOF |
| 29 | + |
| 30 | +:lua51 |
| 31 | +@echo off |
| 32 | +if NOT "%LUAENV%"=="lua51" goto lua52 |
| 33 | +echo Setting up Lua 5.1 ... |
| 34 | +if NOT EXIST "lua51\lua5.1.exe" ( |
| 35 | + @echo on |
| 36 | + echo Fetching Lua v5.1 from internet |
| 37 | + curl -fLsS -o %ZIP_51% http://sourceforge.net/projects/luabinaries/files/%VER_51%/Tools%%20Executables/%ZIP_51%/download |
| 38 | + unzip -d lua51 %ZIP_51% |
| 39 | +) else ( |
| 40 | + echo Using cached version of Lua v5.1 |
| 41 | +) |
| 42 | +set LUA=lua51\lua5.1.exe |
| 43 | +@echo off |
| 44 | +goto :EOF |
| 45 | + |
| 46 | +:lua52 |
| 47 | +@echo off |
| 48 | +if NOT "%LUAENV%"=="lua52" goto lua53 |
| 49 | +echo Setting up Lua 5.2 ... |
| 50 | +if NOT EXIST "lua52\lua52.exe" ( |
| 51 | + @echo on |
| 52 | + echo Fetching Lua v5.2 from internet |
| 53 | + curl -fLsS -o %ZIP_52% http://sourceforge.net/projects/luabinaries/files/%VER_52%/Tools%%20Executables/%ZIP_52%/download |
| 54 | + unzip -d lua52 %ZIP_52% |
| 55 | +) else ( |
| 56 | + echo Using cached version of Lua v5.2 |
| 57 | +) |
| 58 | +@echo on |
| 59 | +set LUA=lua52\lua52.exe |
| 60 | +@echo off |
| 61 | +goto :EOF |
| 62 | + |
| 63 | +:lua53 |
| 64 | +@echo off |
| 65 | +if NOT "%LUAENV%"=="lua53" goto luajit |
| 66 | +echo Setting up Lua 5.3 ... |
| 67 | +if NOT EXIST "lua53\lua53.exe" ( |
| 68 | + @echo on |
| 69 | + echo Fetching Lua v5.3 from internet |
| 70 | + curl -fLsS -o %ZIP_53% http://sourceforge.net/projects/luabinaries/files/%VER_53%/Tools%%20Executables/%ZIP_53%/download |
| 71 | + unzip -d lua53 %ZIP_53% |
| 72 | +) else ( |
| 73 | + echo Using cached version of Lua v5.3 |
| 74 | +) |
| 75 | +@echo on |
| 76 | +set LUA=lua53\lua53.exe |
| 77 | +@echo off |
| 78 | +goto :EOF |
| 79 | + |
| 80 | +:luajit |
| 81 | +if NOT "%LUAENV%"=="luajit20" goto luajit21 |
| 82 | +echo Setting up LuaJIT 2.0 ... |
| 83 | +if NOT EXIST "luajit20\luajit.exe" ( |
| 84 | + call %~dp0install-luajit.cmd LuaJIT-2.0.4 luajit20 |
| 85 | +) else ( |
| 86 | + echo Using cached version of LuaJIT 2.0 |
| 87 | +) |
| 88 | +set LUA=luajit20\luajit.exe |
| 89 | +goto :EOF |
| 90 | + |
| 91 | +:luajit21 |
| 92 | +echo Setting up LuaJIT 2.1 ... |
| 93 | +if NOT EXIST "luajit21\luajit.exe" ( |
| 94 | + call %~dp0install-luajit.cmd LuaJIT-2.1.0-beta2 luajit21 |
| 95 | +) else ( |
| 96 | + echo Using cached version of LuaJIT 2.1 |
| 97 | +) |
| 98 | +set LUA=luajit21\luajit.exe |
0 commit comments