Packaging_linux.cmake 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. set(_cmake_package_name "cmake-${CPACK_DESIRED_CMAKE_VERSION}-linux-x86_64")
  9. set(CPACK_CMAKE_PACKAGE_FILE "${_cmake_package_name}.tar.gz")
  10. set(CPACK_CMAKE_PACKAGE_HASH "dc73115520d13bb64202383d3df52bc3d6bbb8422ecc5b2c05f803491cb215b0")
  11. if("$ENV{O3DE_PACKAGE_TYPE}" STREQUAL "SNAP")
  12. set(CPACK_GENERATOR External)
  13. set(CPACK_EXTERNAL_ENABLE_STAGING YES)
  14. set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging_Snapcraft.cmake")
  15. set(CPACK_MONOLITHIC_INSTALL 1)
  16. set(CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}")
  17. elseif("$ENV{O3DE_PACKAGE_TYPE}" STREQUAL "DEB")
  18. set(CPACK_GENERATOR DEB)
  19. set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/${CPACK_PACKAGE_NAME}/${CPACK_PACKAGE_VERSION}")
  20. # Define all the debian package dependencies needed to build and run
  21. set(package_dependencies
  22. # Required Tools
  23. "cmake (>=3.22)" # Cmake required (minimum version 3.22.0)
  24. "clang (>=12.0)" # Clang required (minimum version 12.0)
  25. ninja-build
  26. # Build Libraries
  27. libglu1-mesa-dev # For Qt (GL dependency)
  28. libxcb-xinerama0 # For Qt plugins at runtime
  29. libxcb-xinput0 # For Qt plugins at runtime
  30. libfontconfig1-dev # For Qt plugins at runtime
  31. libxcb-xkb-dev # For xcb keyboard input
  32. libxkbcommon-x11-dev # For xcb keyboard input
  33. libxkbcommon-dev # For xcb keyboard input
  34. libxcb-xfixes0-dev # For mouse input
  35. libxcb-xinput-dev # For mouse input
  36. libpcre2-16-0
  37. zlib1g-dev
  38. mesa-common-dev
  39. libunwind-dev
  40. libzstd-dev
  41. pkg-config
  42. )
  43. list(JOIN package_dependencies "," CPACK_DEBIAN_PACKAGE_DEPENDS)
  44. # Post-installation and pre/post removal scripts
  45. configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postinst.in"
  46. "${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postinst"
  47. @ONLY
  48. )
  49. configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/prerm.in"
  50. "${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/prerm"
  51. @ONLY
  52. )
  53. configure_file("${LY_ROOT_FOLDER}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postrm.in"
  54. "${CMAKE_BINARY_DIR}/cmake/Platform/${PAL_PLATFORM_NAME}/Packaging/postrm"
  55. @ONLY
  56. )
  57. set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
  58. ${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/postinst
  59. ${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/prerm
  60. ${CMAKE_BINARY_DIR}/cmake/Platform/Linux/Packaging/postrm
  61. )
  62. endif()