Skip to content

Commit

Permalink
github: build sdl2 locally for linux releases (CleverRaven#72026)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei8l authored Feb 28, 2024
1 parent b97b959 commit 8ef17c1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,16 @@ jobs:
- name: Install dependencies (Linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none' && !matrix.wasm
run: |
git clone https://github.com/libsdl-org/SDL.git --branch release-2.0.20 --depth 1
cd SDL
mkdir build
cd build
../configure
make -j$((`nproc`+0))
sudo make install
cp ../LICENSE.txt ${{ github.workspace }}/LICENSE-SDL.txt
sudo apt-get update
sudo apt-get install libncursesw5-dev libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev \
sudo apt-get install libncursesw5-dev libsdl2-ttf-dev libsdl2-image-dev \
libsdl2-mixer-dev libpulse-dev ccache gettext parallel
- name: Install Emscripten (WebAssembly)
if: matrix.wasm
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,11 @@ endif

ifeq ($(TARGETSYSTEM),LINUX)
BINDIST_EXTRAS += cataclysm-launcher
ifneq ("$(wildcard LICENSE-SDL.txt)","")
SDL2_solib = $(shell ldd $(TARGET) | grep libSDL2-2\.0 | cut -d ' ' -f 3)
INSTALL_EXTRAS += $(SDL2_solib)
BINDIST_EXTRAS += LICENSE-SDL.txt
endif
ifeq ($(BACKTRACE),1)
# -rdynamic needed for symbols in backtraces
LDFLAGS += -rdynamic
Expand Down Expand Up @@ -1296,6 +1301,7 @@ endif # ifeq ($(NATIVE), osx)
$(BINDIST): distclean version $(TARGET) $(L10N) $(BINDIST_EXTRAS) $(BINDIST_LOCALE)
mkdir -p $(BINDIST_DIR)
cp -R $(TARGET) $(BINDIST_EXTRAS) $(BINDIST_DIR)
$(foreach lib,$(INSTALL_EXTRAS), install --strip $(lib) $(BINDIST_DIR))
ifdef LANGUAGES
cp -R --parents lang/mo $(BINDIST_DIR)
endif
Expand Down
2 changes: 1 addition & 1 deletion cataclysm-launcher
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fi

if [ "$BIN" ]
then
exec ./$BIN "$@"
env LD_LIBRARY_PATH="${DIR}:${LD_LIBRARY_PATH}" ./"${BIN}" "$@"
else
printerr "Couldn't find cataclysm game binary in '$DIR'/"
exit 1
Expand Down

0 comments on commit 8ef17c1

Please sign in to comment.