-
Notifications
You must be signed in to change notification settings - Fork 3
232 lines (226 loc) · 9.35 KB
/
linux-source.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
on: push
jobs:
linux-source:
runs-on: ubuntu-18.04
env:
# = Git-based dependencies =
# Normally, it's not recommended to use actual "branch" since it may result
# in non-reproducible builds (because branches change often). Instead,
# commit hash or tag is preferred.
# Which LOVE tree/version to use?
LOVE_BRANCH: "11.4"
# Which LuaJIT tree/version to use?
LUAJIT_BRANCH: "v2.1"
# Which SDL2 tree/version to use?
SDL2_BRANCH: release-2.28.1
# Which OpenAL-soft tree/version to use?
OPENAL_BRANCH: "1.23.1"
# Which Brotli tree/version to use?
BROTLI_BRANCH: v1.0.9
# Which zlib tree/version to use?
ZLIB_BRANCH: v1.2.13
# = Tarball-based dependencies =
# For these, an exact version number is required as tarballs will be downloaded
# instead of checkouts.
# Which version of Ogg to use?
LIBOGG_VERSION: "1.3.5"
# Which version of Vorbis to use?
LIBVORBIS_VERSION: "1.3.7"
# Which version of Theora to use?
LIBTHEORA_VERSION: "1.2.0alpha1"
# Which version of libpng to use?
LIBPNG_VERSION: "1.6.39"
# Which version of Freetype2 to use?
FT_VERSION: "2.13.0"
# Which version of BZip2 to use?
BZIP2_VERSION: "1.0.8"
# Which version of Mpg123 to use? For LOVE 12.0 (development), set this to empty
# as Mpg123 is no longer used in that particular version.
MPG123_VERSION: "1.31.3"
# Which version of libmodplug to use?
LIBMODPLUG_VERSION: "0.8.8.5"
# Special
# Where to download CMake?
CMAKE_DOWNLOAD_URL: https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh
# Where to download AppImageTool?
APPIMAGETOOL_DOWNLOAD_URL: https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
# Strip binaries?
STRIP_BINARIES: true
steps:
- name: Create Directories
run: mkdir bin installdir cmake
- name: Download Dependencies
run: |
sudo apt-get update && sudo apt-get install build-essential git make cmake \
autoconf automake libtool pkg-config libasound2-dev libpulse-dev libaudio-dev \
libjack-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev \
libxinerama-dev libxxf86vm-dev libxss-dev libgl1-mesa-dev libdbus-1-dev \
libudev-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
fcitx-libs-dev libsamplerate0-dev libsndio-dev libwayland-dev \
libxkbcommon-dev libdrm-dev libgbm-dev curl
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '>=3.10'
- name: Install JSMin (Python Package)
run: python -m pip install jsmin
- name: Download AppImageTool
run: curl -Lfo bin/appimagetool $APPIMAGETOOL_DOWNLOAD_URL && chmod u+x bin/appimagetool
# If you're sure that the system CMake that the GitHub runner uses is at least
# 3.13.1, then feel free to remove these 3 steps below
- name: Download Better CMake
run: curl -Lfo cmake_install.sh $CMAKE_DOWNLOAD_URL && chmod u+x cmake_install.sh
- name: Install Better CMake
run: ./cmake_install.sh --prefix=$PWD/cmake --skip-license
- name: Add Better CMake to PATH
run: realpath cmake/bin >> $GITHUB_PATH
# End of Better CMake related steps
- name: Add bin to PATH
run: realpath bin >> $GITHUB_PATH
- name: Set $INSTALLPREFIX
run: echo "INSTALLPREFIX=`realpath installdir`" >> $GITHUB_ENV
- name: Checkout LÖVE
uses: actions/checkout@v2
with:
repository: love2d/love
ref: ${{ env.LOVE_BRANCH }}
path: love
- name: Checkout LuaJIT
uses: actions/checkout@v2
with:
repository: LuaJIT/LuaJIT
ref: ${{ env.LUAJIT_BRANCH }}
path: luajit
- name: Checkout SDL
uses: actions/checkout@v2
with:
repository: libsdl-org/SDL
ref: ${{ env.SDL2_BRANCH }}
path: sdl2
- name: Checkout OpenAL-soft
uses: actions/checkout@v2
with:
repository: kcat/openal-soft
ref: ${{ env.OPENAL_BRANCH }}
path: openal
- name: Checkout Brotli
uses: actions/checkout@v2
with:
repository: google/brotli
ref: ${{ env.BROTLI_BRANCH }}
path: brotli
- name: Checkout zLib
uses: actions/checkout@v2
with:
repository: madler/zlib
ref: ${{ env.ZLIB_BRANCH }}
path: zlib
- name: Checkout
uses: actions/checkout@v2
with:
path: game
submodules: true
- name: Download Tarball Dependencies
run: |
set -e
DOWNLOAD="python game/scripts/download_deps_linux.py"
$DOWNLOAD http://downloads.xiph.org/releases/ogg/libogg-$LIBOGG_VERSION.tar.gz ogg
$DOWNLOAD http://downloads.xiph.org/releases/vorbis/libvorbis-$LIBVORBIS_VERSION.tar.gz vorbis
$DOWNLOAD http://downloads.xiph.org/releases/theora/libtheora-$LIBTHEORA_VERSION.tar.gz theora
$DOWNLOAD http://prdownloads.sourceforge.net/libpng/libpng-$LIBPNG_VERSION.tar.gz?download png
$DOWNLOAD https://download.savannah.gnu.org/releases/freetype/freetype-$FT_VERSION.tar.gz ft
$DOWNLOAD https://sourceware.org/pub/bzip2/bzip2-$BZIP2_VERSION.tar.gz bz2
if [ ! -z "$MPG123_VERSION" ]; then
$DOWNLOAD https://www.mpg123.de/download/mpg123-$MPG123_VERSION.tar.bz2 mpg123
fi
# Modplug is manual
LIBMODPLUG_FILE=libmodplug-$LIBMODPLUG_VERSION
curl -Lfo $LIBMODPLUG_FILE http://sourceforge.net/projects/modplug-xmms/files/libmodplug/$LIBMODPLUG_VERSION/$LIBMODPLUG_FILE.tar.gz/download
tar xzf $LIBMODPLUG_FILE
mv $LIBMODPLUG_FILE libmodplug
- name: Compile Ogg
run: bash game/scripts/make_autotools_linux.sh ogg
- name: Compile Vorbis
run: bash game/scripts/make_autotools_linux.sh vorbis
- name: Compile Theora
run: bash game/scripts/make_autotools_linux.sh theora --with-ogg=$INSTALLPREFIX --with-vorbis=$INSTALLPREFIX --disable-examples --disable-encode
- name: Compile zLib
run: bash game/scripts/make_autotools_linux.sh zlib
- name: Compile libpng
run: LDFLAGS="-L$INSTALLPREFIX/lib" CFLAGS="-I$INSTALLPREFIX/include" CPPFLAGS="-I$INSTALLPREFIX/include" bash game/scripts/make_autotools_linux.sh png
- name: Compile Brotli
run: bash game/scripts/make_cmake_linux.sh brotli
- name: Compile BZip2
run: |
set -e
pushd bz2
make install -j`nproc` CFLAGS="-fPIC -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64" LDFLAGS="-Wl,-rpath,'\$ORIGIN/../lib'" PREFIX=$INSTALLPREFIX
popd
- name: Compile FreeType
run: CFLAGS="-I$INSTALLPREFIX/include" LDFLAGS="-L$INSTALLPREFIX/lib -Wl,--no-undefined" bash game/scripts/make_autotools_linux.sh ft
- name: Compile OpenAL-soft
run: bash game/scripts/make_cmake_linux.sh openal -DALSOFT_EXAMPLES=0 -DALSOFT_BACKEND_SNDIO=0
- name: Compile SDL2
run: bash game/scripts/make_autotools_linux.sh sdl2
- name: Compile LuaJIT
run: |
set -e
pushd luajit
LDFLAGS="-Wl,-rpath,'\$ORIGIN/../lib'" make amalg -j`nproc` PREFIX=/usr
make install PREFIX=$INSTALLPREFIX
popd
- name: Compile Mpg123
if: ${{ env.MPG123_VERSION != '' }}
run: bash game/scripts/make_autotools_linux.sh mpg123
- name: Compile libmodplug
run: bash game/scripts/make_autotools_linux.sh libmodplug
- name: Prepare LÖVE
run: |
set -e
pushd love
bash platform/unix/genmodules
cp platform/unix/configure.ac .
cp platform/unix/Makefile.am .
autoheader
libtoolize --force
aclocal -I $INSTALLPREFIX/share/aclocal
autoconf -I$INSTALLPREFIX
automake -a
popd
- name: Compile LÖVE
run: CFLAGS="-I$INSTALLPREFIX/include" LDFLAGS="-L$INSTALLPREFIX/lib" bash game/scripts/make_autotools_linux.sh love
- name: List Files in $INSTALLPREFIX
run: find $INSTALLPREFIX -type f
# If you want to strip binaries later, remove this step.
- name: Prepare & Strip Binaries
if: ${{ env.STRIP_BINARIES }}
run: |
set -e
! rm -rf $INSTALLPREFIX/share/man
! rm -rf $INSTALLPREFIX/share/doc
! rm -rf $INSTALLPREFIX/share/openal
! rm -rf $INSTALLPREFIX/lib/mpg123
! rm -rf $INSTALLPREFIX/lib/cmake
! rm -rf $INSTALLPREFIX/lib/pkgconfig
! rm -rf $INSTALLPREFIX/lib/*.a
! rm -rf $INSTALLPREFIX/lib/*.la
! rm -rf $INSTALLPREFIX/lib/*.la
! rm -rf $INSTALLPREFIX/include
! rm -rf $INSTALLPREFIX/man
! find $INSTALLPREFIX/bin -type l -exec rm -rf {} +
! find $INSTALLPREFIX/bin ! -name 'luajit*' ! -name 'love' -type f -exec rm -f {} +
! strip $INSTALLPREFIX/lib/*
# End of strip binaries
- name: Prepare Directory for Packaging
run: cd game && python scripts/prepare_appimage_linux.py
- name: Compile AppRun
run: gcc -o $INSTALLPREFIX/AppRun -O2 -fPIC game/scripts/apprun_linux.c
- name: Copy Game
run: cp -r game/game $INSTALLPREFIX/share/lovegame
- name: Package
run: appimagetool $INSTALLPREFIX linux-source-x86_64.AppImage
- name: Artifact
uses: actions/upload-artifact@v2
with:
name: linux-source-x86_64
path: linux-source-x86_64.AppImage