Skip to content

Commit e56350a

Browse files
committed
Add lua installation .cmd for appveyor
1 parent 327ae8c commit e56350a

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

.appveyor/install-lua.cmd

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# exclude all dot files except .git and travis files
22
.*
33
!.git*
4+
!.appveyor*
45
!.travis.yml
56

67
# exclude binaries and temporary files

appveyor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ environment:
2121
- tbs_arch: x64
2222
tbs_tools: msvc
2323
tbs_config: Release
24+
install:
25+
- SET LUAENV=lua51
26+
- cmd: .appveyor\install-lua.cmd
27+
2428
build_script:
2529
- C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\mingw32-make --version
2630
- C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin\g++ --version

0 commit comments

Comments
 (0)