Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleclypse committed Oct 6, 2021
2 parents a0f6774 + f22da47 commit 1a86527
Show file tree
Hide file tree
Showing 296 changed files with 194,359 additions and 105,394 deletions.
5 changes: 5 additions & 0 deletions .github/vcpkg_triplets/x86-windows-static.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_BUILD_TYPE release)
5 changes: 5 additions & 0 deletions .github/vcpkg_triplets/x86-windows.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)

set(VCPKG_BUILD_TYPE release)
6 changes: 3 additions & 3 deletions .github/workflows/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ jobs:
tiles: 1
sound: 1
test-stage: 1
title: GCC, Ubuntu cross-compile to MinGW-Win64, Tiles, Sound
title: GCC 11, Ubuntu cross-compile to MinGW-Win64, Tiles, Sound
ldflags: -static-libgcc -static-libstdc++
mxe_target: i686-w64-mingw32.static
mxe_target: i686-w64-mingw32.static.gcc11
wine: wine

- compiler: clang++-6.0
Expand Down Expand Up @@ -197,5 +197,5 @@ jobs:
if: failure()
with:
name: cata_test
path: tests/cata_test
path: tests/cata_test*
if-no-files-found: ignore
4 changes: 2 additions & 2 deletions .github/workflows/msvc-full-features.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
id: runvcpkg
with:
additionalCachedPaths: '${{ runner.workspace }}/Cataclysm-DDA/msvc-full-features/vcpkg_installed'
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**' ) }}
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-x64
setupOnly: true
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: Compile .mo files for localization
run: |
& "C:\Program Files\Git\bin\bash" ./lang/compile_mo.sh all
& "C:\msys64\mingw64\bin\mingw32-make" -C lang -j2
mkdir -p ./data/mods/TEST_DATA/lang/mo/ru/LC_MESSAGES -ErrorAction SilentlyContinue
msgfmt -f -o ./data/mods/TEST_DATA/lang/mo/ru/LC_MESSAGES/TEST_DATA.mo ./data/mods/TEST_DATA/lang/po/ru.po
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/object_creator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
id: runvcpkg
with:
additionalCachedPaths: '${{ runner.workspace }}/Cataclysm-DDA/msvc-full-features/vcpkg_installed;${{ runner.workspace }}/Cataclysm-DDA/msvc-object_creator/vcpkg_installed'
appendedCacheKey: ${{ hashFiles( '$msvc-full-features/vcpkg.json', 'msvc-object_creator/vcpkg.json', '.github/vcpkg_triplets/**' ) }}
appendedCacheKey: ${{ hashFiles( '$msvc-full-features/vcpkg.json', 'msvc-object_creator/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-x64
setupOnly: true
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
Expand Down
94 changes: 65 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ jobs:
fail-fast: false
matrix:
include:
- name: Windows Tiles x64 MSVC
artifact: windows-tiles-x64-msvc
arch: x64
os: windows-2019
mxe: none
ext: zip
content: application/zip
- name: Windows Tiles x32 MSVC
artifact: windows-tiles-x32-msvc
arch: x86
os: windows-2019
mxe: none
ext: zip
content: application/zip
- name: Windows Tiles x64
mxe: x86_64
artifact: windows-tiles-x64
Expand Down Expand Up @@ -127,7 +141,28 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install dependencies (windows)
- name: Install dependencies (windows msvc) (1/3)
if: runner.os == 'Windows'
uses: microsoft/[email protected]
- name: Install dependencies (windows msvc) (2/3)
if: runner.os == 'Windows'
uses: lukka/run-vcpkg@main
id: runvcpkg
with:
additionalCachedPaths: '${{ runner.workspace }}/Cataclysm-DDA/msvc-full-features/vcpkg_installed'
appendedCacheKey: ${{ hashFiles( 'msvc-full-features/vcpkg.json', '.github/vcpkg_triplets/**' ) }}-${{ matrix.arch }}
setupOnly: true
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
# We have to use at least this version of vcpkg to include fixes for yasm-tool's
# availability only as an x86 host tool. Keep it in sync with the builtin-baseline
# field in vcpkg.json. Caching happens as a post-action which runs at the end of
# the whole workflow, after vcpkg install happens during msbuild run.
vcpkgGitCommitId: '49b67d9cb856424ff69f10e7721aec5299624268'
- name: Install dependencies (windows msvc) (3/3)
if: runner.os == 'Windows'
run: |
vcpkg integrate install
- name: Install dependencies (windows mxe)
if: matrix.mxe != 'none'
run: |
sudo apt install astyle autoconf automake autopoint bash bison bzip2 cmake flex gettext git g++ gperf intltool \
Expand All @@ -136,11 +171,13 @@ jobs:
- name: Install MXE
if: matrix.mxe != 'none'
run: |
sudo apt install software-properties-common lsb-release
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 86B72ED9
sudo add-apt-repository "deb [arch=amd64] https://pkg.mxe.cc/repos/apt `lsb_release -sc` main"
sudo apt update
sudo apt install mxe-{i686,x86-64}-w64-mingw32.static-{sdl2,sdl2-ttf,sdl2-image,sdl2-mixer,gettext}
curl -L -o mxe-${{ matrix.mxe }}.tar.xz https://github.com/BrettDong/MXE-GCC/releases/download/mxe-gcc-11.2/mxe-${{ matrix.mxe }}.tar.xz
curl -L -o mxe-${{ matrix.mxe }}.tar.xz.sha256 https://github.com/BrettDong/MXE-GCC/releases/download/mxe-gcc-11.2/mxe-${{ matrix.mxe }}.tar.xz.sha256
shasum -a 256 -c ./mxe-${{ matrix.mxe }}.tar.xz.sha256
sudo tar xJf mxe-${{ matrix.mxe }}.tar.xz -C /opt
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.gcc11
- name: Install dependencies (Linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none'
run: |
Expand All @@ -152,39 +189,43 @@ jobs:
run: |
HOMEBREW_NO_AUTO_UPDATE=yes HOMEBREW_NO_INSTALL_CLEANUP=yes brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gettext ccache parallel
pip3 install dmgbuild==1.4.2 biplist
- name: Build CDDA (linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none'
- name: Create VERSION.TXT
shell: bash
run: |
cat >VERSION.txt <<EOL
build type: ${{ matrix.artifact }}
build number: ${{ needs.release.outputs.timestamp }}
commit sha: ${{ github.sha }}
commit url: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
EOL
- name: Compile translations (windows)
if: runner.os == 'Windows'
shell: bash
run: |
lang/compile_mo.sh all
- name: Build CDDA (linux)
if: runner.os == 'Linux' && matrix.mxe == 'none' && matrix.android == 'none'
run: |
make -j$((`nproc`+0)) TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=0 PCH=0 bindist
mv cataclysmdda-0.F.tar.gz cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.tar.gz
- name: Build CDDA (windows)
- name: Build CDDA (windows mxe)
if: matrix.mxe != 'none'
env:
PLATFORM: /usr/lib/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static-
PLATFORM: /opt/mxe/usr/bin/${{ matrix.mxe }}-w64-mingw32.static.gcc11-
run: |
cat >VERSION.txt <<EOL
build type: ${{ matrix.artifact }}
build number: ${{ needs.release.outputs.timestamp }}
commit sha: ${{ github.sha }}
commit url: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
EOL
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=0 PCH=0 bindist
make -j$((`nproc`+0)) CROSS="${PLATFORM}" TILES=1 SOUND=1 RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=1 PCH=0 bindist
mv cataclysmdda-0.F.zip cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CDDA (windows msvc)
if: runner.os == 'Windows'
env:
VCPKG_OVERLAY_TRIPLETS: ${{ github.workspace }}\.github\vcpkg_triplets
run: |
msbuild -m -p:Configuration=Release -p:Platform=${{ matrix.arch }} "-target:Cataclysm-vcpkg-static;JsonFormatter-vcpkg-static" msvc-full-features\Cataclysm-vcpkg-static.sln
.\build-scripts\windist.ps1
mv cataclysmdda-0.F.zip cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.zip
- name: Build CDDA (osx)
if: runner.os == 'macOS'
run: |
cat >VERSION.txt <<EOL
build type: ${{ matrix.artifact }}
build number: ${{ needs.release.outputs.timestamp }}
commit sha: ${{ github.sha }}
commit url: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
EOL
make -j3 TILES=${{ matrix.tiles }} SOUND=${{ matrix.tiles }} RELEASE=1 LOCALIZE=1 LANGUAGES=all BACKTRACE=0 PCH=0 USE_HOME_DIR=1 OSX_MIN=10.12 dmgdist
mv Cataclysm.dmg cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.dmg
- name: Set up JDK 8 (android)
Expand All @@ -196,12 +237,6 @@ jobs:
- name: Setup Build and Dependencies (android)
if: runner.os == 'Linux' && matrix.android != 'none' && matrix.mxe == 'none'
run: |
cat >VERSION.txt <<EOL
build type: ${{ matrix.artifact }}
build number: ${{ needs.release.outputs.timestamp }}
commit sha: ${{ github.sha }}
commit url: https://github.com/${{ github.repository }}/commit/${{ github.sha }}
EOL
sudo apt-get update
sudo apt-get install gettext
- name: Build CDDA (android)
Expand Down Expand Up @@ -238,6 +273,7 @@ jobs:
asset_name: cdda-${{ matrix.artifact }}-${{ needs.release.outputs.timestamp }}.${{ matrix.ext }}
asset_content_type: ${{ matrix.content }}
- name: Trigger GitHub pages rebuild
shell: bash
run: |
curl --fail --request POST \
--url https://api.github.com/repos/${{ github.repository }}/pages/builds \
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/text-changes-analyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Text Changes Analyzer


on:
pull_request:
branches:
- master
paths:
- '.github/workflows/text-changes-analyzer.yml'
- 'tools/check_po_printf_format.py'
- 'src/*.h'
- 'src/*.cpp'
- '**.json'


jobs:
analyze-text-changes:
runs-on: ubuntu-20.04
steps:
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install python3-pip gettext
sudo pip3 install polib
- name: "Checkout master branch"
uses: actions/checkout@v2
with:
ref: master
- name: "Generate translation template of master branch"
run: |
rm -f lang/po/cataclysm-dda.pot
./lang/update_pot.sh
cp lang/po/cataclysm-dda.pot ~/master.pot
- name: "Fetch pull request patches"
run: |
wget ${{ github.event.pull_request.patch_url }} -O ~/pr.patch
- name: "Apply pull request patch"
run: |
git config user.email "TEST@localhost"
git config user.name TEST
git am ~/pr.patch
- name: "Generate translation template of pull request branch"
run: |
rm -f lang/po/cataclysm-dda.pot
./lang/update_pot.sh
cp lang/po/cataclysm-dda.pot ~/pull-request.pot
- name: "List text changes"
run: |
python3 ./tools/pot_diff.py ~/master.pot ~/pull-request.pot
3 changes: 3 additions & 0 deletions LICENSE-OFL-Terminus-Font.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Copyright (c) 2019 Dimitar Toshkov Zhekov,
with Reserved Font Name "Terminus Font".

Copyright (c) 2017 tisimst
with Reserved Font Name "Vecterminus"

Copyright (c) 2011 Tilman Blumenbach,
with Reserved Font Name "Terminus (TTF)".

Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Cataclysm is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unpo

GNU Unifont (data/font/unifont.ttf) is licensed under GNU General Public License v2+ with the GNU font embedding exception. Visit http://unifoundry.com/LICENSE.txt for details.

Terminus Font (data/font/terminus.ttf) is licensed under the SIL Open Font License (see LICENSE-OFL-Terminus-Font.txt).
Vecterminus Font (data/font/VecTerminus12Medium.otf) is licensed under the SIL Open Font License (see LICENSE-OFL-Terminus-Font.txt).

CATCH unit-test framework (tests/catch/catch.hpp) is licensed under the Boost Software License. Visit https://github.com/philsquared/Catch/blob/master/LICENSE.txt to read the license.

Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ MO_DEPS := \
$(shell find data/{raw,json,mods,core,help} -type f -name '*.json')

lang/mo_built.stamp: $(MO_DEPS)
lang/compile_mo.sh $(LANGUAGES)
$(MAKE) -C lang
touch $@

localization: lang/mo_built.stamp
Expand Down Expand Up @@ -1020,7 +1020,7 @@ endif
LICENSE.txt LICENSE-OFL-Terminus-Font.txt -t $(DATA_PREFIX)
mkdir -p $(LOCALE_DIR)
ifdef LANGUAGES
LOCALE_DIR=$(LOCALE_DIR) lang/compile_mo.sh $(LANGUAGES)
$(MAKE) -C lang
endif
endif

Expand Down Expand Up @@ -1056,7 +1056,7 @@ endif
LICENSE.txt LICENSE-OFL-Terminus-Font.txt -t $(DATA_PREFIX)
mkdir -p $(LOCALE_DIR)
ifdef LANGUAGES
LOCALE_DIR=$(LOCALE_DIR) lang/compile_mo.sh $(LANGUAGES)
$(MAKE) -C lang
endif
endif

Expand Down Expand Up @@ -1104,7 +1104,7 @@ endif
cp -R data/title $(APPDATADIR)
cp -R data/help $(APPDATADIR)
ifdef LANGUAGES
lang/compile_mo.sh $(LANGUAGES)
$(MAKE) -C lang
mkdir -p $(APPRESOURCESDIR)/lang/mo/
cp -pR lang/mo/* $(APPRESOURCESDIR)/lang/mo/
endif
Expand Down
1 change: 1 addition & 0 deletions build-scripts/libbacktrace-x86_64-w64-mingw32-sha256
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f658456bb32db1d4fe694eee02459f63b7044ab71009730c3828374a35a8f750 *libbacktrace-x86_64-w64-mingw32.tar.gz
46 changes: 21 additions & 25 deletions build-scripts/requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,31 +54,27 @@ fi

# Influenced by https://github.com/zer0main/battleship/blob/master/build/windows/requirements.sh
if [ -n "${MXE_TARGET}" ]; then
$travis_retry sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 84C7C89FC632241A6999ED0A580873F586B72ED9
sudo add-apt-repository 'deb [arch=amd64] https://mirror.mxe.cc/repos/apt xenial main'
sudo dpkg --add-architecture i386
# We need to treat apt-get update warnings as errors for which the exit code
# is not sufficient. The following workaround inspired by
# https://unix.stackexchange.com/questions/175146/apt-get-update-exit-status/
exec {fd}>&2
$travis_retry bash -o pipefail -c \
"sudo apt-get update 2>&1 | tee /dev/fd/$fd | ( ! grep -q -e '^Err:' -e '^[WE]:' )"
exec {fd}>&-

MXE2_TARGET=$(echo "$MXE_TARGET" | sed 's/_/-/g')
export MXE_DIR=/usr/lib/mxe/usr/bin
$travis_retry sudo apt-get --yes install \
mxe-${MXE2_TARGET}-gcc \
mxe-${MXE2_TARGET}-gettext \
mxe-${MXE2_TARGET}-glib \
mxe-${MXE2_TARGET}-sdl2 \
mxe-${MXE2_TARGET}-sdl2-ttf \
mxe-${MXE2_TARGET}-sdl2-image \
mxe-${MXE2_TARGET}-sdl2-mixer \
wine \
wine32
export PLATFORM='i686-w64-mingw32.static'
export CROSS_COMPILATION="${MXE_DIR}/${PLATFORM}-"
sudo apt update
$travis_retry sudo apt-get --yes install wine wine32

set +e
retry=0
until [[ "$retry" -ge 5 ]]; do
curl -L -o mxe-i686.tar.xz https://github.com/BrettDong/MXE-GCC/releases/download/mxe-gcc-11.2/mxe-i686.tar.xz && curl -L -o mxe-i686.tar.xz.sha256 https://github.com/BrettDong/MXE-GCC/releases/download/mxe-gcc-11.2/mxe-i686.tar.xz.sha256 && shasum -a 256 -c ./mxe-i686.tar.xz.sha256 && break
retry=$((retry+1))
rm -f mxe-i686.tar.xz mxe-i686.tar.xz.sha256
sleep 10
done
if [[ "$retry" -ge 5 ]]; then
echo "Error downloading or checksum failed for MXE i686"
exit 1
fi
set -e
sudo tar xJf mxe-i686.tar.xz -C /opt

export MXE_DIR=/opt/mxe
export CROSS_COMPILATION="${MXE_DIR}/usr/bin/${MXE_TARGET}-"
# Need to overwrite CXX to make the Makefile $CROSS logic work right.
export CXX="$COMPILER"
export CCACHE=1
Expand All @@ -96,7 +92,7 @@ if [ -n "${MXE_TARGET}" ]; then
exit 1
fi
set -e
sudo tar -xzf libbacktrace-i686-w64-mingw32.tar.gz --exclude=LICENSE -C ${MXE_DIR}/../${PLATFORM}
sudo tar -xzf libbacktrace-i686-w64-mingw32.tar.gz --exclude=LICENSE -C ${MXE_DIR}/usr/${MXE_TARGET}
fi

if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
Expand Down
16 changes: 16 additions & 0 deletions build-scripts/windist.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
if (Test-path bindist) {
rm -Force -Recurse bindist
}

mkdir bindist
cp cataclysm-tiles.exe bindist/cataclysm-tiles.exe
cp tools/format/json_formatter.exe bindist/json_formatter.exe

mkdir bindist/lang
cp -r lang/mo bindist/lang

$extras = "data", "doc", "gfx", "LICENSE.txt", "LICENSE-OFL-Terminus-Font.txt", "README.md", "VERSION.txt"
ForEach ($extra in $extras) {
cp -r $extra bindist
}
Compress-Archive -Force -Path bindist/* -DestinationPath "cataclysmdda-0.F.zip"
Binary file added data/font/VecTerminus12Medium.otf
Binary file not shown.
Binary file removed data/font/terminus.fon
Binary file not shown.
Loading

0 comments on commit 1a86527

Please sign in to comment.