Skip to content

Commit 11f0a04

Browse files
committed
LWJGL configuration
1 parent 89e3e98 commit 11f0a04

14 files changed

+578
-22
lines changed

.github/workflows/lwjgl.yml

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