|
7 | 7 |
|
8 | 8 | jobs: |
9 | 9 | build-lua: |
10 | | - name: Build Lua in Steam Runtime |
| 10 | + name: Get Steam Runtime Compatible Lua |
11 | 11 | runs-on: ubuntu-latest |
12 | 12 | steps: |
13 | | - - name: Build in Steam Runtime container |
| 13 | + - name: Download in Steam Runtime container |
14 | 14 | uses: addnab/docker-run-action@v3 |
15 | 15 | with: |
16 | 16 | image: registry.gitlab.steamos.cloud/steamrt/scout/sdk |
17 | 17 | options: -v ${{ github.workspace }}:/work |
18 | 18 | run: | |
19 | | - # start |
20 | 19 | set -ex |
21 | 20 | apt-get update |
22 | | - apt-get install -y curl build-essential |
| 21 | + apt-get install -y curl |
23 | 22 |
|
24 | 23 | WORKDIR="/tmp/lua-build" |
25 | 24 | mkdir -p "$WORKDIR" |
26 | 25 | cd "$WORKDIR" |
27 | 26 |
|
28 | | - # Download with proper error checking |
29 | | - curl -fsSL "https://www.lua.org/ftp/lua-5.4.7.tar.gz" --output lua.tar.gz |
| 27 | + # Download pre-built library |
| 28 | + curl -L "https://master.dl.sourceforge.net/project/luabinaries/5.4.2/Linux%20Libraries/lua-5.4.2_Linux313_64_lib.tar.gz?viasf=1" -o lua.tar.gz |
30 | 29 |
|
31 | | - # Verify download |
32 | | - if [ ! -s lua.tar.gz ]; then |
33 | | - echo "Download failed or file is empty" |
34 | | - exit 1 |
35 | | - fi |
36 | | -
|
37 | | - # Extract with verification |
| 30 | + # Extract |
38 | 31 | tar xf lua.tar.gz |
39 | | - if [ ! -d "lua-5.4.7" ]; then |
40 | | - echo "Extraction failed" |
41 | | - exit 1 |
42 | | - fi |
43 | | -
|
44 | | - cd "lua-5.4.7" |
45 | | -
|
46 | | - # Download and apply patch |
47 | | - curl -fsSL "https://gist.githubusercontent.com/ZeWaka/5d8a24ded388763bfd2e5213093eac95/raw/63d7664347bbdd59389a8af6eeeb5531335af35c/liblua.so.patch" -o lua-shared-lib.patch |
48 | | - patch -p1 < lua-shared-lib.patch |
49 | | -
|
50 | | - # Build with patched Makefile and PIC |
51 | | - make linux MYCFLAGS="-fPIC" |
52 | 32 |
|
53 | | - cd src |
54 | | -
|
55 | | - # Test the library |
56 | | - nm -D liblua.so | grep ' T ' || echo "No exported symbols found!" |
57 | | - ldd liblua.so || echo "Library dependencies not found!" |
58 | | -
|
59 | | - # Copy and rename |
| 33 | + # Copy library |
60 | 34 | mkdir -p /work/artifacts |
61 | | - cp liblua.so /work/artifacts/liblua5.4.so |
| 35 | + cp liblua54.so /work/artifacts/ |
62 | 36 |
|
63 | | - # Verify copy |
64 | | - if [ ! -f /work/artifacts/liblua5.4.so ]; then |
65 | | - echo "Failed to copy library" |
66 | | - exit 1 |
67 | | - fi |
| 37 | + # Test the library |
| 38 | + ldd /work/artifacts/liblua54.so || echo "Library dependencies not found!" |
68 | 39 |
|
69 | 40 | - name: Upload Lua library |
70 | 41 | uses: actions/upload-artifact@v4 |
71 | 42 | with: |
72 | 43 | name: steamrt-lua |
73 | | - path: artifacts/liblua5.4.so |
| 44 | + path: artifacts/liblua54.so |
74 | 45 | if-no-files-found: error |
0 commit comments