%global sdk_version 5.1.2 Name: aws-gamelift-server-sdk Version: %{sdk_version} Release: 11%{?dist} Summary: Amazon GameLift Server SDK for C++ License: Apache-2.0 URL: https://github.com/amazon-gamelift/amazon-gamelift-servers-cpp-server-sdk # O3DE uses version 5.1.2 which is distributed as a zip from AWS S3. # The GitHub repo (amazon-gamelift/amazon-gamelift-servers-cpp-server-sdk) # only has tags starting at v5.0.4, v5.1.3, v5.2.0, etc. -- no v5.1.2 tag. # Download the source zip from the official AWS S3 distribution: Source0: https://gamelift-server-sdk-release.s3.us-west-2.amazonaws.com/cpp/GameLift-Cpp-ServerSDK-%{version}.zip # Bundled dependencies -- fetched at build time via ExternalProject_Add in the # upstream cmake build. Copr mock chroots have no network access, so we # pre-download them and point the build at local copies. Source1: https://github.com/Tencent/rapidjson/archive/refs/tags/v1.1.0.tar.gz#/rapidjson-1.1.0.tar.gz Source2: https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-20-0.tar.gz#/asio-1-20-0.tar.gz Source3: https://github.com/zaphoyd/websocketpp/archive/refs/tags/0.8.2.tar.gz#/websocketpp-0.8.2.tar.gz # The SDK bundles header-only third-party libraries: RapidJSON, # Asio (standalone), and WebSocket++. These are compiled into # the SDK library and not installed separately. Provides: bundled(rapidjson) = 1.1.0 Provides: bundled(asio) = 1.20.0 Provides: bundled(websocketpp) = 0.8.2 BuildRequires: cmake >= 3.1 BuildRequires: gcc-c++ BuildRequires: git BuildRequires: openssl-devel BuildRequires: unzip %description The Amazon GameLift Server SDK for C++ lets game servers communicate with the Amazon GameLift service. Game servers use the SDK to notify GameLift about game session status, retrieve game session information, accept incoming player connections, and report health status. This package provides the shared library for runtime use. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} Requires: openssl-devel %description devel Header files and CMake configuration for developing applications that use the Amazon GameLift Server SDK for C++. %prep # The zip has no top-level directory, so -c creates one for us %setup -q -c -n GameLift-Cpp-ServerSDK-%{version} # Extract bundled dependencies into the source tree tar xzf %{SOURCE1} tar xzf %{SOURCE2} tar xzf %{SOURCE3} # Patch External_rapidjson.cmake: use local SOURCE_DIR instead of GIT_REPOSITORY sed -i \ -e 's|GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git"|SOURCE_DIR "%{_builddir}/GameLift-Cpp-ServerSDK-%{version}/rapidjson-1.1.0"|' \ -e '/GIT_TAG v1.1.0/d' \ cmake/External_rapidjson.cmake # rapidjson 1.1.0 has cmake_minimum_required < 3.5 which CMake 4.x rejects. # ExternalProject spawns its own cmake process, so the top-level # CMAKE_POLICY_VERSION_MINIMUM doesn't propagate. Patch rapidjson's # CMakeLists.txt directly. # Use case-insensitive match since rapidjson uses uppercase CMAKE_MINIMUM_REQUIRED # Fix cmake_minimum_required < 3.5 in all bundled deps (rapidjson, websocketpp) # ExternalProject spawns its own cmake so top-level CMAKE_POLICY_VERSION_MINIMUM # doesn't propagate. Patch all CMakeLists.txt in the source tree. find . -name CMakeLists.txt -exec sed -i 's/cmake_minimum_required\s*(\s*VERSION\s*[0-2]\.[0-9.]*)/cmake_minimum_required(VERSION 3.5)/Ii' {} + find . -name CMakeLists.txt -exec sed -i 's/cmake_minimum_required\s*(\s*VERSION\s*3\.[0-4]\b[0-9.]*)/cmake_minimum_required(VERSION 3.5)/Ii' {} + # Strip -Werror from all cmake files. The SDK and bundled deps use -Werror which # breaks with newer GCC (nodiscard on std::async, deprecated OpenSSL APIs, etc.) # ExternalProject spawns its own cmake so CXXFLAGS from the spec don't propagate. find . -name CMakeLists.txt -o -name '*.cmake' | xargs sed -i 's/-Werror//g' # Fix rapidjson 1.1.0 GCC 15+ -Wtemplate-body error: operator= assigns to const # member 'length' which is ill-formed (was always broken, now caught by GCC 15). # Remove the length assignment since this operator= was never actually callable. sed -i 's/GenericStringRef& operator=(const GenericStringRef\& rhs) { s = rhs.s; length = rhs.length; }/GenericStringRef\& operator=(const GenericStringRef\& rhs) { s = rhs.s; return *this; }/' \ rapidjson-1.1.0/include/rapidjson/document.h # Add -Wno-template-body to all cmake CXX flags to suppress remaining # GCC 15 template body diagnostics in bundled headers. # Must patch the gamelift-server-sdk CMakeLists.txt since ExternalProject # doesn't inherit parent CMAKE_CXX_FLAGS. find . -name CMakeLists.txt -exec sed -i '/CMAKE_CXX_STANDARD\|project(/a\ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-template-body -Wno-unused-result -Wno-delete-non-virtual-dtor")' {} + # Patch External_websocketpp.cmake: use local SOURCE_DIR for both asio and websocketpp sed -i \ -e 's|GIT_REPOSITORY https://github.com/chriskohlhoff/asio.git|SOURCE_DIR "%{_builddir}/GameLift-Cpp-ServerSDK-%{version}/asio-asio-1-20-0"|' \ -e '/GIT_TAG asio-1-20-0/d' \ -e 's|GIT_REPOSITORY https://github.com/zaphoyd/websocketpp.git|SOURCE_DIR "%{_builddir}/GameLift-Cpp-ServerSDK-%{version}/websocketpp-0.8.2"|' \ -e '/GIT_TAG 0.8.2/d' \ cmake/External_websocketpp.cmake # The asio PATCH_COMMAND copies from the ExternalProject source dir using the # path pattern /src/asio/asio/include. With SOURCE_DIR, ExternalProject # still copies/symlinks the source into that location, but the asio tarball # directory layout is: asio-asio-1-20-0/asio/include/... # We need to fix the PATCH_COMMAND path to match SOURCE_DIR usage. # With SOURCE_DIR, ExternalProject_Add still populates /src/asio from # SOURCE_DIR, so the existing path should work. But let us verify and set it # explicitly to be safe: sed -i \ 's|${CMAKE_CURRENT_BINARY_DIR}/asio/src/asio/asio/include|%{_builddir}/GameLift-Cpp-ServerSDK-%{version}/asio-asio-1-20-0/asio/include|' \ cmake/External_websocketpp.cmake %build %cmake \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=ON \ -DGAMELIFT_USE_STD=ON \ -DBUILD_FOR_UNREAL=OFF \ -DRUN_UNIT_TESTS=OFF \ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 %cmake_build %install # The SDK is built via ExternalProject_Add which installs into its own prefix # directory, not the system BUILDROOT. Manually install from the prefix. install -d %{buildroot}%{_libdir} install -d %{buildroot}%{_includedir} # Install shared library with soversion install -p -m 0755 %{__cmake_builddir}/prefix/lib/libaws-cpp-sdk-gamelift-server.so \ %{buildroot}%{_libdir}/libaws-cpp-sdk-gamelift-server.so.%{sdk_version} ln -s libaws-cpp-sdk-gamelift-server.so.%{sdk_version} \ %{buildroot}%{_libdir}/libaws-cpp-sdk-gamelift-server.so.5 ln -s libaws-cpp-sdk-gamelift-server.so.5 \ %{buildroot}%{_libdir}/libaws-cpp-sdk-gamelift-server.so # Install headers cp -a %{__cmake_builddir}/prefix/include/aws %{buildroot}%{_includedir}/ # Install cmake config if present if [ -d %{__cmake_builddir}/prefix/lib/cmake ]; then cp -a %{__cmake_builddir}/prefix/lib/cmake %{buildroot}%{_libdir}/ fi %files %license LICENSE_AMAZON_GAMELIFT_SDK.TXT %doc NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT README.md %{_libdir}/libaws-cpp-sdk-gamelift-server.so.5 %{_libdir}/libaws-cpp-sdk-gamelift-server.so.5.* %files devel %{_includedir}/aws/ %{_libdir}/libaws-cpp-sdk-gamelift-server.so %{_libdir}/cmake/ %changelog * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-11 - Manually install .so and headers from ExternalProject prefix directory (cmake_install target doesn't propagate ExternalProject outputs to BUILDROOT) * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-10 - Fix rapidjson 1.1.0 GCC 15 -Wtemplate-body error (const member assignment) - Add -Wno-template-body -Wno-unused-result -Wno-delete-non-virtual-dtor to cmake CXX flags in all CMakeLists.txt (ExternalProject doesn't inherit parent flags) * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-9 - Strip -Werror from all cmake files (ExternalProject doesn't inherit CXXFLAGS) to fix nodiscard std::async and deprecated OpenSSL API warnings * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-7 - Fix cmake_minimum_required < 3.5 in ALL bundled deps (websocketpp, rapidjson) using blanket find/sed across entire source tree * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-6 - Fix case-insensitive cmake_minimum_required match for rapidjson * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-5 - Fix rapidjson cmake_minimum_required: replace version number instead of prepending cmake_policy (cmake_policy doesn't suppress cmake_minimum_required) * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-4 - Fix rapidjson cmake_minimum_required < 3.5 error with CMake 4.x - Patch rapidjson CMakeLists.txt directly (ExternalProject spawns own cmake) * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-3 - Bundle rapidjson, asio, and websocketpp sources to build without network - Patch cmake ExternalProject to use local sources for Copr/mock builds * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-2 - Add CMAKE_POLICY_VERSION_MINIMUM=3.5 for newer cmake compatibility * Wed Feb 11 2026 O3DE Package Maintainer - 5.1.2-1 - Initial RPM package of Amazon GameLift Server SDK for C++ - Version 5.1.2 for O3DE compatibility - Bundles header-only dependencies (RapidJSON, WebSocket++, Asio)