Skip to content

Commit

Permalink
Merge pull request #70928 from andrei8l/github-build-libbacktrace
Browse files Browse the repository at this point in the history
github: build libbacktrace locally and use it for linux/mingw bindist
  • Loading branch information
Maleclypse authored Jan 15, 2024
2 parents 6e2ce2a + 3fa3c4f commit c0b5068
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,15 @@ jobs:
sound: 1
- name: Windows Tiles x64
mxe: x86_64
libbacktrace: 1
artifact: windows-tiles-x64
os: ubuntu-latest
ext: zip
content: application/zip
sound: 0
- name: Windows Tiles Sounds x64
mxe: x86_64
libbacktrace: 1
artifact: windows-tiles-sounds-x64
os: ubuntu-latest
ext: zip
Expand All @@ -89,6 +91,7 @@ jobs:
os: ubuntu-20.04
mxe: none
android: none
libbacktrace: 1
tiles: 1
sound: 0
artifact: linux-tiles-x64
Expand All @@ -98,6 +101,7 @@ jobs:
os: ubuntu-20.04
mxe: none
android: none
libbacktrace: 1
tiles: 1
sound: 1
artifact: linux-tiles-sounds-x64
Expand All @@ -107,6 +111,7 @@ jobs:
os: ubuntu-20.04
mxe: none
android: none
libbacktrace: 1
tiles: 0
sound: 0
artifact: linux-curses-x64
Expand Down Expand Up @@ -207,9 +212,6 @@ jobs:
curl -L -o SDL2-devel-2.26.2-mingw.tar.gz https://github.com/libsdl-org/SDL/releases/download/release-2.26.2/SDL2-devel-2.26.2-mingw.tar.gz
shasum -a 256 -c ./build-scripts/SDL2-devel-2.26.2-mingw.tar.gz.sha256
sudo tar -xzf SDL2-devel-2.26.2-mingw.tar.gz -C /opt/mxe/usr/${{ matrix.mxe }}-w64-mingw32.static.gcc12 --strip-components=2 SDL2-2.26.2/${{ matrix.mxe }}-w64-mingw32
curl -L -o libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz https://github.com/Qrox/libbacktrace/releases/download/2020-01-03/libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz
shasum -a 256 -c ./build-scripts/libbacktrace-${{ matrix.mxe }}-w64-mingw32-sha256
sudo tar -xzf libbacktrace-${{ matrix.mxe }}-w64-mingw32.tar.gz --exclude=LICENSE -C /opt/mxe/usr/${{ matrix.mxe }}-w64-mingw32.static.gcc12
- name: Install dependencies (Linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none' && !matrix.wasm
run: |
Expand Down Expand Up @@ -246,10 +248,20 @@ jobs:
shell: bash
run: |
lang/compile_mo.sh all
- name: Build libbacktrace
if: matrix.libbacktrace == 1
run: |
git clone https://github.com/ianlancetaylor/libbacktrace.git
cd libbacktrace
git checkout 14818b7783eeb9a56c3f0fca78cefd3143f8c5f6
./configure
make -j$((`nproc`+0))
cp LICENSE ${{ github.workspace }}/LICENSE-libbacktrace.txt
sudo make install
- name: Build CDDA (linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none' && matrix.artifact != 'linux-objectcreator-x64' && !matrix.wasm
run: |
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 PCH=0 bindist
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 LIBBACKTRACE=${{ matrix.libbacktrace }} PCH=0 bindist
mv cataclysmdda-0.I.tar.gz cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.tar.gz
- name: Build CDDA (WebAssembly)
if: matrix.wasm
Expand Down Expand Up @@ -298,7 +310,7 @@ jobs:
env:
PLATFORM: /opt/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static.gcc12-
run: |
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 PCH=0 bindist
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 LIBBACKTRACE=${{ matrix.libbacktrace }} PCH=0 bindist
mv cataclysmdda-0.I.zip cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CDDA (windows msvc)
if: runner.os == 'Windows'
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,9 @@ ifeq ($(BACKTRACE),1)
ifeq ($(LIBBACKTRACE),1)
DEFINES += -DLIBBACKTRACE
LDFLAGS += -lbacktrace
ifneq ("$(wildcard LICENSE-libbacktrace.txt)","")
BINDIST_EXTRAS += LICENSE-libbacktrace.txt
endif
endif
endif

Expand Down

0 comments on commit c0b5068

Please sign in to comment.