Skip to content

Commit

Permalink
Merge branch 'master' into Silat-Weapons
Browse files Browse the repository at this point in the history
  • Loading branch information
Maleclypse authored Oct 15, 2021
2 parents 3c33a73 + b8ea90a commit e745562
Show file tree
Hide file tree
Showing 549 changed files with 390,675 additions and 235,992 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
9 changes: 7 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,10 +96,15 @@ 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
- name: Enable GitHub Actions problem matchers
run: |
Write-Output "::add-matcher::build-scripts/problem-matchers/catch2.json"
Write-Output "::add-matcher::build-scripts/problem-matchers/debugmsg.json"
- name: Run tests
run: |
.\Cataclysm-test-vcpkg-static-Release-x64.exe --min-duration 0.2 --rng-seed time
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
1 change: 1 addition & 0 deletions .github/workflows/pull-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
pull-translations:
if: github.repository == 'CleverRaven/Cataclysm-DDA'
runs-on: ubuntu-20.04
steps:
- name: "Install dependencies"
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
45 changes: 45 additions & 0 deletions .github/workflows/text-changes-analyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Text Changes Analyzer


on:
pull_request:
branches:
- master
paths:
- '.github/workflows/text-changes-analyzer.yml'
- 'tools/pot_diff.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 base commit"
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: "Generate translation template of base commit"
run: |
rm -f lang/po/cataclysm-dda.pot
./lang/update_pot.sh
cp lang/po/cataclysm-dda.pot ~/base.pot
- name: "Checkout head commit"
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: "Generate translation template of head commit"
run: |
rm -f lang/po/cataclysm-dda.pot
./lang/update_pot.sh
cp lang/po/cataclysm-dda.pot ~/head.pot
- name: "List text changes"
run: |
python3 ./tools/pot_diff.py ~/base.pot ~/head.pot
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ endif ()
set(CMAKE_THREAD_PREFER_PTHREAD True)
find_package(Threads REQUIRED)

FIND_PACKAGE(ZLIB REQUIRED)

# Check for build types and libraries
if (TILES)
# Find SDL, SDL_ttf & SDL_image for graphical install
Expand Down
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: 2 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ GNU Unifont (data/font/unifont.ttf) is licensed under GNU General Public License

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.

PLF List and PLF Colony (src/list.h, src/colony.h) are licensed under the zLib license (https://www.zlib.net/zlib_license.html).
Expand Down
30 changes: 26 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ ifneq (,$(findstring clang,$(COMPILER)))
CLANG = $(COMPILER)
endif

# Windows sets the OS environment variable so we can cheaply test for it.
ifneq (,$(findstring Windows_NT,$(OS)))
IS_WINDOWS_HOST = 1
else
IS_WINDOWS_HOST = 0
endif

OS = $(shell uname -s)

ifneq ($(findstring Darwin,$(OS)),)
Expand Down Expand Up @@ -897,6 +904,8 @@ ifeq ($(LTO), 1)
endif
endif

LDFLAGS += -lz

all: version $(CHECKS) $(TARGET) $(L10N) $(TESTS)
@

Expand Down Expand Up @@ -950,7 +959,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 @@ -1013,7 +1022,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 @@ -1049,7 +1058,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 @@ -1097,7 +1106,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 Expand Up @@ -1164,11 +1173,24 @@ etags: $(ASTYLE_SOURCES)
etags $^
./tools/json_tools/cddatags.py

ifneq ($(IS_WINDOWS_HOST),1)
# Parallel astyle for posix hosts where fork and filesystem are cheap.

ASTYLE_CHECK_STAMPS = $(sort $(patsubst %,$(ODIR)/%.astyle-check-stamp,$(ASTYLE_SOURCES)))
astyle: $(ASTYLE_CHECK_STAMPS)
$(ASTYLE_CHECK_STAMPS): $(ODIR)/%.astyle-check-stamp : %
$(ASTYLE_BINARY) --options=.astylerc -n $< && mkdir -p $(@D) && touch $@

else
# Serial astyle for Windows hosts which processes all files in one invocation.

astyle: $(ODIR)/.astyle-check-stamp
$(ODIR)/.astyle-check-stamp: $(ASTYLE_SOURCES)
$(ASTYLE_BINARY) --options=.astylerc -n $?
mkdir -p $(@D) && touch $@

endif

astyle-all: $(ASTYLE_SOURCES)
$(ASTYLE_BINARY) --options=.astylerc -n $(ASTYLE_SOURCES)
mkdir -p $(ODIR) && touch $(ODIR)/.astyle-check-stamp
Expand Down
2 changes: 1 addition & 1 deletion android/app/jni/src/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LOCAL_SRC_FILES := $(sort $(FILE_LIST:$(LOCAL_PATH)/%=%))

LOCAL_SHARED_LIBRARIES := libhidapi SDL2 SDL2_mixer SDL2_image SDL2_ttf mpg123

LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog
LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -llog -lz

LOCAL_CFLAGS += -DTILES=1 -DSDL_SOUND=1 -DBACKTRACE=1 -DLOCALIZE=1 -Wextra -Wall -fsigned-char

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
Loading

0 comments on commit e745562

Please sign in to comment.