Cherry-pick of Linux deb package to stabilization (#5778)
* Cherry-pick 49e8f35858
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Merging differences from development of other changes that need to be there for deb packaging
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Picks a needed change for the installer
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Fixes warning in mac
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Takes version from environment if defined
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Do not pick up version if it is empty string since that will also break version comparison
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* creating temp directories if they dont exist
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* removing a dependency to itself (Multiplayer.Builders is an alias of Multiplayer.Editor)
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Filters which runtime dependencies are passed from private build dependencies to only those that are actual targets.
This avoids something like a "d3d12" private build dependency from being passed to the runtime dependencies
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
parent
3cf3e45b38
commit
dbc5d7a8bc
@ -0,0 +1,13 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
# File to tweak compiler settings before compiler detection happens (before project() is called)
|
||||||
|
# We dont have PAL enabled at this point, so we can only use pure-CMake variables
|
||||||
|
if("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Linux")
|
||||||
|
include(cmake/Platform/Linux/CompilerSettings_linux.cmake)
|
||||||
|
endif()
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
set(LY_ROOT_FOLDER "@LY_ROOT_FOLDER@")
|
||||||
|
set(CMAKE_SCRIPT_MODE_FILE TRUE)
|
||||||
|
include(@LY_ROOT_FOLDER@/cmake/3rdPartyPackages.cmake)
|
||||||
|
|
||||||
|
if(EXISTS "@LY_CMAKE_PACKAGE_DOWNLOAD_PATH@")
|
||||||
|
file(SHA256 "@LY_CMAKE_PACKAGE_DOWNLOAD_PATH@" hash_of_downloaded_file)
|
||||||
|
if (NOT "${hash_of_downloaded_file}" STREQUAL "@CPACK_CMAKE_PACKAGE_HASH@")
|
||||||
|
message(STATUS "CMake @CPACK_DESIRED_CMAKE_VERSION@ found at @LY_CMAKE_PACKAGE_DOWNLOAD_PATH@ but expected hash missmatches, re-downloading...")
|
||||||
|
file(REMOVE "@LY_CMAKE_PACKAGE_DOWNLOAD_PATH@")
|
||||||
|
else()
|
||||||
|
message(STATUS "CMake @CPACK_DESIRED_CMAKE_VERSION@ found")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
if(NOT EXISTS "@LY_CMAKE_PACKAGE_DOWNLOAD_PATH@")
|
||||||
|
# download it
|
||||||
|
string(REPLACE "." ";" _version_components "@CPACK_DESIRED_CMAKE_VERSION@")
|
||||||
|
list(GET _version_components 0 _major_version)
|
||||||
|
list(GET _version_components 1 _minor_version)
|
||||||
|
|
||||||
|
set(_url_version_tag "v${_major_version}.${_minor_version}")
|
||||||
|
set(_package_url "https://cmake.org/files/${_url_version_tag}/@CPACK_CMAKE_PACKAGE_FILE@")
|
||||||
|
|
||||||
|
message(STATUS "Downloading CMake @CPACK_DESIRED_CMAKE_VERSION@ for packaging...")
|
||||||
|
download_file(
|
||||||
|
URL ${_package_url}
|
||||||
|
TARGET_FILE @LY_CMAKE_PACKAGE_DOWNLOAD_PATH@
|
||||||
|
EXPECTED_HASH @CPACK_CMAKE_PACKAGE_HASH@
|
||||||
|
RESULTS _results
|
||||||
|
)
|
||||||
|
list(GET _results 0 _status_code)
|
||||||
|
|
||||||
|
if (${_status_code} EQUAL 0 AND EXISTS "@LY_CMAKE_PACKAGE_DOWNLOAD_PATH@")
|
||||||
|
message(STATUS "CMake @CPACK_DESIRED_CMAKE_VERSION@ found")
|
||||||
|
else()
|
||||||
|
file(REMOVE "@LY_CMAKE_PACKAGE_DOWNLOAD_PATH@")
|
||||||
|
list(REMOVE_AT _results 0)
|
||||||
|
|
||||||
|
set(_error_message "An error occurred, code ${_status_code}. URL ${_package_url} - ${_results}")
|
||||||
|
if(${_status_code} EQUAL 1)
|
||||||
|
string(APPEND _error_message
|
||||||
|
" Please double check the CPACK_CMAKE_PACKAGE_FILE and "
|
||||||
|
"CPACK_CMAKE_PACKAGE_HASH properties before trying again.")
|
||||||
|
endif()
|
||||||
|
message(FATAL_ERROR ${_error_message})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
message(STATUS "Executing packaging postbuild...")
|
||||||
|
|
||||||
|
# ly_is_s3_url
|
||||||
|
# if the given URL is a s3 url of thr form "s3://(stuff)" then sets
|
||||||
|
# the output_variable_name to TRUE otherwise unsets it.
|
||||||
|
function (ly_is_s3_url download_url output_variable_name)
|
||||||
|
if ("${download_url}" MATCHES "s3://.*")
|
||||||
|
set(${output_variable_name} TRUE PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
unset(${output_variable_name} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(ly_upload_to_url in_url in_local_path in_file_regex)
|
||||||
|
|
||||||
|
message(STATUS "Uploading ${in_local_path}/${in_file_regex} artifacts to ${CPACK_UPLOAD_URL}")
|
||||||
|
ly_is_s3_url(${in_url} _is_s3_bucket)
|
||||||
|
if(NOT _is_s3_bucket)
|
||||||
|
message(FATAL_ERROR "Only S3 installer uploading is supported at this time")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# strip the scheme and extract the bucket/key prefix from the URL
|
||||||
|
string(REPLACE "s3://" "" _stripped_url ${in_url})
|
||||||
|
string(REPLACE "/" ";" _tokens ${_stripped_url})
|
||||||
|
|
||||||
|
list(POP_FRONT _tokens _bucket)
|
||||||
|
string(JOIN "/" _prefix ${_tokens})
|
||||||
|
|
||||||
|
set(_extra_args [[{"ACL":"bucket-owner-full-control"}]])
|
||||||
|
|
||||||
|
file(TO_NATIVE_PATH "${LY_ROOT_FOLDER}/scripts/build/tools/upload_to_s3.py" _upload_script)
|
||||||
|
|
||||||
|
set(_upload_command
|
||||||
|
${CPACK_LY_PYTHON_CMD} -s
|
||||||
|
-u ${_upload_script}
|
||||||
|
--base_dir ${in_local_path}
|
||||||
|
--file_regex="${in_file_regex}"
|
||||||
|
--bucket ${_bucket}
|
||||||
|
--key_prefix ${_prefix}
|
||||||
|
--extra_args ${_extra_args}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CPACK_AWS_PROFILE)
|
||||||
|
list(APPEND _upload_command --profile ${CPACK_AWS_PROFILE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_upload_command}
|
||||||
|
RESULT_VARIABLE _upload_result
|
||||||
|
OUTPUT_VARIABLE _upload_output
|
||||||
|
ERROR_VARIABLE _upload_error
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
|
||||||
|
if (${_upload_result} EQUAL 0)
|
||||||
|
message(STATUS "Artifact uploading complete!")
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "An error occurred uploading to s3.\n Output: ${_upload_output}\n\ Error: ${_upload_error}")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(ly_upload_to_latest in_url in_path)
|
||||||
|
|
||||||
|
message(STATUS "Updating latest tagged build")
|
||||||
|
|
||||||
|
# make sure we can extra the commit info from the URL first
|
||||||
|
string(REGEX MATCH "([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9a-zA-Z]+)"
|
||||||
|
commit_info ${in_url}
|
||||||
|
)
|
||||||
|
if(NOT commit_info)
|
||||||
|
message(FATAL_ERROR "Failed to extract the build tag")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Create a temp directory where we are going to rename the file to take out the version
|
||||||
|
# and then upload it
|
||||||
|
set(temp_dir ${CPACK_BINARY_DIR}/temp)
|
||||||
|
if(NOT EXISTS ${temp_dir})
|
||||||
|
file(MAKE_DIRECTORY ${temp_dir})
|
||||||
|
endif()
|
||||||
|
file(COPY ${in_path} DESTINATION ${temp_dir})
|
||||||
|
|
||||||
|
cmake_path(GET in_path FILENAME in_path_filename)
|
||||||
|
string(REPLACE "_${CPACK_PACKAGE_VERSION}" "" non_versioned_in_path_filename ${in_path_filename})
|
||||||
|
file(RENAME "${temp_dir}/${in_path_filename}" "${temp_dir}/${non_versioned_in_path_filename}")
|
||||||
|
|
||||||
|
# include the commit info in a text file that will live next to the exe
|
||||||
|
set(_temp_info_file ${temp_dir}/build_tag.txt)
|
||||||
|
file(WRITE ${_temp_info_file} ${commit_info})
|
||||||
|
|
||||||
|
# update the URL and upload
|
||||||
|
string(REPLACE
|
||||||
|
${commit_info} "Latest"
|
||||||
|
latest_upload_url ${in_url}
|
||||||
|
)
|
||||||
|
|
||||||
|
ly_upload_to_url(
|
||||||
|
${latest_upload_url}
|
||||||
|
${temp_dir}
|
||||||
|
".*(${non_versioned_in_path_filename}|build_tag.txt)$"
|
||||||
|
)
|
||||||
|
|
||||||
|
# cleanup the temp files
|
||||||
|
file(REMOVE_RECURSE ${temp_dir})
|
||||||
|
message(STATUS "Latest build update complete!")
|
||||||
|
|
||||||
|
endfunction()
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
@ -0,0 +1,34 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
if(NOT CMAKE_C_COMPILER AND NOT CMAKE_CXX_COMPILER AND NOT "$ENV{CC}" AND NOT "$ENV{CXX}")
|
||||||
|
set(path_search
|
||||||
|
/bin
|
||||||
|
/usr/bin
|
||||||
|
/usr/local/bin
|
||||||
|
/sbin
|
||||||
|
/usr/sbin
|
||||||
|
/usr/local/sbin
|
||||||
|
)
|
||||||
|
list(TRANSFORM path_search APPEND "/clang-[0-9]*")
|
||||||
|
file(GLOB clang_versions ${path_search})
|
||||||
|
if(clang_versions)
|
||||||
|
# Find and pick the highest installed version
|
||||||
|
list(SORT clang_versions COMPARE NATURAL)
|
||||||
|
list(GET clang_versions 0 clang_higher_version_path)
|
||||||
|
string(REGEX MATCH "clang-([0-9.]*)" clang_higher_version ${clang_higher_version_path})
|
||||||
|
if(CMAKE_MATCH_1)
|
||||||
|
set(CMAKE_C_COMPILER clang-${CMAKE_MATCH_1})
|
||||||
|
set(CMAKE_CXX_COMPILER clang++-${CMAKE_MATCH_1})
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Clang not found, please install clang")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Clang not found, please install clang")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
set -o errexit # exit on the first failure encountered
|
||||||
|
|
||||||
|
{
|
||||||
|
if [[ ! -f "/usr/lib/x86_64-linux-gnu/libffi.so.6" ]]; then
|
||||||
|
sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so.7 /usr/lib/x86_64-linux-gnu/libffi.so.6
|
||||||
|
fi
|
||||||
|
|
||||||
|
pushd @CPACK_PACKAGING_INSTALL_PREFIX@
|
||||||
|
python/get_python.sh
|
||||||
|
chown -R $SUDO_USER .
|
||||||
|
popd
|
||||||
|
} &> /dev/null # hide output
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
set -o errexit # exit on the first failure encountered
|
||||||
|
|
||||||
|
{
|
||||||
|
pushd @CPACK_PACKAGING_INSTALL_PREFIX@
|
||||||
|
popd
|
||||||
|
} &> /dev/null # hide output
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
set -o errexit # exit on the first failure encountered
|
||||||
|
|
||||||
|
{
|
||||||
|
# We dont remove this symlink that we potentially created because the user could have
|
||||||
|
# installed themselves.
|
||||||
|
#if [[ -L "/usr/lib/x86_64-linux-gnu/libffi.so.6" ]]; then
|
||||||
|
# sudo rm /usr/lib/x86_64-linux-gnu/libffi.so.6
|
||||||
|
#fi
|
||||||
|
|
||||||
|
pushd @CPACK_PACKAGING_INSTALL_PREFIX@
|
||||||
|
# delete python downloads
|
||||||
|
rm -rf python/downloaded_packages python/runtime
|
||||||
|
popd
|
||||||
|
} &> /dev/null # hide output
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||||
|
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPostBuild_common.cmake)
|
||||||
|
|
||||||
|
file(${CPACK_PACKAGE_CHECKSUM} ${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.deb file_checksum)
|
||||||
|
file(WRITE ${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.deb.sha256 "${file_checksum} ${CPACK_PACKAGE_FILE_NAME}.deb")
|
||||||
|
|
||||||
|
if(CPACK_UPLOAD_URL)
|
||||||
|
|
||||||
|
# use the internal default path if somehow not specified from cpack_configure_downloads
|
||||||
|
if(NOT CPACK_UPLOAD_DIRECTORY)
|
||||||
|
set(CPACK_UPLOAD_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}/CPackUploads)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Copy the artifacts intended to be uploaded to a remote server into the folder specified
|
||||||
|
# through CPACK_UPLOAD_DIRECTORY. This mimics the same process cpack does natively for
|
||||||
|
# some other frameworks that have built-in online installer support.
|
||||||
|
message(STATUS "Copying packaging artifacts to upload directory...")
|
||||||
|
file(REMOVE_RECURSE ${CPACK_UPLOAD_DIRECTORY})
|
||||||
|
file(GLOB _artifacts
|
||||||
|
"${CPACK_TOPLEVEL_DIRECTORY}/*.deb"
|
||||||
|
"${CPACK_TOPLEVEL_DIRECTORY}/*.sha256"
|
||||||
|
)
|
||||||
|
file(COPY ${_artifacts}
|
||||||
|
DESTINATION ${CPACK_UPLOAD_DIRECTORY}
|
||||||
|
)
|
||||||
|
message(STATUS "Artifacts copied to ${CPACK_UPLOAD_DIRECTORY}")
|
||||||
|
|
||||||
|
# TODO: copy gpg file to CPACK_UPLOAD_DIRECTORY
|
||||||
|
|
||||||
|
ly_upload_to_url(
|
||||||
|
${CPACK_UPLOAD_URL}
|
||||||
|
${CPACK_UPLOAD_DIRECTORY}
|
||||||
|
".*(.deb|.gpg|.sha256)$"
|
||||||
|
)
|
||||||
|
|
||||||
|
# for auto tagged builds, we will also upload a second copy of just the boostrapper
|
||||||
|
# to a special "Latest" folder under the branch in place of the commit date/hash
|
||||||
|
if(CPACK_AUTO_GEN_TAG)
|
||||||
|
|
||||||
|
set(latest_deb_package "${CPACK_UPLOAD_DIRECTORY}/${CPACK_PACKAGE_NAME}_latest.deb")
|
||||||
|
file(COPY_FILE
|
||||||
|
${CPACK_UPLOAD_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.deb
|
||||||
|
${latest_deb_package}
|
||||||
|
)
|
||||||
|
ly_upload_to_latest(${CPACK_UPLOAD_URL} ${latest_deb_package})
|
||||||
|
|
||||||
|
# TODO: upload gpg file to latest
|
||||||
|
|
||||||
|
# Generate a checksum file for latest and upload it
|
||||||
|
set(latest_hash_file "${CPACK_UPLOAD_DIRECTORY}/${CPACK_PACKAGE_NAME}_latest.deb.sha256")
|
||||||
|
file(WRITE "${latest_hash_file}" "${file_checksum} ${CPACK_PACKAGE_NAME}_latest.deb")
|
||||||
|
ly_upload_to_latest(${CPACK_UPLOAD_URL} "${latest_hash_file}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
@ -0,0 +1,16 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||||
|
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPreBuild_common.cmake)
|
||||||
|
|
||||||
|
if(NOT CPACK_UPLOAD_URL) # Skip signing if we are not uploading the package
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# TODO: do signing
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
set(CPACK_GENERATOR DEB)
|
||||||
|
|
||||||
|
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/${CPACK_PACKAGE_NAME}/${LY_VERSION_STRING}")
|
||||||
|
|
||||||
|
set(_cmake_package_name "cmake-${CPACK_DESIRED_CMAKE_VERSION}-linux-x86_64")
|
||||||
|
set(CPACK_CMAKE_PACKAGE_FILE "${_cmake_package_name}.tar.gz")
|
||||||
|
set(CPACK_CMAKE_PACKAGE_HASH "3f827544f9c82e74ddf5016461fdfcfea4ede58a26f82612f473bf6bfad8bfc2")
|
||||||
|
|
||||||
|
# get all the package dependencies, extracted from scripts\build\build_node\Platform\Linux\package-list.ubuntu-focal.txt
|
||||||
|
set(package_dependencies
|
||||||
|
libffi7
|
||||||
|
clang-12
|
||||||
|
ninja-build
|
||||||
|
# Build Libraries
|
||||||
|
libglu1-mesa-dev # For Qt (GL dependency)
|
||||||
|
libxcb-xinerama0 # For Qt plugins at runtime
|
||||||
|
libxcb-xinput0 # For Qt plugins at runtime
|
||||||
|
libfontconfig1-dev # For Qt plugins at runtime
|
||||||
|
libcurl4-openssl-dev # For HttpRequestor
|
||||||
|
# libsdl2-dev # for WWise/Audio
|
||||||
|
libxcb-xkb-dev # For xcb keyboard input
|
||||||
|
libxkbcommon-x11-dev # For xcb keyboard input
|
||||||
|
libxkbcommon-dev # For xcb keyboard input
|
||||||
|
libxcb-xfixes0-dev # For mouse input
|
||||||
|
libxcb-xinput-dev # For mouse input
|
||||||
|
zlib1g-dev
|
||||||
|
mesa-common-dev
|
||||||
|
)
|
||||||
|
list(JOIN package_dependencies "," CPACK_DEBIAN_PACKAGE_DEPENDS)
|
||||||
|
|
||||||
|
# Post-installation and pre/post removal scripts
|
||||||
|
configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postinst.in"
|
||||||
|
"${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postinst"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/prerm.in"
|
||||||
|
"${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/prerm"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postrm.in"
|
||||||
|
"${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postrm"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||||
|
${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/postinst
|
||||||
|
${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/prerm
|
||||||
|
${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/postrm
|
||||||
|
)
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||||
|
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPostBuild_common.cmake)
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||||
|
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPreBuild_common.cmake)
|
||||||
@ -1,237 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
|
||||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
# convert the path to a windows style path using string replace because TO_NATIVE_PATH
|
|
||||||
# only works on real paths
|
|
||||||
string(REPLACE "/" "\\" _fixed_package_install_dir ${CPACK_PACKAGE_INSTALL_DIRECTORY})
|
|
||||||
|
|
||||||
# directory where the auto generated files live e.g <build>/_CPack_Package/win64/WIX
|
|
||||||
set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY})
|
|
||||||
set(_bootstrap_out_dir "${CPACK_TOPLEVEL_DIRECTORY}/bootstrap")
|
|
||||||
|
|
||||||
set(_bootstrap_filename "${CPACK_PACKAGE_FILE_NAME}_installer.exe")
|
|
||||||
set(_bootstrap_output_file ${_cpack_wix_out_dir}/${_bootstrap_filename})
|
|
||||||
|
|
||||||
set(_ext_flags
|
|
||||||
-ext WixBalExtension
|
|
||||||
)
|
|
||||||
|
|
||||||
set(_addtional_defines
|
|
||||||
-dCPACK_BOOTSTRAP_THEME_FILE=${CPACK_BINARY_DIR}/BootstrapperTheme
|
|
||||||
-dCPACK_BOOTSTRAP_UPGRADE_GUID=${CPACK_WIX_BOOTSTRAP_UPGRADE_GUID}
|
|
||||||
-dCPACK_DOWNLOAD_SITE=${CPACK_DOWNLOAD_SITE}
|
|
||||||
-dCPACK_LOCAL_INSTALLER_DIR=${_cpack_wix_out_dir}
|
|
||||||
-dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME}
|
|
||||||
-dCPACK_PACKAGE_INSTALL_DIRECTORY=${_fixed_package_install_dir}
|
|
||||||
-dCPACK_WIX_PRODUCT_LOGO=${CPACK_WIX_PRODUCT_LOGO}
|
|
||||||
-dCPACK_RESOURCE_PATH=${CPACK_SOURCE_DIR}/Platform/Windows/Packaging
|
|
||||||
)
|
|
||||||
|
|
||||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." _root_path)
|
|
||||||
file(TO_NATIVE_PATH "${_root_path}/scripts/signer/Platform/Windows/signer.ps1" _sign_script)
|
|
||||||
|
|
||||||
if(CPACK_LICENSE_URL)
|
|
||||||
list(APPEND _addtional_defines -dCPACK_LICENSE_URL=${CPACK_LICENSE_URL})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(_candle_command
|
|
||||||
${CPACK_WIX_CANDLE_EXECUTABLE}
|
|
||||||
-nologo
|
|
||||||
-arch x64
|
|
||||||
"-I${_cpack_wix_out_dir}" # to include cpack_variables.wxi
|
|
||||||
${_addtional_defines}
|
|
||||||
${_ext_flags}
|
|
||||||
"${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Bootstrapper.wxs"
|
|
||||||
-o "${_bootstrap_out_dir}/"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(_light_command
|
|
||||||
${CPACK_WIX_LIGHT_EXECUTABLE}
|
|
||||||
-nologo
|
|
||||||
${_ext_flags}
|
|
||||||
${_bootstrap_out_dir}/*.wixobj
|
|
||||||
-o "${_bootstrap_output_file}"
|
|
||||||
)
|
|
||||||
|
|
||||||
set(_signing_command
|
|
||||||
psexec.exe
|
|
||||||
-accepteula
|
|
||||||
-nobanner
|
|
||||||
-s
|
|
||||||
powershell.exe
|
|
||||||
-NoLogo
|
|
||||||
-ExecutionPolicy Bypass
|
|
||||||
-File ${_sign_script}
|
|
||||||
)
|
|
||||||
|
|
||||||
message(STATUS "Signing package files in ${_cpack_wix_out_dir}")
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${_signing_command} -packagePath ${_cpack_wix_out_dir}
|
|
||||||
RESULT_VARIABLE _signing_result
|
|
||||||
ERROR_VARIABLE _signing_errors
|
|
||||||
OUTPUT_VARIABLE _signing_output
|
|
||||||
ECHO_OUTPUT_VARIABLE
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT ${_signing_result} EQUAL 0)
|
|
||||||
message(FATAL_ERROR "An error occurred during signing package files. ${_signing_errors}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message(STATUS "Creating Bootstrap Installer...")
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${_candle_command}
|
|
||||||
RESULT_VARIABLE _candle_result
|
|
||||||
ERROR_VARIABLE _candle_errors
|
|
||||||
)
|
|
||||||
if(NOT ${_candle_result} EQUAL 0)
|
|
||||||
message(FATAL_ERROR "An error occurred invoking candle.exe. ${_candle_errors}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${_light_command}
|
|
||||||
RESULT_VARIABLE _light_result
|
|
||||||
ERROR_VARIABLE _light_errors
|
|
||||||
)
|
|
||||||
if(NOT ${_light_result} EQUAL 0)
|
|
||||||
message(FATAL_ERROR "An error occurred invoking light.exe. ${_light_errors}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
file(COPY ${_bootstrap_output_file}
|
|
||||||
DESTINATION ${CPACK_PACKAGE_DIRECTORY}
|
|
||||||
)
|
|
||||||
|
|
||||||
message(STATUS "Bootstrap installer generated to ${CPACK_PACKAGE_DIRECTORY}/${_bootstrap_filename}")
|
|
||||||
|
|
||||||
message(STATUS "Signing bootstrap installer in ${CPACK_PACKAGE_DIRECTORY}")
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${_signing_command} -bootstrapPath ${CPACK_PACKAGE_DIRECTORY}/${_bootstrap_filename}
|
|
||||||
RESULT_VARIABLE _signing_result
|
|
||||||
ERROR_VARIABLE _signing_errors
|
|
||||||
OUTPUT_VARIABLE _signing_output
|
|
||||||
ECHO_OUTPUT_VARIABLE
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT ${_signing_result} EQUAL 0)
|
|
||||||
message(FATAL_ERROR "An error occurred during signing bootstrap installer. ${_signing_errors}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# use the internal default path if somehow not specified from cpack_configure_downloads
|
|
||||||
if(NOT CPACK_UPLOAD_DIRECTORY)
|
|
||||||
set(CPACK_UPLOAD_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}/CPackUploads)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# copy the artifacts intended to be uploaded to a remote server into the folder specified
|
|
||||||
# through cpack_configure_downloads. this mimics the same process cpack does natively for
|
|
||||||
# some other frameworks that have built-in online installer support.
|
|
||||||
message(STATUS "Copying installer artifacts to upload directory...")
|
|
||||||
file(REMOVE_RECURSE ${CPACK_UPLOAD_DIRECTORY})
|
|
||||||
file(GLOB _artifacts "${_cpack_wix_out_dir}/*.msi" "${_cpack_wix_out_dir}/*.cab")
|
|
||||||
file(COPY ${_artifacts}
|
|
||||||
DESTINATION ${CPACK_UPLOAD_DIRECTORY}
|
|
||||||
)
|
|
||||||
message(STATUS "Artifacts copied to ${CPACK_UPLOAD_DIRECTORY}")
|
|
||||||
|
|
||||||
if(NOT CPACK_UPLOAD_URL)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
file(TO_NATIVE_PATH "${_cpack_wix_out_dir}" _cpack_wix_out_dir)
|
|
||||||
file(TO_NATIVE_PATH "${_root_path}/python/python.cmd" _python_cmd)
|
|
||||||
file(TO_NATIVE_PATH "${_root_path}/scripts/build/tools/upload_to_s3.py" _upload_script)
|
|
||||||
|
|
||||||
function(upload_to_s3 in_url in_local_path in_file_regex)
|
|
||||||
|
|
||||||
# strip the scheme and extract the bucket/key prefix from the URL
|
|
||||||
string(REPLACE "s3://" "" _stripped_url ${in_url})
|
|
||||||
string(REPLACE "/" ";" _tokens ${_stripped_url})
|
|
||||||
|
|
||||||
list(POP_FRONT _tokens _bucket)
|
|
||||||
string(JOIN "/" _prefix ${_tokens})
|
|
||||||
|
|
||||||
set(_extra_args [[{"ACL":"bucket-owner-full-control"}]])
|
|
||||||
|
|
||||||
set(_upload_command
|
|
||||||
${_python_cmd} -s
|
|
||||||
-u ${_upload_script}
|
|
||||||
--base_dir ${in_local_path}
|
|
||||||
--file_regex="${in_file_regex}"
|
|
||||||
--bucket ${_bucket}
|
|
||||||
--key_prefix ${_prefix}
|
|
||||||
--extra_args ${_extra_args}
|
|
||||||
)
|
|
||||||
|
|
||||||
if(CPACK_AWS_PROFILE)
|
|
||||||
list(APPEND _upload_command --profile ${CPACK_AWS_PROFILE})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${_upload_command}
|
|
||||||
RESULT_VARIABLE _upload_result
|
|
||||||
OUTPUT_VARIABLE _upload_output
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
|
|
||||||
if (NOT ${_upload_result} EQUAL 0)
|
|
||||||
message(FATAL_ERROR "An error occurred uploading to s3.\nOutput:\n${_upload_output}")
|
|
||||||
endif()
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
message(STATUS "Uploading artifacts to ${CPACK_UPLOAD_URL}")
|
|
||||||
upload_to_s3(
|
|
||||||
${CPACK_UPLOAD_URL}
|
|
||||||
${_cpack_wix_out_dir}
|
|
||||||
".*(cab|exe|msi)$"
|
|
||||||
)
|
|
||||||
message(STATUS "Artifact uploading complete!")
|
|
||||||
|
|
||||||
# for auto tagged builds, we will also upload a second copy of just the boostrapper
|
|
||||||
# to a special "Latest" folder under the branch in place of the commit date/hash
|
|
||||||
if(CPACK_AUTO_GEN_TAG)
|
|
||||||
message(STATUS "Updating latest tagged build")
|
|
||||||
|
|
||||||
# make sure we can extra the commit info from the URL first
|
|
||||||
string(REGEX MATCH "([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9a-zA-Z]+)"
|
|
||||||
_commit_info ${CPACK_UPLOAD_URL}
|
|
||||||
)
|
|
||||||
if(NOT _commit_info)
|
|
||||||
message(FATAL_ERROR "Failed to extract the build tag")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(_temp_dir ${_cpack_wix_out_dir}/temp)
|
|
||||||
if(NOT EXISTS ${_temp_dir})
|
|
||||||
file(MAKE_DIRECTORY ${_temp_dir})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# strip the version number form the exe name in the one uploaded to latest
|
|
||||||
string(TOLOWER "${CPACK_PACKAGE_NAME}_installer.exe" _non_versioned_exe)
|
|
||||||
set(_temp_exe_copy ${_temp_dir}/${_non_versioned_exe})
|
|
||||||
|
|
||||||
file(COPY ${_bootstrap_output_file} DESTINATION ${_temp_dir})
|
|
||||||
file(RENAME "${_temp_dir}/${_bootstrap_filename}" ${_temp_exe_copy})
|
|
||||||
|
|
||||||
# include the commit info in a text file that will live next to the exe
|
|
||||||
set(_temp_info_file ${_temp_dir}/build_tag.txt)
|
|
||||||
file(WRITE ${_temp_info_file} ${_commit_info})
|
|
||||||
|
|
||||||
# update the URL and upload
|
|
||||||
string(REPLACE
|
|
||||||
${_commit_info} "Latest"
|
|
||||||
_latest_upload_url ${CPACK_UPLOAD_URL}
|
|
||||||
)
|
|
||||||
|
|
||||||
upload_to_s3(
|
|
||||||
${_latest_upload_url}
|
|
||||||
${_temp_dir}
|
|
||||||
".*(${_non_versioned_exe}|build_tag.txt)$"
|
|
||||||
)
|
|
||||||
|
|
||||||
# cleanup the temp files
|
|
||||||
file(REMOVE_RECURSE ${_temp_dir})
|
|
||||||
|
|
||||||
message(STATUS "Latest build update complete!")
|
|
||||||
endif()
|
|
||||||
@ -0,0 +1,166 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||||
|
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPostBuild_common.cmake)
|
||||||
|
|
||||||
|
# convert the path to a windows style path using string replace because TO_NATIVE_PATH
|
||||||
|
# only works on real paths
|
||||||
|
string(REPLACE "/" "\\" _fixed_package_install_dir ${CPACK_PACKAGE_INSTALL_DIRECTORY})
|
||||||
|
|
||||||
|
# directory where the auto generated files live e.g <build>/_CPack_Package/win64/WIX
|
||||||
|
set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY})
|
||||||
|
set(_bootstrap_out_dir "${CPACK_TOPLEVEL_DIRECTORY}/bootstrap")
|
||||||
|
|
||||||
|
set(_bootstrap_filename "${CPACK_PACKAGE_FILE_NAME}_installer.exe")
|
||||||
|
set(_bootstrap_output_file ${_cpack_wix_out_dir}/${_bootstrap_filename})
|
||||||
|
|
||||||
|
set(_ext_flags
|
||||||
|
-ext WixBalExtension
|
||||||
|
)
|
||||||
|
|
||||||
|
set(_addtional_defines
|
||||||
|
-dCPACK_BOOTSTRAP_THEME_FILE=${CPACK_BINARY_DIR}/BootstrapperTheme
|
||||||
|
-dCPACK_BOOTSTRAP_UPGRADE_GUID=${CPACK_WIX_BOOTSTRAP_UPGRADE_GUID}
|
||||||
|
-dCPACK_DOWNLOAD_SITE=${CPACK_DOWNLOAD_SITE}
|
||||||
|
-dCPACK_LOCAL_INSTALLER_DIR=${_cpack_wix_out_dir}
|
||||||
|
-dCPACK_PACKAGE_FILE_NAME=${CPACK_PACKAGE_FILE_NAME}
|
||||||
|
-dCPACK_PACKAGE_INSTALL_DIRECTORY=${_fixed_package_install_dir}
|
||||||
|
-dCPACK_WIX_PRODUCT_LOGO=${CPACK_WIX_PRODUCT_LOGO}
|
||||||
|
-dCPACK_RESOURCE_PATH=${CPACK_SOURCE_DIR}/Platform/Windows/Packaging
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CPACK_LICENSE_URL)
|
||||||
|
list(APPEND _addtional_defines -dCPACK_LICENSE_URL=${CPACK_LICENSE_URL})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(_candle_command
|
||||||
|
${CPACK_WIX_CANDLE_EXECUTABLE}
|
||||||
|
-nologo
|
||||||
|
-arch x64
|
||||||
|
"-I${_cpack_wix_out_dir}" # to include cpack_variables.wxi
|
||||||
|
${_addtional_defines}
|
||||||
|
${_ext_flags}
|
||||||
|
"${CPACK_SOURCE_DIR}/Platform/Windows/Packaging/Bootstrapper.wxs"
|
||||||
|
-o "${_bootstrap_out_dir}/"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(_light_command
|
||||||
|
${CPACK_WIX_LIGHT_EXECUTABLE}
|
||||||
|
-nologo
|
||||||
|
${_ext_flags}
|
||||||
|
${_bootstrap_out_dir}/*.wixobj
|
||||||
|
-o "${_bootstrap_output_file}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(CPACK_UPLOAD_URL) # Skip signing if we are not uploading the package
|
||||||
|
file(TO_NATIVE_PATH "${LY_ROOT_FOLDER}/scripts/signer/Platform/Windows/signer.ps1" _sign_script)
|
||||||
|
|
||||||
|
unset(_signing_command)
|
||||||
|
find_program(_psiexec_path psexec.exe)
|
||||||
|
if(_psiexec_path)
|
||||||
|
list(APPEND _signing_command
|
||||||
|
${_psiexec_path}
|
||||||
|
-accepteula
|
||||||
|
-nobanner
|
||||||
|
-s
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_program(_powershell_path powershell.exe REQUIRED)
|
||||||
|
list(APPEND _signing_command
|
||||||
|
${_powershell_path}
|
||||||
|
-NoLogo
|
||||||
|
-ExecutionPolicy Bypass
|
||||||
|
-File ${_sign_script}
|
||||||
|
)
|
||||||
|
|
||||||
|
message(STATUS "Signing package files in ${_cpack_wix_out_dir}")
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_signing_command} -packagePath ${_cpack_wix_out_dir}
|
||||||
|
RESULT_VARIABLE _signing_result
|
||||||
|
ERROR_VARIABLE _signing_errors
|
||||||
|
OUTPUT_VARIABLE _signing_output
|
||||||
|
ECHO_OUTPUT_VARIABLE
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT ${_signing_result} EQUAL 0)
|
||||||
|
message(FATAL_ERROR "An error occurred during signing package files. ${_signing_errors}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Creating Bootstrap Installer...")
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_candle_command}
|
||||||
|
RESULT_VARIABLE _candle_result
|
||||||
|
ERROR_VARIABLE _candle_errors
|
||||||
|
)
|
||||||
|
if(NOT ${_candle_result} EQUAL 0)
|
||||||
|
message(FATAL_ERROR "An error occurred invoking candle.exe. ${_candle_errors}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_light_command}
|
||||||
|
RESULT_VARIABLE _light_result
|
||||||
|
ERROR_VARIABLE _light_errors
|
||||||
|
)
|
||||||
|
if(NOT ${_light_result} EQUAL 0)
|
||||||
|
message(FATAL_ERROR "An error occurred invoking light.exe. ${_light_errors}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Bootstrap installer generated to ${_bootstrap_output_file}")
|
||||||
|
|
||||||
|
if(CPACK_UPLOAD_URL) # Skip signing if we are not uploading the package
|
||||||
|
message(STATUS "Signing bootstrap installer in ${_bootstrap_output_file}")
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_signing_command} -bootstrapPath ${_bootstrap_output_file}
|
||||||
|
RESULT_VARIABLE _signing_result
|
||||||
|
ERROR_VARIABLE _signing_errors
|
||||||
|
OUTPUT_VARIABLE _signing_output
|
||||||
|
ECHO_OUTPUT_VARIABLE
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT ${_signing_result} EQUAL 0)
|
||||||
|
message(FATAL_ERROR "An error occurred during signing bootstrap installer. ${_signing_errors}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# use the internal default path if somehow not specified from cpack_configure_downloads
|
||||||
|
if(NOT CPACK_UPLOAD_DIRECTORY)
|
||||||
|
set(CPACK_UPLOAD_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}/CPackUploads)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Copy the artifacts intended to be uploaded to a remote server into the folder specified
|
||||||
|
# through CPACK_UPLOAD_DIRECTORY. This mimics the same process cpack does natively for
|
||||||
|
# some other frameworks that have built-in online installer support.
|
||||||
|
message(STATUS "Copying packaging artifacts to upload directory...")
|
||||||
|
file(REMOVE_RECURSE ${CPACK_UPLOAD_DIRECTORY})
|
||||||
|
file(GLOB _artifacts
|
||||||
|
"${_cpack_wix_out_dir}/*.msi"
|
||||||
|
"${_cpack_wix_out_dir}/*.cab"
|
||||||
|
"${_cpack_wix_out_dir}/*.exe"
|
||||||
|
)
|
||||||
|
file(COPY ${_artifacts}
|
||||||
|
DESTINATION ${CPACK_UPLOAD_DIRECTORY}
|
||||||
|
)
|
||||||
|
message(STATUS "Artifacts copied to ${CPACK_UPLOAD_DIRECTORY}")
|
||||||
|
|
||||||
|
if(CPACK_UPLOAD_URL)
|
||||||
|
file(TO_NATIVE_PATH "${_cpack_wix_out_dir}" _cpack_wix_out_dir)
|
||||||
|
ly_upload_to_url(
|
||||||
|
${CPACK_UPLOAD_URL}
|
||||||
|
${_cpack_wix_out_dir}
|
||||||
|
".*(cab|exe|msi)$"
|
||||||
|
)
|
||||||
|
|
||||||
|
# for auto tagged builds, we will also upload a second copy of just the boostrapper
|
||||||
|
# to a special "Latest" folder under the branch in place of the commit date/hash
|
||||||
|
if(CPACK_AUTO_GEN_TAG)
|
||||||
|
ly_upload_to_latest(${CPACK_UPLOAD_URL} ${_bootstrap_output_file})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
@ -1,37 +0,0 @@
|
|||||||
#
|
|
||||||
# Copyright (c) Contributors to the Open 3D Engine Project.
|
|
||||||
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." _root_path)
|
|
||||||
set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY})
|
|
||||||
file(TO_NATIVE_PATH "${_root_path}/scripts/signer/Platform/Windows/signer.ps1" _sign_script)
|
|
||||||
|
|
||||||
set(_signing_command
|
|
||||||
psexec.exe
|
|
||||||
-accepteula
|
|
||||||
-nobanner
|
|
||||||
-s
|
|
||||||
powershell.exe
|
|
||||||
-NoLogo
|
|
||||||
-ExecutionPolicy Bypass
|
|
||||||
-File ${_sign_script}
|
|
||||||
)
|
|
||||||
|
|
||||||
message(STATUS "Signing executable files in ${_cpack_wix_out_dir}")
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${_signing_command} -exePath ${_cpack_wix_out_dir}
|
|
||||||
RESULT_VARIABLE _signing_result
|
|
||||||
ERROR_VARIABLE _signing_errors
|
|
||||||
OUTPUT_VARIABLE _signing_output
|
|
||||||
ECHO_OUTPUT_VARIABLE
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT ${_signing_result} EQUAL 0)
|
|
||||||
message(FATAL_ERROR "An error occurred during signing executable files. ${_signing_errors}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
message(STATUS "Signing exes complete!")
|
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." LY_ROOT_FOLDER)
|
||||||
|
include(${LY_ROOT_FOLDER}/cmake/Platform/Common/PackagingPreBuild_common.cmake)
|
||||||
|
|
||||||
|
if(NOT CPACK_UPLOAD_URL) # Skip signing if we are not uploading the package
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(REAL_PATH "${CPACK_SOURCE_DIR}/.." _root_path)
|
||||||
|
set(_cpack_wix_out_dir ${CPACK_TOPLEVEL_DIRECTORY})
|
||||||
|
file(TO_NATIVE_PATH "${_root_path}/scripts/signer/Platform/Windows/signer.ps1" _sign_script)
|
||||||
|
|
||||||
|
unset(_signing_command)
|
||||||
|
find_program(_psiexec_path psexec.exe)
|
||||||
|
if(_psiexec_path)
|
||||||
|
list(APPEND _signing_command
|
||||||
|
${_psiexec_path}
|
||||||
|
-accepteula
|
||||||
|
-nobanner
|
||||||
|
-s
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_program(_powershell_path powershell.exe REQUIRED)
|
||||||
|
list(APPEND _signing_command
|
||||||
|
${_powershell_path}
|
||||||
|
-NoLogo
|
||||||
|
-ExecutionPolicy Bypass
|
||||||
|
-File ${_sign_script}
|
||||||
|
)
|
||||||
|
|
||||||
|
# This requires to have a valid local certificate. In continuous integration, these certificates are stored
|
||||||
|
# in the machine directly.
|
||||||
|
# You can generate a test certificate to be able to run this in a PowerShell elevated promp with:
|
||||||
|
# New-SelfSignedCertificate -DnsName foo.o3de.com -Type CodeSigning -CertStoreLocation Cert:\CurrentUser\My
|
||||||
|
# Export-Certificate -Cert (Get-ChildItem Cert:\CurrentUser\My\<cert thumbprint>) -Filepath "c:\selfsigned.crt"
|
||||||
|
# Import-Certificate -FilePath "c:\selfsigned.crt" -Cert Cert:\CurrentUser\TrustedPublisher
|
||||||
|
# Import-Certificate -FilePath "c:\selfsigned.crt" -Cert Cert:\CurrentUser\Root
|
||||||
|
|
||||||
|
message(STATUS "Signing executable files in ${_cpack_wix_out_dir}")
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${_signing_command} -exePath ${_cpack_wix_out_dir}
|
||||||
|
RESULT_VARIABLE _signing_result
|
||||||
|
ERROR_VARIABLE _signing_errors
|
||||||
|
OUTPUT_VARIABLE _signing_output
|
||||||
|
ECHO_OUTPUT_VARIABLE
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT ${_signing_result} EQUAL 0)
|
||||||
|
message(FATAL_ERROR "An error occurred during signing executable files. ${_signing_errors}")
|
||||||
|
else()
|
||||||
|
message(STATUS "Signing exes complete!")
|
||||||
|
endif()
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
set -o errexit # exit on the first failure encountered
|
||||||
|
|
||||||
|
BASEDIR=$(dirname "$0")
|
||||||
|
source $BASEDIR/build_linux.sh
|
||||||
|
|
||||||
|
source $BASEDIR/installer_linux.sh
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Copyright (c) Contributors to the Open 3D Engine Project.
|
||||||
|
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
set -o errexit # exit on the first failure encountered
|
||||||
|
|
||||||
|
BASEDIR=$(dirname "$0")
|
||||||
|
source $BASEDIR/env_linux.sh
|
||||||
|
|
||||||
|
mkdir -p ${OUTPUT_DIRECTORY}
|
||||||
|
SOURCE_DIRECTORY=${PWD}
|
||||||
|
pushd $OUTPUT_DIRECTORY
|
||||||
|
|
||||||
|
if ! command -v cpack &> /dev/null; then
|
||||||
|
echo "[ci_build] CPack not found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo [ci_build] cpack --version
|
||||||
|
cpack --version
|
||||||
|
|
||||||
|
eval echo [ci_build] cpack -C ${CONFIGURATION} ${CPACK_OPTIONS}
|
||||||
|
eval cpack -C ${CONFIGURATION} ${CPACK_OPTIONS}
|
||||||
|
|
||||||
|
popd
|
||||||
Loading…
Reference in New Issue