2
0
Эх сурвалжийг харах

Merge pull request #196 from aws-lumberyard-dev/cgalvan/UpgradeAWSGameLiftServerSDK

Updated AWSGameLiftServerSDK to new version 5.0.0
Chris Galvan 2 жил өмнө
parent
commit
0dcef3f3da

+ 2 - 0
package-system/.gitignore

@@ -1,6 +1,8 @@
 assimp-*
 assimp-*
 astc-encoder-*
 astc-encoder-*
+AWSGameLiftServerSDK-*
 AwsIotDeviceSdkCpp-*
 AwsIotDeviceSdkCpp-*
+AWSNativeSDK-*
 azslc-*
 azslc-*
 Blast-*
 Blast-*
 Crashpad-*
 Crashpad-*

+ 0 - 81
package-system/AWSGameLiftServerSDK/AWSGameLiftServerSDK-3.4.2-linux-aarch64.patch

@@ -1,81 +0,0 @@
-diff --git a/cmake/External_boost.cmake b/cmake/External_boost.cmake
-index 6fc990b..17f99d7 100644
---- a/cmake/External_boost.cmake
-+++ b/cmake/External_boost.cmake
-@@ -66,8 +66,14 @@ if(use_bat)
-     BUILD_COMMAND b2 address-model=${am} ${boost_with_args}
-   )
- else()
-+  if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-+    set(_build_variant "debug")
-+  else()
-+    set(_build_variant  "release")
-+  endif()
-+
-   list(APPEND boost_with_args
--    "cxxflags=-fPIC")
-+    "cflags=-fPIC" "cxxflags=-fPIC" "toolset=clang-12.0" "variant=${_build_variant}")
-   set(boost_cmds
-     CONFIGURE_COMMAND ./bootstrap.sh --prefix=<INSTALL_DIR>
-     BUILD_COMMAND ./b2 address-model=${am} ${boost_with_args}
-diff --git a/cmake/External_sioclient.cmake b/cmake/External_sioclient.cmake
-index 3333da3..6233d98 100644
---- a/cmake/External_sioclient.cmake
-+++ b/cmake/External_sioclient.cmake
-@@ -4,23 +4,41 @@ add_optional_deps(_deps "boost")
- get_filename_component(_self_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
- 
- if(UNIX)
--    ExternalProject_Add(sioclient
--      GIT_REPOSITORY https://github.com/socketio/socket.io-client-cpp.git
--      GIT_TAG 1.6.1
--      GIT_SUBMODULES
-+    ExternalProject_Add(sioclient-src
-+        GIT_REPOSITORY https://github.com/socketio/socket.io-client-cpp.git
-+        GIT_TAG 1.6.1
-+        GIT_SUBMODULES
-         lib/websocketpp
-         lib/rapidjson
--      SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
--      INSTALL_DIR "${GameLiftServerSdk_INSTALL_PREFIX}"
--      PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
--        "${_self_dir}/sioclient.CMakeLists.txt"
--        "<SOURCE_DIR>/CMakeLists.txt"
--      CMAKE_CACHE_ARGS
--        ${GameLiftServerSdk_DEFAULT_ARGS}
--        ${GameLiftServerSdk_THIRDPARTYLIBS_ARGS}
--        "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
--      DEPENDS
--        ${_deps}
-+        SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
-+        UPDATE_COMMAND ""
-+        PATCH_COMMAND ""
-+        INSTALL_COMMAND ""
-+        CONFIGURE_COMMAND ""
-+        BUILD_COMMAND ""
-+    )
-+
-+    ExternalProject_Add(sioclient
-+        DEPENDS sioclient-src
-+        DOWNLOAD_COMMAND ""
-+        SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
-+        INSTALL_DIR "${GameLiftServerSdk_INSTALL_PREFIX}"
-+        PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
-+            "${_self_dir}/sioclient.CMakeLists.txt"
-+            "<SOURCE_DIR>/CMakeLists.txt"
-+        CMAKE_CACHE_ARGS
-+            ${GameLiftServerSdk_DEFAULT_ARGS}
-+            ${GameLiftServerSdk_THIRDPARTYLIBS_ARGS}
-+            "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
-+        DEPENDS
-+            ${_deps}
-+    )
-+
-+    add_custom_command(
-+        TARGET sioclient-src POST_BUILD
-+        COMMAND git fetch origin
-+        COMMAND git merge 56123c87598f8b1dd471be83ca841ceae07f95ba # keep build dependency consistent
-+        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sioclient/lib/websocketpp"
-     )
- elseif(WIN32)
-     ExternalProject_Add(sioclient-src

+ 0 - 81
package-system/AWSGameLiftServerSDK/AWSGameLiftServerSDK-3.4.2-linux.patch

@@ -1,81 +0,0 @@
-diff --git a/cmake/External_boost.cmake b/cmake/External_boost.cmake
-index 6fc990b..17f99d7 100644
---- a/cmake/External_boost.cmake
-+++ b/cmake/External_boost.cmake
-@@ -66,8 +66,14 @@ if(use_bat)
-     BUILD_COMMAND b2 address-model=${am} ${boost_with_args}
-   )
- else()
-+  if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-+    set(_build_variant "debug")
-+  else()
-+    set(_build_variant  "release")
-+  endif()
-+
-   list(APPEND boost_with_args
--    "cxxflags=-fPIC")
-+    "cflags=-fPIC" "cxxflags=-fPIC" "toolset=clang-12.0" "variant=${_build_variant}")
-   set(boost_cmds
-     CONFIGURE_COMMAND ./bootstrap.sh --prefix=<INSTALL_DIR>
-     BUILD_COMMAND ./b2 address-model=${am} ${boost_with_args}
-diff --git a/cmake/External_sioclient.cmake b/cmake/External_sioclient.cmake
-index 3333da3..6233d98 100644
---- a/cmake/External_sioclient.cmake
-+++ b/cmake/External_sioclient.cmake
-@@ -4,23 +4,41 @@ add_optional_deps(_deps "boost")
- get_filename_component(_self_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
- 
- if(UNIX)
--    ExternalProject_Add(sioclient
--      GIT_REPOSITORY https://github.com/socketio/socket.io-client-cpp.git
--      GIT_TAG 1.6.1
--      GIT_SUBMODULES
-+    ExternalProject_Add(sioclient-src
-+        GIT_REPOSITORY https://github.com/socketio/socket.io-client-cpp.git
-+        GIT_TAG 1.6.1
-+        GIT_SUBMODULES
-         lib/websocketpp
-         lib/rapidjson
--      SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
--      INSTALL_DIR "${GameLiftServerSdk_INSTALL_PREFIX}"
--      PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
--        "${_self_dir}/sioclient.CMakeLists.txt"
--        "<SOURCE_DIR>/CMakeLists.txt"
--      CMAKE_CACHE_ARGS
--        ${GameLiftServerSdk_DEFAULT_ARGS}
--        ${GameLiftServerSdk_THIRDPARTYLIBS_ARGS}
--        "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
--      DEPENDS
--        ${_deps}
-+        SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
-+        UPDATE_COMMAND ""
-+        PATCH_COMMAND ""
-+        INSTALL_COMMAND ""
-+        CONFIGURE_COMMAND ""
-+        BUILD_COMMAND ""
-+    )
-+
-+    ExternalProject_Add(sioclient
-+        DEPENDS sioclient-src
-+        DOWNLOAD_COMMAND ""
-+        SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/sioclient"
-+        INSTALL_DIR "${GameLiftServerSdk_INSTALL_PREFIX}"
-+        PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
-+            "${_self_dir}/sioclient.CMakeLists.txt"
-+            "<SOURCE_DIR>/CMakeLists.txt"
-+        CMAKE_CACHE_ARGS
-+            ${GameLiftServerSdk_DEFAULT_ARGS}
-+            ${GameLiftServerSdk_THIRDPARTYLIBS_ARGS}
-+            "-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=true"
-+        DEPENDS
-+            ${_deps}
-+    )
-+
-+    add_custom_command(
-+        TARGET sioclient-src POST_BUILD
-+        COMMAND git fetch origin
-+        COMMAND git merge 56123c87598f8b1dd471be83ca841ceae07f95ba # keep build dependency consistent
-+        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sioclient/lib/websocketpp"
-     )
- elseif(WIN32)
-     ExternalProject_Add(sioclient-src

+ 0 - 35
package-system/AWSGameLiftServerSDK/AWSGameLiftServerSDK-3.4.2-windows.patch

@@ -1,35 +0,0 @@
-diff --git a/cmake/External_boost.cmake b/cmake/External_boost.cmake
-index 6fc990b..81139b6 100644
---- a/cmake/External_boost.cmake
-+++ b/cmake/External_boost.cmake
-@@ -50,6 +50,8 @@ if(use_bat)
-     set(_toolset "msvc-14.0")
-   elseif(MSVC15)
-     set(_toolset "msvc-14.1")
-+  elseif(MSVC16)
-+    set(_toolset "msvc-14.2")
-   endif()
- 
-   if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-diff --git a/cmake/External_sioclient.cmake b/cmake/External_sioclient.cmake
-index 3333da3..f845030 100644
---- a/cmake/External_sioclient.cmake
-+++ b/cmake/External_sioclient.cmake
-@@ -51,11 +51,10 @@ elseif(WIN32)
-        DEPENDS
-          ${_deps}
-      )
--     if(MSVC14)
--        add_custom_command(
--            TARGET sioclient-src POST_BUILD
--            COMMAND git pull origin master
--            WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sioclient/lib/websocketpp"
--        )
--    endif(MSVC14)
-+    add_custom_command(
-+        TARGET sioclient-src POST_BUILD
-+        COMMAND git fetch origin
-+        COMMAND git merge 56123c87598f8b1dd471be83ca841ceae07f95ba # keep build dependency consistent
-+        WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/sioclient/lib/websocketpp"
-+    )
- endif(UNIX)

+ 0 - 10
package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Linux

@@ -23,22 +23,12 @@ if (LY_MONOLITHIC_GAME)
 
 
     set(AWSGAMELIFTSERVERSDK_LIBS
     set(AWSGAMELIFTSERVERSDK_LIBS
         ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.a
         ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.a
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libsioclient.a
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_date_time.a
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_random.a
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_system.a
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libprotobuf.a
     )
     )
 else()
 else()
     set(AWSGAMELIFTSERVERSDK_LIB_PATH ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/bin/$<IF:$<CONFIG:Debug>,Debug,Release>)
     set(AWSGAMELIFTSERVERSDK_LIB_PATH ${CMAKE_CURRENT_LIST_DIR}/${LIB_NAME}/bin/$<IF:$<CONFIG:Debug>,Debug,Release>)
 
 
     set(AWSGAMELIFTSERVERSDK_LIBS
     set(AWSGAMELIFTSERVERSDK_LIBS
         ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.so
         ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libaws-cpp-sdk-gamelift-server.so
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_date_time.so.1.64.0
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_random.so.1.64.0
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_system.so.1.64.0
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libprotobuf.so.13
-        ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libprotobuf.so.13.0.0
     )
     )
 endif()
 endif()
 
 

+ 0 - 5
package-system/AWSGameLiftServerSDK/FindAWSGameLiftServerSDK.cmake.Windows

@@ -29,11 +29,6 @@ else()
 endif()
 endif()
 
 
 set(AWSGAMELIFTSERVERSDK_LIBS
 set(AWSGAMELIFTSERVERSDK_LIBS
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/sioclient.lib
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_date_time.lib
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_random.lib
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libboost_system.lib
-    ${AWSGAMELIFTSERVERSDK_LIB_PATH}/libprotobuf$<$<CONFIG:Debug>:d>.lib
     ${AWSGAMELIFTSERVERSDK_LIB_PATH}/aws-cpp-sdk-gamelift-server.lib
     ${AWSGAMELIFTSERVERSDK_LIB_PATH}/aws-cpp-sdk-gamelift-server.lib
 )
 )
 
 

+ 1 - 1
package-system/AWSGameLiftServerSDK/README.md

@@ -24,7 +24,7 @@ You can find the official GameLift documentation [here](https://aws.amazon.com/d
    ```
    ```
 
 
 ## FAQ
 ## FAQ
-* For windows build, the Amazon GameLift Server SDK depends on an older version of boost, it is recommend to build with `Visual Studio 15 2017`
+* For windows build, it is recommend to build with `Visual Studio 17 2022`
 * For windows build, if you get error message `The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters`
 * For windows build, if you get error message `The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters`
   (Refer to [PathTooLongException](https://docs.microsoft.com/en-us/dotnet/api/system.io.pathtoolongexception?view=net-6.0))
   (Refer to [PathTooLongException](https://docs.microsoft.com/en-us/dotnet/api/system.io.pathtoolongexception?view=net-6.0))
   Please move `3p-package-source` directory to shorter path location and retry.
   Please move `3p-package-source` directory to shorter path location and retry.

+ 61 - 47
package-system/AWSGameLiftServerSDK/build_package_image.py

@@ -15,26 +15,36 @@ import os
 import pathlib
 import pathlib
 import subprocess
 import subprocess
 import shutil
 import shutil
+import sys
 import urllib.request
 import urllib.request
 import zipfile
 import zipfile
 from typing import List
 from typing import List
 
 
+# O3DE_PACKAGE_NAME is given in the format <PACKAGE_NAME>-<VERSION>-<PLATFORM>
+O3DE_PACKAGE_NAME = os.environ['O3DE_PACKAGE_NAME']
+O3DE_PACKAGE_NAME_PARTS = O3DE_PACKAGE_NAME.split('-')
 PACKAGE_NAME: str = "AWSGameLiftServerSDK"
 PACKAGE_NAME: str = "AWSGameLiftServerSDK"
-PACKAGE_VERSION: str = "3.4.2-rev1"
 PACKAGE_PLATFORM: str = ""
 PACKAGE_PLATFORM: str = ""
 PACKAGE_URL: str = "https://aws.amazon.com/documentation/gamelift/"
 PACKAGE_URL: str = "https://aws.amazon.com/documentation/gamelift/"
 PACKAGE_LICENSE: str = "Apache-2.0"
 PACKAGE_LICENSE: str = "Apache-2.0"
 PACKAGE_LICENSE_FILE: str = "LICENSE_AMAZON_GAMELIFT_SDK.TXT"
 PACKAGE_LICENSE_FILE: str = "LICENSE_AMAZON_GAMELIFT_SDK.TXT"
 
 
-GAMELIFT_SERVER_SDK_RELEASE_VERSION: str = "4.0.2"
-GAMELIFT_SERVER_SDK_DOWNLOAD_URL: str = "https://gamelift-release.s3-us-west-2.amazonaws.com/GameLift_06_03_2021.zip"
+GAMELIFT_SERVER_SDK_RELEASE_VERSION: str = O3DE_PACKAGE_NAME_PARTS[1]
+GAMELIFT_SERVER_SDK_DOWNLOAD_URL: str = "https://gamelift-release.s3-us-west-2.amazonaws.com/GameLift-SDK-Release-5.0.0.zip"
 
 
 PACKAGE_BASE_PATH: pathlib.Path = pathlib.Path(os.path.dirname(__file__))
 PACKAGE_BASE_PATH: pathlib.Path = pathlib.Path(os.path.dirname(__file__))
 PACKAGE_ROOT_PATH: pathlib.Path = PACKAGE_BASE_PATH.parent
 PACKAGE_ROOT_PATH: pathlib.Path = PACKAGE_BASE_PATH.parent
+REPO_ROOT_PATH: pathlib.Path = PACKAGE_ROOT_PATH.parent
+GENERAL_SCRIPTS_PATH = REPO_ROOT_PATH / 'Scripts' / 'extras'
 PACKAGE_BUILD_TYPES: List[str] = ["Debug", "Release"]
 PACKAGE_BUILD_TYPES: List[str] = ["Debug", "Release"]
 PACKAGE_LIB_TYPES: List[str] = ["Shared", "Static"]
 PACKAGE_LIB_TYPES: List[str] = ["Shared", "Static"]
 PACKAGE_PLATFORM_OPTIONS: List[str] = ["windows", "linux", "linux-aarch64"]
 PACKAGE_PLATFORM_OPTIONS: List[str] = ["windows", "linux", "linux-aarch64"]
 
 
+# Insert the 3p scripts path so we can use the package downloader to
+# download the openssl dependency
+sys.path.insert(1, str(GENERAL_SCRIPTS_PATH.resolve()))
+from package_downloader import PackageDownloader
+
 # Lookup table for the Find{PACKAGE_NAME}.cmake.{platform} source file to copy in case there are shared files across different platforms
 # Lookup table for the Find{PACKAGE_NAME}.cmake.{platform} source file to copy in case there are shared files across different platforms
 FIND_CMAKE_PLATFORM_SUFFIX_BY_PLATFORM = {
 FIND_CMAKE_PLATFORM_SUFFIX_BY_PLATFORM = {
     'Windows': 'Windows',
     'Windows': 'Windows',
@@ -54,6 +64,25 @@ class WorkingDirectoryInfo(object):
         self.build_path = build_path
         self.build_path = build_path
         self.output_path = output_path
         self.output_path = output_path
         self.libs_output_path = libs_output_path
         self.libs_output_path = libs_output_path
+        self.dependencies_folder_path = (self.root_path / 'dependencies').resolve()
+
+# OpenSSL dependency: (packagename,  hash)
+OPENSSL_PACKAGE = ('OpenSSL-1.1.1o-rev1-windows', '52b9d2bc5f3e0c6e405a0f290d1904bf545acc0c73d6a52351247d917c4a06d2')
+def get_dependencies(working_directory: WorkingDirectoryInfo) -> None:
+    # Only windows has an additional dependency on openssl that we need to download from our own packages
+    # The linux builds also rely on openssl, but they use the version on the system
+    if PACKAGE_PLATFORM != 'windows':
+        return
+
+    print("Downloading dependencies...")
+
+    package_name = OPENSSL_PACKAGE[0]
+    package_hash = OPENSSL_PACKAGE[1]
+    if not (working_directory.dependencies_folder_path / package_name).exists():
+        if not PackageDownloader.DownloadAndUnpackPackage(package_name, package_hash, str(working_directory.dependencies_folder_path)):
+            raise Exception("Failed to download OpenSSL dependency!")
+    else:
+        print(f'OpenSSL already in dependencies folder, skipping. Use --clean to refresh')
 
 
 def subp_args(args) -> str:
 def subp_args(args) -> str:
     arg_string = " ".join([arg for arg in args])
     arg_string = " ".join([arg for arg in args])
@@ -89,7 +118,7 @@ def prepare_working_directory() -> WorkingDirectoryInfo:
     
     
     # source and build directory
     # source and build directory
     source_directory: pathlib.Path = \
     source_directory: pathlib.Path = \
-        root_directory.joinpath(f"GameLift-SDK-Release-{GAMELIFT_SERVER_SDK_RELEASE_VERSION}/GameLift-Cpp-ServerSDK-{PACKAGE_VERSION.split('-')[0]}")
+        root_directory.joinpath(f"GameLift-SDK-Release-{GAMELIFT_SERVER_SDK_RELEASE_VERSION}/GameLift-Cpp-ServerSDK-{GAMELIFT_SERVER_SDK_RELEASE_VERSION}")
     build_directory: pathlib.Path = root_directory.joinpath("build")
     build_directory: pathlib.Path = root_directory.joinpath("build")
     build_directory.mkdir(parents=True)
     build_directory.mkdir(parents=True)
     
     
@@ -112,36 +141,12 @@ def download_gamelift_server_sdk(working_directory: WorkingDirectoryInfo) -> Non
     
     
     # unzip sdk contents
     # unzip sdk contents
     with zipfile.ZipFile(gamelift_sdk_zip_file, "r") as f:
     with zipfile.ZipFile(gamelift_sdk_zip_file, "r") as f:
-        f.extractall(working_directory.root_path.resolve())
-
-# apply required patch file to support package build
-def apply_patch_on_sdk_source(working_directory: WorkingDirectoryInfo) -> None:
-    patch_file: str = str(PACKAGE_BASE_PATH.joinpath(f"{PACKAGE_NAME}-{PACKAGE_VERSION.split('-')[0]}-{PACKAGE_PLATFORM}.patch").resolve())
-    source_folder: str = str(working_directory.source_path.resolve())
-    git_result = subprocess.run(subp_args(["git","init"]), 
-                                shell=True,
-                                capture_output=True,
-                                cwd=source_folder)
-    if git_result.returncode != 0:
-        raise Exception(f"Error git init sdk source: {git_result.stderr.decode()}")
-    git_result = subprocess.run(subp_args(["git","add","."]), 
-                                shell=True,
-                                capture_output=True,
-                                cwd=source_folder)
-    if git_result.returncode != 0:
-        raise Exception(f"Error git add sdk source: {git_result.stderr.decode()}")
-    git_result = subprocess.run(subp_args(["git","commit","-m","temp"]),
-                                shell=True,
-                                capture_output=True,
-                                cwd=source_folder)
-    if git_result.returncode != 0:
-        raise Exception(f"Error git commit sdk source: {git_result.stderr.decode()}")
-    git_result = subprocess.run(subp_args(["git","apply", "--ignore-space-change", "--ignore-whitespace", f"{patch_file}"]),
-                                shell=True,
-                                capture_output=True,
-                                cwd=source_folder)
-    if git_result.returncode != 0:
-        raise Exception(f"Error git apply patch sdk source: {git_result.stderr.decode()}")
+        unzip_path = working_directory.root_path.resolve()
+        for file in f.namelist():
+            # Ignore the __MACOSX metadata file structure because unzipping
+            # it as well can exceed the max path on windows
+            if not file.startswith('__MACOSX'):
+                f.extract(file, unzip_path)
 
 
 # get required custom environment for package build
 # get required custom environment for package build
 def get_custom_build_env():
 def get_custom_build_env():
@@ -155,13 +160,14 @@ def get_custom_build_env():
     return None
     return None
 
 
 # configure gamelift server sdk project
 # configure gamelift server sdk project
-def configure_sdk_project(source_folder: str,
+def configure_sdk_project(working_directory: WorkingDirectoryInfo,
                           build_folder: str,
                           build_folder: str,
                           build_type: str,
                           build_type: str,
                           lib_type: str) -> None:
                           lib_type: str) -> None:
+    source_folder: str = working_directory.source_path.resolve()
     build_shared: str = "ON" if lib_type == "Shared" else "OFF"
     build_shared: str = "ON" if lib_type == "Shared" else "OFF"
     if PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[0]:
     if PACKAGE_PLATFORM == PACKAGE_PLATFORM_OPTIONS[0]:
-        generator: str = "-G \"Visual Studio 15 2017\" -A x64"
+        generator: str = "-G \"Visual Studio 17\""
     elif PACKAGE_PLATFORM in (PACKAGE_PLATFORM_OPTIONS[1], PACKAGE_PLATFORM_OPTIONS[2]):
     elif PACKAGE_PLATFORM in (PACKAGE_PLATFORM_OPTIONS[1], PACKAGE_PLATFORM_OPTIONS[2]):
         generator: str = "-G \"Unix Makefiles\""
         generator: str = "-G \"Unix Makefiles\""
     else:
     else:
@@ -171,6 +177,14 @@ def configure_sdk_project(source_folder: str,
                                 f"-B {build_folder}",
                                 f"-B {build_folder}",
                                 f"-DBUILD_SHARED_LIBS={build_shared}",
                                 f"-DBUILD_SHARED_LIBS={build_shared}",
                                 f"-DCMAKE_BUILD_TYPE={build_type}"]
                                 f"-DCMAKE_BUILD_TYPE={build_type}"]
+
+    # On windows add our OpenSSL dependency to the DCMAKE_MODULE_PATH so the
+    # GameLift build can find it
+    if PACKAGE_PLATFORM == 'windows':
+        package_name = OPENSSL_PACKAGE[0]
+        openssl_dependency_path = (working_directory.dependencies_folder_path / package_name).resolve().as_posix()
+        configure_cmd.append(f"-DCMAKE_MODULE_PATH=\"{openssl_dependency_path}\"")
+
     configure_result = subprocess.run(subp_args(configure_cmd),
     configure_result = subprocess.run(subp_args(configure_cmd),
                                       shell=True,
                                       shell=True,
                                       capture_output=True,
                                       capture_output=True,
@@ -245,7 +259,7 @@ def build_gamelift_server_sdk(working_directory: WorkingDirectoryInfo,
     build_folder: pathlib.Path = working_directory.build_path.joinpath(f"{build_type}_{lib_type}").resolve()
     build_folder: pathlib.Path = working_directory.build_path.joinpath(f"{build_type}_{lib_type}").resolve()
     
     
     print(f"Generating GameLift Server SDK project with {build_type} {lib_type} configuration...")
     print(f"Generating GameLift Server SDK project with {build_type} {lib_type} configuration...")
-    configure_sdk_project(working_directory.source_path.resolve(), build_folder.resolve(), build_type, lib_type)
+    configure_sdk_project(working_directory, build_folder.resolve(), build_type, lib_type)
     
     
     print(f"Building GameLift Server SDK project with {build_type} {lib_type} configuration...")
     print(f"Building GameLift Server SDK project with {build_type} {lib_type} configuration...")
     build_sdk_project(working_directory.source_path.resolve(), build_folder.resolve(), build_type)
     build_sdk_project(working_directory.source_path.resolve(), build_folder.resolve(), build_type)
@@ -256,7 +270,7 @@ def build_gamelift_server_sdk(working_directory: WorkingDirectoryInfo,
 # generate required information for package, like name, url, and license
 # generate required information for package, like name, url, and license
 def generate_packageInfo(working_directory: WorkingDirectoryInfo) -> None:
 def generate_packageInfo(working_directory: WorkingDirectoryInfo) -> None:
     settings={
     settings={
-        'PackageName': f'{PACKAGE_NAME}-{PACKAGE_VERSION}-{PACKAGE_PLATFORM}',
+        'PackageName': f'{O3DE_PACKAGE_NAME}',
         "URL"         : f'{PACKAGE_URL}',
         "URL"         : f'{PACKAGE_URL}',
         "License"     : f'{PACKAGE_LICENSE}',
         "License"     : f'{PACKAGE_LICENSE}',
         'LicenseFile': f'{PACKAGE_NAME}/{PACKAGE_LICENSE_FILE}'
         'LicenseFile': f'{PACKAGE_NAME}/{PACKAGE_LICENSE_FILE}'
@@ -282,21 +296,21 @@ if __name__ == '__main__':
     try:
     try:
         print("Collecting package build info for GameLift Server SDK...")
         print("Collecting package build info for GameLift Server SDK...")
         collect_package_info()
         collect_package_info()
-        
+
         print("Prepare working directory...")
         print("Prepare working directory...")
         working_directory: WorkingDirectoryInfo = prepare_working_directory()
         working_directory: WorkingDirectoryInfo = prepare_working_directory()
-        
+
         print(f"Downloading GameLift Server SDK from {GAMELIFT_SERVER_SDK_DOWNLOAD_URL}...")
         print(f"Downloading GameLift Server SDK from {GAMELIFT_SERVER_SDK_DOWNLOAD_URL}...")
         download_gamelift_server_sdk(working_directory)
         download_gamelift_server_sdk(working_directory)
-        
-        print("Initializing and applying patch to GameLift Server SDK source....")
-        apply_patch_on_sdk_source(working_directory)
-        
+
+        # Retrieve any dependencies (if needed)
+        get_dependencies(working_directory)
+
         # build sdk with different configurations
         # build sdk with different configurations
         for build_type in PACKAGE_BUILD_TYPES:
         for build_type in PACKAGE_BUILD_TYPES:
                 for lib_type in PACKAGE_LIB_TYPES:
                 for lib_type in PACKAGE_LIB_TYPES:
                     build_gamelift_server_sdk(working_directory, build_type, lib_type)
                     build_gamelift_server_sdk(working_directory, build_type, lib_type)
-        
+
         print("Copying include and license files into output directory...")
         print("Copying include and license files into output directory...")
         shutil.copytree(working_directory.source_path.joinpath("gamelift-server-sdk/include").resolve(),
         shutil.copytree(working_directory.source_path.joinpath("gamelift-server-sdk/include").resolve(),
                         working_directory.libs_output_path.joinpath("include").resolve())
                         working_directory.libs_output_path.joinpath("include").resolve())
@@ -304,10 +318,10 @@ if __name__ == '__main__':
                                  str(working_directory.libs_output_path.resolve()))
                                  str(working_directory.libs_output_path.resolve()))
         copy_file_to_destination(str(working_directory.source_path.joinpath("NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT").resolve()),
         copy_file_to_destination(str(working_directory.source_path.joinpath("NOTICE_C++_AMAZON_GAMELIFT_SDK.TXT").resolve()),
                                  str(working_directory.libs_output_path.resolve()))
                                  str(working_directory.libs_output_path.resolve()))
-        
+
         print("Generating package info into output directory...")
         print("Generating package info into output directory...")
         generate_packageInfo(working_directory)
         generate_packageInfo(working_directory)
-        
+
         print("Generating cmake file into output directory...")
         print("Generating cmake file into output directory...")
         generate_cmake_file(working_directory)
         generate_cmake_file(working_directory)
         exit(0)
         exit(0)

+ 2 - 2
package_build_list_host_windows.json

@@ -7,7 +7,7 @@
         "assimp-5.2.5-rev1-windows":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Windows --package-root ../../package-system --clean",
         "assimp-5.2.5-rev1-windows":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Windows --package-root ../../package-system --clean",
         "astc-encoder-3.2-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Windows --package-root ../../package-system --clean",
         "astc-encoder-3.2-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/astc-encoder --platform-name Windows --package-root ../../package-system --clean",
         "azslc-1.8.15-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Windows --package-root ../../package-system/azslc/temp --clean",
         "azslc-1.8.15-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Windows --package-root ../../package-system/azslc/temp --clean",
-        "AWSGameLiftServerSDK-3.4.2-rev1-windows": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name windows",
+        "AWSGameLiftServerSDK-5.0.0-rev1-windows": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name windows",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --build-path c:/Temp/awsiot --platform-name Windows --package-root ../../package-system --clean",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --build-path c:/Temp/awsiot --platform-name Windows --package-root ../../package-system --clean",
         "AWSNativeSDK-1.9.50-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Android --package-root ../../package-system --clean",
         "AWSNativeSDK-1.9.50-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Android --package-root ../../package-system --clean",
         "AWSNativeSDK-1.9.50-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Windows --package-root ../../package-system --clean",
         "AWSNativeSDK-1.9.50-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Windows --package-root ../../package-system --clean",
@@ -68,7 +68,7 @@
     "assimp-5.2.5-rev1-windows": "package-system/assimp-windows",
     "assimp-5.2.5-rev1-windows": "package-system/assimp-windows",
     "astc-encoder-3.2-rev2-windows": "package-system/astc-encoder-windows",
     "astc-encoder-3.2-rev2-windows": "package-system/astc-encoder-windows",
     "azslc-1.8.15-rev2-windows": "package-system/azslc/temp/azslc-windows",
     "azslc-1.8.15-rev2-windows": "package-system/azslc/temp/azslc-windows",
-    "AWSGameLiftServerSDK-3.4.2-rev1-windows": "package-system/AWSGameLiftServerSDK-windows",
+    "AWSGameLiftServerSDK-5.0.0-rev1-windows": "package-system/AWSGameLiftServerSDK-windows",
     "AwsIotDeviceSdkCpp-1.15.2-rev1-windows": "package-system/AwsIotDeviceSdkCpp-windows",
     "AwsIotDeviceSdkCpp-1.15.2-rev1-windows": "package-system/AwsIotDeviceSdkCpp-windows",
     "AWSNativeSDK-1.9.50-rev2-android": "package-system/AWSNativeSDK-android",
     "AWSNativeSDK-1.9.50-rev2-android": "package-system/AWSNativeSDK-android",
     "AWSNativeSDK-1.9.50-rev2-windows": "package-system/AWSNativeSDK-windows",
     "AWSNativeSDK-1.9.50-rev2-windows": "package-system/AWSNativeSDK-windows",