Skip to content

Commit 14b4185

Browse files
committed
CI Linux: build up-to-date glfw
1 parent 1a1bee8 commit 14b4185

File tree

3 files changed

+45
-1
lines changed

3 files changed

+45
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/sh -eu
2+
3+
dir=$(dirname "$0")
4+
# shellcheck source=/dev/null
5+
. "$dir/common.sh" # for get_build_deps_excl
6+
7+
# build dir that will be restored from cache
8+
cache_dir=/var/tmp/glfw
9+
10+
# install the deps - runs always (regardless the cache)
11+
deps() {
12+
sudo apt build-dep libglfw3
13+
}
14+
15+
# build SDL, SDL_ttf and fluidsynth and also install them
16+
build_install() {
17+
mkdir -p $cache_dir
18+
cd $cache_dir
19+
20+
git clone --depth 1 https://github.com/glfw/glfw.git
21+
cmake -S glfw -B glfw/build \
22+
-DGLFW_BUILD_WAYLAND=ON -DGLFW_BUILD_X11=ON
23+
cmake --build glfw/build -j "$(nproc)"
24+
sudo cmake --install glfw/build
25+
}
26+
27+
# if cache is successfully restored, just install the builds
28+
install_cached() {
29+
cd $cache_dir
30+
sudo cmake --install glfw/build
31+
}
32+
33+
deps
34+
if [ -d $cache_dir ]; then
35+
install_cached
36+
else
37+
build_install
38+
fi

.github/scripts/Linux/prepare.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ sudo apt install appstream `# appstreamcli for mkappimage AppStream validation`
2525
asciidoc
2626
sudo apt install fonts-dejavu-core
2727
sudo apt --no-install-recommends install nvidia-cuda-toolkit
28-
sudo apt install libglew-dev libglfw3-dev
28+
sudo apt install libglew-dev
2929
sudo apt install libglm-dev
3030
sudo apt install imagemagick libmagickwand-dev
3131
sudo apt install libsoxr-dev libspeexdsp-dev
@@ -52,4 +52,5 @@ qt6.conf" "/usr/lib/$(uname -m)-linux-gnu/qt-default/qtchooser/default.conf"
5252

5353
"$dir"/install_sdl.sh
5454
"$dir"/install_ffmpeg.sh
55+
"$dir"/install_glfw.sh
5556

.github/workflows/ccpp.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ jobs:
8585
with:
8686
path: '/var/tmp/sdl'
8787
key: cache-sdl-${{ runner.os }}-${{ hashFiles( '.github/scripts/Linux/install_sdl.sh' ) }}
88+
- name: Cache GLFW
89+
uses: actions/cache@main
90+
with:
91+
path: '/var/tmp/glfw'
92+
key: cache-sdl-${{ runner.os }}-${{ hashFiles( '.github/scripts/Linux/install_glfw.sh' ) }}
8893
- name: bootstrap
8994
run: |
9095
. .github/scripts/environment.sh

0 commit comments

Comments
 (0)