Skip to content

Commit 89dbee6

Browse files
committed
LWJGL configuration
1 parent 42608f7 commit 89dbee6

12 files changed

+550
-17
lines changed

.github/workflows/lwjgl.yml

Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
# IMPORTANT: after HEAD is updated, the "LWJGL" tag must be recreated!
2+
name: LWJGL Build
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- master
9+
10+
env:
11+
AWS_DEFAULT_REGION: us-east-1
12+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
13+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
14+
S3_PARAMS: --cache-control "public,must-revalidate,proxy-revalidate,max-age=0"
15+
FREETYPE_PARAMS: --wrap-mode=default --force-fallback-for=harfbuzz,libpng,zlib -Dbrotli=disabled -Dbzip2=disabled -Dharfbuzz=enabled -Dpng=enabled -Dzlib=system -Dtests=disabled -Dbuildtype=release -Dfreetype2:zlib=disabled -Dfreetype2:png=disabled -Dharfbuzz:experimental_api=true -Db_lto=true -Db_ndebug=true
16+
17+
jobs:
18+
linux:
19+
name: Linux
20+
runs-on: ubuntu-latest
21+
container:
22+
image: centos:7
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
ARCH: [x64]
27+
include:
28+
- ARCH: x64
29+
defaults:
30+
run:
31+
shell: bash
32+
env:
33+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
34+
steps:
35+
- name: Upgrade git
36+
run: |
37+
sed -i \
38+
-e 's/^mirrorlist/#mirrorlist/' \
39+
-e 's/^#baseurl/baseurl/' \
40+
-e 's/mirror\.centos\.org/vault.centos.org/' \
41+
/etc/yum.repos.d/*.repo
42+
yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
43+
yum -y install git
44+
- uses: actions/checkout@v3
45+
with:
46+
fetch-depth: 3
47+
- name: Configure yum
48+
run: |
49+
yum -y install epel-release
50+
yum -y update
51+
- name: Install build dependencies
52+
run: |
53+
yum -y install centos-release-scl
54+
sed -i \
55+
-e 's/^mirrorlist/#mirrorlist/' \
56+
-e 's/^#baseurl/baseurl/' \
57+
-e 's/^# baseurl/baseurl/' \
58+
-e 's/mirror\.centos\.org/vault.centos.org/' \
59+
/etc/yum.repos.d/CentOS-SCLo-scl*.repo
60+
yum -y install devtoolset-11-gcc-c++
61+
yum -y install python3 awscli libpng-dev
62+
- name: Install HarfBuzz dependencies
63+
run: |
64+
yum -y install ninja-build
65+
pip3 install meson
66+
- name: Configure build
67+
run: |
68+
source scl_source enable devtoolset-11 || true
69+
meson setup build $FREETYPE_PARAMS
70+
- name: Build
71+
run: |
72+
source scl_source enable devtoolset-11 || true
73+
meson compile --verbose -C build
74+
strip build/libfreetype.so
75+
- name: Upload artifact
76+
run: aws s3 cp build/libfreetype.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
77+
- name: Upload git revision
78+
run: |
79+
git config --global --add safe.directory $PWD
80+
git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libfreetype.so.git
81+
aws s3 cp libfreetype.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
82+
83+
linux-cross:
84+
name: Linux Cross
85+
runs-on: ubuntu-22.04
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
ARCH: [arm32, arm64, ppc64le, riscv64]
90+
include:
91+
# -----
92+
- ARCH: arm32
93+
CROSS_ARCH: armhf
94+
TRIPLET: arm-linux-gnueabihf
95+
# -----
96+
- ARCH: arm64
97+
CROSS_ARCH: arm64
98+
TRIPLET: aarch64-linux-gnu
99+
# -----
100+
- ARCH: ppc64le
101+
CROSS_ARCH: ppc64el
102+
TRIPLET: powerpc64le-linux-gnu
103+
# -----
104+
- ARCH: riscv64
105+
CROSS_ARCH: riscv64
106+
TRIPLET: riscv64-linux-gnu
107+
env:
108+
LWJGL_ARCH: ${{matrix.ARCH}}
109+
defaults:
110+
run:
111+
shell: bash
112+
steps:
113+
- uses: actions/checkout@v4
114+
with:
115+
fetch-depth: 3
116+
- name: Install dependencies
117+
run: |
118+
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq update
119+
DEBIAN_FRONTEND=noninteractive sudo apt-get -yq install awscli ninja-build python3-pip gcc-${{matrix.TRIPLET}} g++-${{matrix.TRIPLET}} libc6-dev-${{matrix.CROSS_ARCH}}-cross
120+
- name: Install meson
121+
run: pip3 install meson
122+
# - name: Prepare cross-compilation for ${{matrix.CROSS_ARCH}}
123+
# run: |
124+
# sudo sed -i 's/deb mirror/deb [arch=amd64,i386] mirror/' /etc/apt/sources.list
125+
# sudo grep "mirror+file" /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/ports.list
126+
# sudo sed -i 's/amd64,i386/${{matrix.CROSS_ARCH}}/' /etc/apt/sources.list.d/ports.list
127+
# sudo sed -i 's#mirror+file:/etc/apt/apt-mirrors.txt#http://ports.ubuntu.com/ubuntu-ports/#' /etc/apt/sources.list.d/ports.list
128+
# sudo dpkg --add-architecture ${{matrix.CROSS_ARCH}}
129+
# sudo apt-get update || true
130+
- name: Configure build
131+
run: meson setup build $FREETYPE_PARAMS --cross-file lwjgl_linux_${{matrix.ARCH}}.cross
132+
- name: Build
133+
run: |
134+
meson compile --verbose -C build
135+
${{matrix.TRIPLET}}-strip build/libfreetype.so
136+
- name: Upload artifact
137+
run: aws s3 cp build/libfreetype.so s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
138+
- name: Upload git revision
139+
run: |
140+
git config --global --add safe.directory $(pwd)
141+
git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libfreetype.so.git
142+
aws s3 cp libfreetype.so.git s3://lwjgl-build/nightly/linux/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
143+
144+
freebsd-cross:
145+
name: FreeBSD Cross
146+
runs-on: ubuntu-latest
147+
strategy:
148+
fail-fast: false
149+
steps:
150+
- uses: actions/checkout@v3
151+
with:
152+
fetch-depth: 3
153+
- name: Build
154+
uses: cross-platform-actions/[email protected]
155+
with:
156+
operating_system: freebsd
157+
architecture: x86-64
158+
version: '13.3'
159+
memory: 4G
160+
shell: bash
161+
environment_variables: FREETYPE_PARAMS
162+
run: |
163+
sudo pkg install -y git python3 png ninja
164+
python3 -m ensurepip --upgrade
165+
export PATH=$PATH:/home/runner/.local/bin
166+
pip3 install meson
167+
meson setup build $FREETYPE_PARAMS
168+
meson compile --verbose -C build
169+
strip build/libfreetype.so
170+
- name: Upload artifact # Symlinks are not copied out of the VM. These SOs are versioned.
171+
#run: aws s3 cp `find -E . -maxdepth 2 -regex './build/libfreetype.so(\.[0-9]+)*'` s3://lwjgl-build/nightly/freebsd/x64/libfreetype.so ${{env.S3_PARAMS}}
172+
run: aws s3 cp build/libfreetype.so s3://lwjgl-build/nightly/freebsd/x64/ ${{env.S3_PARAMS}}
173+
- name: Upload git revision
174+
run: |
175+
git config --global --add safe.directory $PWD
176+
git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libfreetype.so.git
177+
aws s3 cp libfreetype.so.git s3://lwjgl-build/nightly/freebsd/x64/ ${{env.S3_PARAMS}}
178+
179+
macos:
180+
name: macOS
181+
runs-on: macos-latest
182+
strategy:
183+
fail-fast: false
184+
matrix:
185+
ARCH: [x64, arm64]
186+
include:
187+
- ARCH: x64
188+
MACOS: 10.11
189+
MESON_PARAMS: --cross-file lwjgl_macos_x64.cross
190+
- ARCH: arm64
191+
MACOS: 11.0
192+
MESON_PARAMS: --cross-file lwjgl_macos_arm64.cross
193+
env:
194+
MACOSX_DEPLOYMENT_TARGET: 11.0
195+
steps:
196+
- uses: actions/checkout@v3
197+
with:
198+
fetch-depth: 3
199+
- name: Install dependencies
200+
run: brew install meson
201+
- name: Configure build
202+
run: MACOSX_DEPLOYMENT_TARGET=${{matrix.MACOS}} meson setup build $FREETYPE_PARAMS -Dharfbuzz:coretext=enabled ${{matrix.MESON_PARAMS}}
203+
- name: Build
204+
run: |
205+
MACOSX_DEPLOYMENT_TARGET=${{matrix.MACOS}} meson compile --verbose -C build
206+
strip -u -r build/libfreetype.dylib
207+
- name: Upload artifact
208+
run: aws s3 cp build/libfreetype.dylib s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
209+
- name: Upload git revision
210+
run: |
211+
git log --first-parent --pretty=format:%H HEAD~2..HEAD~1 > libfreetype.dylib.git
212+
aws s3 cp libfreetype.dylib.git s3://lwjgl-build/nightly/macosx/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}
213+
214+
windows:
215+
name: Windows
216+
runs-on: windows-latest
217+
strategy:
218+
fail-fast: false
219+
matrix:
220+
ARCH: [x86, x64, arm64]
221+
include:
222+
- ARCH: x86
223+
MSVC_ARCH: amd64_x86
224+
PLATFORM: Win32
225+
MESON_PARAMS:
226+
- ARCH: x64
227+
MSVC_ARCH: amd64
228+
PLATFORM: x64
229+
MESON_PARAMS:
230+
- ARCH: arm64
231+
MSVC_ARCH: amd64_arm64
232+
PLATFORM: ARM64
233+
MESON_PARAMS: --cross-file lwjgl_windows_arm64.cross
234+
defaults:
235+
run:
236+
shell: cmd
237+
steps:
238+
- uses: actions/checkout@v3
239+
with:
240+
fetch-depth: 3
241+
- uses: ilammy/msvc-dev-cmd@v1
242+
with:
243+
arch: ${{matrix.MSVC_ARCH}}
244+
# Strawberry Perl is installed by default on the Windows runner, adding a bunch of horrible stuff to PATH.
245+
# Including a freetype build... which Meson picks up. Just nuke it here and everything will be fine.
246+
# See https://github.com/actions/runner-images/issues/5459 for details. We haven't encountered this before
247+
# because Meson uses .a for static MSVC libraries, instead of the usual .lib suffix.
248+
- name: Install dependencies
249+
run: |
250+
pip3 install meson==1.4.1
251+
rmdir C:\Strawberry /s /q
252+
- name: Configure build
253+
run: meson setup build %FREETYPE_PARAMS% -Db_vscrt=mt -Dharfbuzz:gdi=enabled -Dharfbuzz:directwrite=enabled ${{matrix.MESON_PARAMS}}
254+
- name: Build
255+
run: meson compile --verbose -C build
256+
- name: Upload artifact
257+
run: aws s3 cp build\freetype-6.dll s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/freetype.dll ${{env.S3_PARAMS}}
258+
- name: Upload git revision
259+
run: |
260+
git log --first-parent --pretty=format:%%H HEAD~2..HEAD~1 > freetype.dll.git
261+
aws s3 cp freetype.dll.git s3://lwjgl-build/nightly/windows/${{matrix.ARCH}}/ ${{env.S3_PARAMS}}

lwjgl_linux_arm32.cross

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[host_machine]
2+
system = 'linux'
3+
cpu_family = 'arm'
4+
cpu = 'armhf'
5+
endian = 'little'
6+
7+
[binaries]
8+
c = '/usr/bin/arm-linux-gnueabihf-gcc'
9+
cpp = '/usr/bin/arm-linux-gnueabihf-g++'
10+
ar = '/usr/bin/arm-linux-gnueabihf-ar'
11+
strip = '/usr/bin/arm-linux-gnueabihf-strip'
12+
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'

lwjgl_linux_arm64.cross

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[host_machine]
2+
system = 'linux'
3+
cpu_family = 'aarch64'
4+
cpu = 'arm64'
5+
endian = 'little'
6+
7+
[binaries]
8+
c = '/usr/bin/aarch64-linux-gnu-gcc'
9+
cpp = '/usr/bin/aarch64-linux-gnu-g++'
10+
ar = '/usr/bin/aarch64-linux-gnu-gcc-ar'
11+
strip = '/usr/bin/aarch64-linux-gnu-strip'
12+
pkgconfig = '/usr/bin/aarch64-linux-gnu-pkg-config'

lwjgl_linux_ppc64le.cross

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[host_machine]
2+
system = 'linux'
3+
cpu_family = 'ppc64'
4+
cpu = 'ppc64'
5+
endian = 'little'
6+
7+
[binaries]
8+
c = '/usr/bin/powerpc64le-linux-gnu-gcc'
9+
cpp = '/usr/bin/powerpc64le-linux-gnu-g++'
10+
ar = '/usr/bin/powerpc64le-linux-gnu-gcc-ar'
11+
strip = '/usr/bin/powerpc64le-linux-gnu-strip'
12+
pkgconfig = '/usr/bin/powerpc64le-linux-gnu-pkg-config'

lwjgl_linux_riscv64.cross

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[host_machine]
2+
system = 'linux'
3+
cpu_family = 'riscv64'
4+
cpu = 'riscv64'
5+
endian = 'little'
6+
7+
[binaries]
8+
c = '/usr/bin/riscv64-linux-gnu-gcc'
9+
cpp = '/usr/bin/riscv64-linux-gnu-g++'
10+
ar = '/usr/bin/riscv64-linux-gnu-gcc-ar'
11+
strip = '/usr/bin/riscv64-linux-gnu-strip'
12+
pkgconfig = '/usr/bin/riscv64-linux-gnu-pkg-config'

lwjgl_macos_arm64.cross

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[host_machine]
2+
system = 'darwin'
3+
cpu_family = 'aarch64'
4+
cpu = 'arm64'
5+
endian = 'little'
6+
7+
[binaries]
8+
c = ['clang']
9+
cpp = ['clang++']
10+
objc = ['clang']
11+
objcpp = ['clang++']
12+
13+
[built-in options]
14+
c_args = ['-target', 'aarch64-apple-darwin', '-arch', 'arm64']
15+
cpp_args = ['-target', 'aarch64-apple-darwin', '-arch', 'arm64']
16+
objc_args = ['-target', 'aarch64-apple-darwin', '-arch', 'arm64']
17+
objcpp_args = ['-target', 'aarch64-apple-darwin', '-arch', 'arm64']
18+
c_link_args = ['-target', 'aarch64-apple-darwin', '-arch', 'arm64']
19+
cpp_link_args = ['-target', 'aarch64-apple-darwin', '-arch', 'arm64']
20+
objc_link_args = ['-target', 'aarch64-apple-darwin', '-arch', 'arm64']
21+
objcpp_link_args = ['-target', 'aarch64-apple-darwin', '-arch', 'arm64']

lwjgl_macos_x64.cross

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[host_machine]
2+
system = 'darwin'
3+
cpu_family = 'x86_64'
4+
cpu = 'x64'
5+
endian = 'little'
6+
7+
[binaries]
8+
c = ['clang']
9+
cpp = ['clang++']
10+
objc = ['clang']
11+
objcpp = ['clang++']
12+
13+
[built-in options]
14+
c_args = ['-target', 'x64-apple-darwin', '-arch', 'x86_64']
15+
cpp_args = ['-target', 'x64-apple-darwin', '-arch', 'x86_64']
16+
objc_args = ['-target', 'x64-apple-darwin', '-arch', 'x86_64']
17+
objcpp_args = ['-target', 'x64-apple-darwin', '-arch', 'x86_64']
18+
c_link_args = ['-target', 'x64-apple-darwin', '-arch', 'x86_64']
19+
cpp_link_args = ['-target', 'x64-apple-darwin', '-arch', 'x86_64']
20+
objc_link_args = ['-target', 'x64-apple-darwin', '-arch', 'x86_64']
21+
objcpp_link_args = ['-target', 'x64-apple-darwin', '-arch', 'x86_64']

lwjgl_windows_arm64.cross

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[host_machine]
2+
system = 'windows'
3+
cpu_family = 'aarch64'
4+
cpu = 'armv8'
5+
endian = 'little'
6+
7+
[binaries]
8+
c = 'cl'
9+
cpp = 'cl'
10+
fc = 'false'
11+
ar = 'lib'
12+
windres = 'rc'

0 commit comments

Comments
 (0)