From aae97d9b7d0a31fb622e9c3e96170a88dd515408 Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Tue, 23 Apr 2024 19:23:43 +0200 Subject: [PATCH] Fix build issues and set 3.1.1 --- .github/workflows/macos_build.yml | 9 ++++----- .github/workflows/windows_msys_build.yml | 4 ++-- CMakeLists.txt | 2 +- Source/Game/CMakeLists.txt | 1 + Source/Network/P2P_interface.h | 2 +- Source/Network/P2P_interface1Th.cpp | 3 +-- Source/perimeter.rc | 4 ++-- Source/version.cpp | 8 ++++++++ docker/dockcross/dockcross-cmake.sh | 3 --- docker/dockcross/dockcross-x64.Dockerfile | 4 +--- docker/linux/prepare_ffmpeg | 5 ++--- docker/linux/prepare_pkgs | 2 +- flake.nix | 5 ++--- macos/Perimeter.app.template/Contents/Info.plist | 2 +- perimeter.nix | 2 +- vcpkg.json | 4 ++-- 16 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 Source/version.cpp diff --git a/.github/workflows/macos_build.yml b/.github/workflows/macos_build.yml index 0fdd7b52..2a846815 100644 --- a/.github/workflows/macos_build.yml +++ b/.github/workflows/macos_build.yml @@ -13,7 +13,7 @@ env: VULKAN_SDK_VERSION: '1.3.250.1' VULKAN_LIB_VERSION: '1.3.250' MACOSX_DEPLOYMENT_TARGET: '10.15' - GH_CACHE_KEY: 9 + GH_CACHE_KEY: 10 jobs: build: @@ -32,7 +32,7 @@ jobs: - name: install libs run: | brew install ninja yasm dylibbundler \ - libogg libvorbis libvpx boost meson cmake zlib \ + libopus libvpx boost meson cmake zlib \ sdl2 sdl2_image sdl2_mixer sdl2_net - uses: actions/cache@v4 id: cache @@ -56,7 +56,7 @@ jobs: hdiutil detach /Volumes/VulkanSDK - name: ffmpeg -- download if: steps.cache.outputs.cache-hit != 'true' - run: git clone --depth 1 --branch n5.1 https://git.ffmpeg.org/ffmpeg.git ffmpeg + run: git clone --depth 1 --branch n6.1 https://git.ffmpeg.org/ffmpeg.git ffmpeg - name: ffmpeg -- configure if: steps.cache.outputs.cache-hit != 'true' run: ./configure @@ -73,9 +73,8 @@ jobs: --enable-swresample --enable-zlib --enable-libvpx - --enable-libvorbis --enable-demuxer=rawvideo,bink,matroska - --enable-decoder=rawvideo,bink,binkaudio_dct,vorbis,opus,vp8,vp9 + --enable-decoder=rawvideo,bink,binkaudio_dct,opus,vp8,vp9 --enable-parser=vp9 --enable-filter=aresample,aformat --enable-protocol=file diff --git a/.github/workflows/windows_msys_build.yml b/.github/workflows/windows_msys_build.yml index 5d84ee81..b3c55b64 100644 --- a/.github/workflows/windows_msys_build.yml +++ b/.github/workflows/windows_msys_build.yml @@ -53,6 +53,7 @@ jobs: boost:p lld:p libbacktrace:p + libopus:p libvpx:p nasm:p yasm:p @@ -86,9 +87,8 @@ jobs: --enable-swresample \ --enable-zlib \ --enable-libvpx \ - --enable-libvorbis \ --enable-demuxer=rawvideo,bink,matroska \ - --enable-decoder=rawvideo,bink,binkaudio_dct,vorbis,opus,vp8,vp9 \ + --enable-decoder=rawvideo,bink,binkaudio_dct,opus,vp8,vp9 \ --enable-parser=vp9 \ --enable-filter=aresample,aformat \ --enable-protocol=file \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b854464..f306663e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.16.0) # root -PROJECT(perimeter VERSION 3.1.0) +PROJECT(perimeter VERSION 3.1.1) message("Version ${PROJECT_VERSION}") SET(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo") diff --git a/Source/Game/CMakeLists.txt b/Source/Game/CMakeLists.txt index b7741c98..00b261cb 100644 --- a/Source/Game/CMakeLists.txt +++ b/Source/Game/CMakeLists.txt @@ -2,6 +2,7 @@ OPTION(OPTION_PROCESS_SCRIPTS "Re-Process game scripts with XPrm" OFF) target_sources(perimeter PRIVATE + "${PROJECT_SOURCE_DIR}/Source/version.cpp" CameraManager.cpp MonkManager.cpp MusicManager.cpp diff --git a/Source/Network/P2P_interface.h b/Source/Network/P2P_interface.h index 59e445a9..4cba6427 100644 --- a/Source/Network/P2P_interface.h +++ b/Source/Network/P2P_interface.h @@ -525,7 +525,7 @@ class PNetCenter { NETID m_hostNETID; NETID m_localNETID; - bool flag_connected; + bool flag_connected = false; void Reset(); diff --git a/Source/Network/P2P_interface1Th.cpp b/Source/Network/P2P_interface1Th.cpp index 2789a0f5..5f4660d6 100644 --- a/Source/Network/P2P_interface1Th.cpp +++ b/Source/Network/P2P_interface1Th.cpp @@ -78,8 +78,7 @@ const char* PNetCenter::getStrState() const PNetCenter::PNetCenter() : in_ClientBuf(PNETCENTER_BUFFER_SIZE, true), out_ClientBuf(PNETCENTER_BUFFER_SIZE, true), in_HostBuf(PNETCENTER_BUFFER_SIZE, true), out_HostBuf(PNETCENTER_BUFFER_SIZE, true), -connectionHandler(this), -flag_connected(false) +connectionHandler(this) { hostConnection=NetAddress(); diff --git a/Source/perimeter.rc b/Source/perimeter.rc index 0cd76b8c..0d3b2a4c 100644 --- a/Source/perimeter.rc +++ b/Source/perimeter.rc @@ -119,11 +119,11 @@ BEGIN BEGIN VALUE "CompanyName", "K-D LAB" VALUE "FileDescription", "Perimeter" - VALUE "FileVersion", "3.1.0" + VALUE "FileVersion", "3.1.1" VALUE "InternalName", "Perimeter" VALUE "LegalCopyright", "Copyright (C) K-D LAB" VALUE "ProductName", "Perimeter" - VALUE "ProductVersion", "3.1.0" + VALUE "ProductVersion", "3.1.1" END END BLOCK "VarFileInfo" diff --git a/Source/version.cpp b/Source/version.cpp new file mode 100644 index 00000000..7484e06c --- /dev/null +++ b/Source/version.cpp @@ -0,0 +1,8 @@ +#define VERSION "3.1.1" + +//Sanity check to make sure the cmake version matches the code version +#include +static_assert( + std::string_view(PERIMETER_VERSION) == VERSION, + "'" PERIMETER_VERSION "' mismatches the expected version '" VERSION "'" +); diff --git a/docker/dockcross/dockcross-cmake.sh b/docker/dockcross/dockcross-cmake.sh index 7e72fa4c..59708532 100755 --- a/docker/dockcross/dockcross-cmake.sh +++ b/docker/dockcross/dockcross-cmake.sh @@ -67,9 +67,6 @@ cp ${SDL_DIR}/bin/SDL2.dll output cp ${SDL_DIR}/bin/SDL2_image.dll output cp ${SDL_DIR}/bin/SDL2_mixer.dll output cp ${SDL_DIR}/bin/SDL2_net.dll output -#cp -fv /usr/lib/mxe/usr/${CROSS_TRIPLE}/bin/libogg*.dll output -#cp -fv /usr/lib/mxe/usr/${CROSS_TRIPLE}/bin/libvorbis*.dll output -#cp -fv /usr/lib/mxe/usr/${CROSS_TRIPLE}/bin/libvorbisfile*.dll output #cp -fv /usr/lib/mxe/usr/${CROSS_TRIPLE}/bin/zlib*.dll output #cp -fv /usr/lib/mxe/usr/${CROSS_TRIPLE}/bin/libstdc*.dll output #cp -fv /usr/lib/mxe/usr/${CROSS_TRIPLE}/bin/libgcc*.dll output diff --git a/docker/dockcross/dockcross-x64.Dockerfile b/docker/dockcross/dockcross-x64.Dockerfile index 29d57b37..55ceb410 100644 --- a/docker/dockcross/dockcross-x64.Dockerfile +++ b/docker/dockcross/dockcross-x64.Dockerfile @@ -1,6 +1,4 @@ -FROM dockcross/windows-shared-x64:latest - -RUN echo "v2" +FROM dockcross/windows-shared-x64:20231208-4e4d3ad ENV DEFAULT_DOCKCROSS_IMAGE dockcross-x64-perimeter diff --git a/docker/linux/prepare_ffmpeg b/docker/linux/prepare_ffmpeg index b601f7f5..5c2ccf76 100644 --- a/docker/linux/prepare_ffmpeg +++ b/docker/linux/prepare_ffmpeg @@ -2,7 +2,7 @@ set -e # Compile smaller version of FFMPEG with only what project needs -git clone --depth 1 --branch n5.1 https://git.ffmpeg.org/ffmpeg.git /opt/src/ffmpeg +git clone --depth 1 --branch n6.1 https://git.ffmpeg.org/ffmpeg.git /opt/src/ffmpeg cd /opt/src/ffmpeg @@ -14,9 +14,8 @@ cd /opt/src/ffmpeg --enable-swresample \ --enable-zlib \ --enable-libvpx \ - --enable-libvorbis \ --enable-demuxer=rawvideo,bink,matroska \ - --enable-decoder=rawvideo,bink,binkaudio_dct,vorbis,opus,vp8,vp9 \ + --enable-decoder=rawvideo,bink,binkaudio_dct,opus,vp8,vp9 \ --enable-parser=vp9 \ --enable-filter=aresample,aformat \ --enable-protocol=file \ diff --git a/docker/linux/prepare_pkgs b/docker/linux/prepare_pkgs index 094fe679..11f338d3 100644 --- a/docker/linux/prepare_pkgs +++ b/docker/linux/prepare_pkgs @@ -19,7 +19,7 @@ apt-get install -t buster-backports -y \ libsdl2-net-dev \ libsdl2-mixer-dev \ zlib1g-dev \ - libvorbis-dev \ + libopus-dev \ libvulkan-dev glslang-tools \ build-essential \ cmake meson ninja-build diff --git a/flake.nix b/flake.nix index 4a1b13f4..6552fcce 100644 --- a/flake.nix +++ b/flake.nix @@ -154,8 +154,7 @@ ffmpegVariant = "headless"; withHeadlessDeps = false; - withOgg = true; - withVorbis = true; + withOpus = true; withZlib = true; withVpx = !super.stdenv.hostPlatform.isMinGW && !super.stdenv.hostPlatform.isDarwin; @@ -176,7 +175,7 @@ configureFlags = attrs.configureFlags ++ [ "--disable-everything" "--enable-demuxer=rawvideo,bink,matroska" - "--enable-decoder=rawvideo,bink,binkaudio_dct,vorbis,opus,vp9" + "--enable-decoder=rawvideo,bink,binkaudio_dct,opus,vp9" "--enable-parser=vp9" "--enable-filter=aresample,aformat" "--enable-protocol=file" diff --git a/macos/Perimeter.app.template/Contents/Info.plist b/macos/Perimeter.app.template/Contents/Info.plist index 16a757a1..eebdd45e 100644 --- a/macos/Perimeter.app.template/Contents/Info.plist +++ b/macos/Perimeter.app.template/Contents/Info.plist @@ -13,7 +13,7 @@ CFBundleIconFile iconfile CFBundleShortVersionString - 3.1.0 + 3.1.1 CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/perimeter.nix b/perimeter.nix index dee9495d..4814fcea 100644 --- a/perimeter.nix +++ b/perimeter.nix @@ -51,7 +51,7 @@ }; in pkgs.stdenv.mkDerivation { pname = "perimeter"; - version = "3.1.0"; + version = "3.1.1"; meta = with lib; { homepage = "https://github.com/KD-lab-Open-Source/Perimeter/"; description = "Perimeter - A open-source RTS game from 2004 by K-D LAB"; diff --git a/vcpkg.json b/vcpkg.json index 605d9465..ad01ee23 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,10 +1,10 @@ { "name": "perimeter", - "version": "3.1.0", + "version": "3.1.1", "dependencies": [ "zlib", "boost-stacktrace", - "libvorbis", + "libopus", "libvpx", "sdl2", "sdl2-image",