Skip to content

Commit e496d9e

Browse files
committed
Ensure luarocks uses the correct lua version
1 parent 780fbbd commit e496d9e

File tree

2 files changed

+41
-6
lines changed

2 files changed

+41
-6
lines changed

.github/workflows/buildAndTest-FreeBSD.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: "actions/checkout@v6"
1818
- name: "Setup FreeBSD VM"
19-
uses: vmactions/freebsd-vm@v1.3.0
19+
uses: vmactions/freebsd-vm@v1
2020
id: vm
2121
with:
2222
#usesh: true
@@ -32,7 +32,23 @@ jobs:
3232
source ./scripts/compilerName.sh
3333
sudo pkg install -y cmake git ${{ matrix.lua }} "$C_COMPILER_PACKAGE"
3434
export LUA_BIN_NAME=${{ matrix.lua }}
35-
bash -x scripts/buildLuaRocks.sh
35+
case ${{ matrix.lua }} in
36+
*lua54*)
37+
bash -x scripts/buildLuaRocks.sh "5.4"
38+
;;
39+
*lua53*)
40+
bash -x scripts/buildLuaRocks.sh "5.3"
41+
;;
42+
*lua52*)
43+
bash -x scripts/buildLuaRocks.sh "5.2"
44+
;;
45+
*lua51*)
46+
bash -x scripts/buildLuaRocks.sh "5.1"
47+
;;
48+
*)
49+
bash -x scripts/buildLuaRocks.sh
50+
;;
51+
esac
3652
sudo luarocks
3753
sudo luarocks install luaunit
3854
'

scripts/buildLuaRocks.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# First arg is lua version: 5.4, 5.3, 5.2, 5.1
12

23
case $(uname -v) in
34
*FreeBSD*)
@@ -12,14 +13,32 @@ wget "https://luarocks.org/releases/luarocks-3.12.2.tar.gz"
1213
tar -zxpf luarocks-3.12.2.tar.gz
1314
rm luarocks-3.12.2.tar.gz
1415
cd luarocks-3.12.2
15-
case $(uname -v) in
16-
*FreeBSD*)
17-
./configure --with-lua-bin="/usr/local/bin/"
16+
# case $(uname -v) in
17+
# *FreeBSD*)
18+
# ./configure --with-lua-bin="/usr/local/bin/"
19+
# ;;
20+
# *)
21+
# ./configure
22+
# ;;
23+
# esac
24+
25+
case $1 in
26+
*5.4*)
27+
./configure --lua-version="5.4"
28+
;;
29+
*5.3*)
30+
./configure --lua-version="5.3"
31+
;;
32+
*5.2*)
33+
./configure --lua-version="5.2"
34+
;;
35+
*5.1*)
36+
./configure --lua-version="5.1"
1837
;;
1938
*)
2039
./configure
2140
;;
22-
esac
41+
esac
2342

2443
make
2544
sudo make install

0 commit comments

Comments
 (0)