فهرست منبع

3P Package scripts for AZSLc (#10)

Signed-off-by: spham-amzn <[email protected]>
Steve Pham 4 سال پیش
والد
کامیت
2db299d552

+ 3 - 3
Scripts/extras/pull_and_build_from_git.py

@@ -432,8 +432,8 @@ class BuildInfo(object):
                     raise BuildError(f"Invalid/missing license file '{self.package_info.package_license_file}' specified in the build config.")
 
             license_file_content = package_license_src.read_text("UTF-8", "ignore")
-            if "Copyright" not in license_file_content:
-                raise BuildError(f"Unable to find 'Copyright' in the license file {str(self.package_info.package_license_file)}. Is this a valid license file?")
+            if "Copyright" not in license_file_content and "OPEN 3D ENGINE LICENSING" not in license_file_content:
+                raise BuildError(f"Unable to find 'Copyright' or the O3DE licensing text in the license file {str(self.package_info.package_license_file)}. Is this a valid license file?")
             target_license_copy = self.build_install_folder / os.path.basename(package_license_src)
             if target_license_copy.is_file():
                 target_license_copy.unlink()
@@ -760,7 +760,7 @@ def prepare_build(platform_name, base_folder, build_folder, package_root_folder,
 
     build_config_path = base_folder_path / build_config_file
     if not build_config_path.is_file():
-        raise BuildError(f"Invalid build config path ({build_config_path}). ")
+        raise BuildError(f"Invalid build config path ({build_config_path.absolute()}). ")
 
     with build_config_path.open() as build_json_file:
         build_config = json.load(build_json_file)

+ 2 - 1
package-system/.gitignore

@@ -14,4 +14,5 @@ poly2tri-*
 SPIRVCross-*
 DirectXShaderCompilerDxc-*
 v-hacd-*
-mikkelsen-*
+mikkelsen-*
+azslc-*

+ 1 - 0
package-system/azslc/.gitignore

@@ -0,0 +1 @@
+temp

+ 24 - 0
package-system/azslc/Findazslc.cmake.Linux

@@ -0,0 +1,24 @@
+#
+# 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(MY_NAME "azslc")
+set(TARGET_WITH_NAMESPACE "3rdParty::$${MY_NAME}")
+if (TARGET $${TARGET_WITH_NAMESPACE})
+    return()
+endif()
+
+set(output_subfolder "Builders/AZSLc")
+set($${MY_NAME}_BINARY_DIR $${CMAKE_CURRENT_LIST_DIR}/$${MY_NAME}/bin)
+
+set($${MY_NAME}_RUNTIME_DEPENDENCIES
+    $${$${MY_NAME}_BINARY_DIR}/Release/azslc
+)
+
+add_library($${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
+ly_add_target_files(TARGETS $${TARGET_WITH_NAMESPACE} OUTPUT_SUBDIRECTORY $${output_subfolder} FILES $${$${MY_NAME}_RUNTIME_DEPENDENCIES})
+
+set($${MY_NAME}_FOUND True)

+ 24 - 0
package-system/azslc/Findazslc.cmake.Mac

@@ -0,0 +1,24 @@
+#
+# 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(MY_NAME "azslc")
+set(TARGET_WITH_NAMESPACE "3rdParty::$${MY_NAME}")
+if (TARGET $${TARGET_WITH_NAMESPACE})
+    return()
+endif()
+
+set(output_subfolder "Builders/AZSLc")
+set($${MY_NAME}_BINARY_DIR $${CMAKE_CURRENT_LIST_DIR}/$${MY_NAME}/bin)
+
+set($${MY_NAME}_RUNTIME_DEPENDENCIES
+    $${$${MY_NAME}_BINARY_DIR}/Release/azslc
+)
+
+add_library($${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
+ly_add_target_files(TARGETS $${TARGET_WITH_NAMESPACE} OUTPUT_SUBDIRECTORY $${output_subfolder} FILES $${$${MY_NAME}_RUNTIME_DEPENDENCIES})
+
+set($${MY_NAME}_FOUND True)

+ 25 - 0
package-system/azslc/Findazslc.cmake.Windows

@@ -0,0 +1,25 @@
+#
+# 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(MY_NAME "azslc")
+set(TARGET_WITH_NAMESPACE "3rdParty::$${MY_NAME}")
+if (TARGET $${TARGET_WITH_NAMESPACE})
+    return()
+endif()
+
+set(output_subfolder "Builders/AZSLc")
+set($${MY_NAME}_BINARY_DIR $${CMAKE_CURRENT_LIST_DIR}/$${MY_NAME}/bin)
+
+set($${MY_NAME}_RUNTIME_DEPENDENCIES
+        $${$${MY_NAME}_BINARY_DIR}/win_x64/Release/azslc.exe
+        $${$${MY_NAME}_BINARY_DIR}/win_x64/Release/boost_regex-vc142-mt-x64-1_70.dll
+)
+
+add_library($${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
+ly_add_target_files(TARGETS $${TARGET_WITH_NAMESPACE} OUTPUT_SUBDIRECTORY $${output_subfolder} FILES $${$${MY_NAME}_RUNTIME_DEPENDENCIES})
+
+set($${MY_NAME}_FOUND True)

+ 11 - 0
package-system/azslc/build_azslc_linux.sh

@@ -0,0 +1,11 @@
+#!/bin/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
+
+cd temp/src
+
+# Call the build and test script 
+python3 test.and.py

+ 11 - 0
package-system/azslc/build_azslc_mac.sh

@@ -0,0 +1,11 @@
+#!/bin/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
+
+cd temp/src
+
+# Call the build and test script 
+python3 test.and.py

+ 23 - 0
package-system/azslc/build_azslc_windows.cmd

@@ -0,0 +1,23 @@
+@echo off
+
+REM Copyright (c) Contributors to the Open 3D Engine Project.
+REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
+REM
+REM SPDX-License-Identifier: Apache-2.0 OR MIT
+
+
+
+SET SRC_PATH=temp\src
+
+cd %SRC_PATH%
+
+REM Call the build and test script
+call python test.and.py
+
+IF %ERRORLEVEL% NEQ 0 (
+    cd ..
+    exit /b 1
+) ELSE (
+    cd ..
+    exit /b 0
+)

+ 45 - 0
package-system/azslc/build_config.json

@@ -0,0 +1,45 @@
+{
+   "git_url":"https://github.com/o3de/o3de-azslc.git",
+   "git_tag":"1.7.23",
+   "package_name":"azslc",
+   "package_version":"1.7.23-rev2",
+   "package_url":"https://github.com/o3de/o3de-azslc",
+   "package_license":"CUSTOM",
+   "package_license_file":"LICENSE.txt",
+   "cmake_find_target":"Findazslc.cmake",
+   "Platforms":{
+      "Windows":{
+         "Windows":{
+            "cmake_find_template":"Findazslc.cmake.Windows",
+            "custom_build_cmd": [
+               "build_azslc_windows.cmd"
+            ],
+            "custom_install_cmd": [
+               "install_azslc_windows.cmd"
+            ]
+         }
+      },
+      "Darwin":{
+         "Mac":{
+            "cmake_find_template":"Findazslc.cmake.Mac",
+            "custom_build_cmd": [
+               "./build_azslc_mac.sh"
+            ],
+            "custom_install_cmd": [
+               "./install_azslc_mac.sh"
+            ]
+         }
+      },
+      "Linux":{
+         "Linux":{
+            "cmake_find_template":"Findazslc.cmake.Linux",
+            "custom_build_cmd": [
+               "./build_azslc_linux.sh"
+            ],
+            "custom_install_cmd": [
+               "./install_azslc_linux.sh"
+            ]
+         }
+      }
+   }
+}

+ 25 - 0
package-system/azslc/install_azslc_linux.sh

@@ -0,0 +1,25 @@
+#!/bin/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
+
+
+
+BIN_PATH=$TARGET_INSTALL_ROOT/bin
+
+SRC_PATH=temp/src
+
+mkdir -p $BIN_PATH
+
+cp -f $SRC_PATH/README.md $TARGET_INSTALL_ROOT/
+cp -f $SRC_PATH/LICENSE_APACHE2.TXT $TARGET_INSTALL_ROOT/
+cp -f $SRC_PATH/LICENSE_MIT.TXT $TARGET_INSTALL_ROOT/
+
+
+mkdir -p $BIN_PATH/Release
+
+cp -f $SRC_PATH/build/release/azslc $BIN_PATH/Release/
+
+exit 0

+ 25 - 0
package-system/azslc/install_azslc_mac.sh

@@ -0,0 +1,25 @@
+#!/bin/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
+
+
+
+BIN_PATH=$TARGET_INSTALL_ROOT/bin
+
+SRC_PATH=temp/src
+
+mkdir -p $BIN_PATH
+
+cp -f $SRC_PATH/README.md $TARGET_INSTALL_ROOT/
+cp -f $SRC_PATH/LICENSE_APACHE2.TXT $TARGET_INSTALL_ROOT/
+cp -f $SRC_PATH/LICENSE_MIT.TXT $TARGET_INSTALL_ROOT/
+
+
+mkdir -p $BIN_PATH/Release
+
+cp -f $SRC_PATH/build/release/azslc $BIN_PATH/Release/
+
+exit 0

+ 29 - 0
package-system/azslc/install_azslc_windows.cmd

@@ -0,0 +1,29 @@
+@echo off
+
+REM
+REM  All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
+REM  its licensors.
+REM
+REM  For complete copyright and license terms please see the LICENSE at the root of this
+REM  distribution (the "License"). All use of this software is governed by the License,
+REM  or, if provided, by the license below or the license accompanying this file. Do not
+REM  remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
+REM  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM
+
+SET BIN_PATH=%TARGET_INSTALL_ROOT%\bin
+
+SET SRC_PATH=temp\src
+
+mkdir %BIN_PATH%
+
+copy /Y %SRC_PATH%\README.md %TARGET_INSTALL_ROOT%\
+copy /Y %SRC_PATH%\LICENSE_APACHE2.TXT %TARGET_INSTALL_ROOT%\
+copy /Y %SRC_PATH%\LICENSE_MIT.TXT %TARGET_INSTALL_ROOT%\
+
+mkdir %BIN_PATH%\Release
+
+copy /Y %SRC_PATH%\build\win_x64\Release\azslc.exe %BIN_PATH%\Release\
+copy /Y %SRC_PATH%\build\win_x64\Release\boost_regex-vc142-mt-x64-1_70.dll %BIN_PATH%\Release\
+
+exit /b 0

+ 2 - 1
package_build_list_host_darwin.json

@@ -28,6 +28,7 @@
         "v-hacd-2.3-1a49edf-rev1-mac": "package-system/v-hacd/build_package_image.py --platform-name mac",
         "SPIRVCross-2021.04.29-rev1-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Mac --package-root ../../package-system --clean",
         "DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Mac --package-root ../../package-system --clean",
+        "azslc-1.7.23-rev2-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Mac --package-root ../../package-system --clean",
         "tiff-4.2.0.10-mac" : "package-system/tiff/build_package_image.py --platform mac",
         "tiff-4.2.0.10-ios" : "package-system/tiff/build_package_image.py --platform ios",
         "python-3.7.10-rev1-darwin" : "package-system/python/build_package_image.py",
@@ -68,7 +69,7 @@
         "mcpp-2.7.2_az.1-rev1-mac": "package-system/mcpp-mac",
         "SPIRVCross-2021.04.29-rev1-mac": "package-system/SPIRVCross-mac",
         "DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-mac": "package-system/DirectXShaderCompilerDxc-mac",
-        "azslc-1.7.23-rev1-multiplatform" : "package-system/azslc-multiplatform",
+        "azslc-1.7.23-rev2-mac": "package-system/azslc-mac",
         "SQLite-3.32.2-rev3-multiplatform" : "package-system/SQLite-multiplatform",
         "xxhash-0.7.4-rev1-multiplatform":  "package-system/xxhash-multiplatform",
         "qt-5.15.2-rev5-mac": "package-system/qt-mac"

+ 2 - 0
package_build_list_host_linux.json

@@ -20,6 +20,7 @@
         "v-hacd-2.3-1a49edf-rev1-linux": "package-system/v-hacd/build_package_image.py --platform-name linux",
         "SPIRVCross-2021.04.29-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Linux --package-root ../../package-system --clean",
         "DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Linux --package-root ../../package-system --clean",
+        "azslc-1.7.23-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Linux --package-root ../../package-system --clean",
         "tiff-4.2.0.10-linux" : "package-system/tiff/build_package_image.py --platform linux",
         "python-3.7.10-rev2-linux" : "package-system/python/build_package_image.py",
         "mikkelsen-1.0.0.4-linux": "package-system/mikkelsen/build_package_image.py"
@@ -38,6 +39,7 @@
         "OpenSSL-1.1.1b-rev2-linux": "package-system/OpenSSL-linux",
         "SPIRVCross-2021.04.29-rev1-linux": "package-system/SPIRVCross-linux",
         "DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-linux": "package-system/DirectXShaderCompilerDxc-linux",
+        "azslc-1.7.23-rev2-linux": "package-system/azslc-linux",
         "tiff-4.2.0.10-linux" : "package-system/tiff-linux",
         "python-3.7.10-rev2-linux" : "package-system/python/linux_x64/package",
         "PhysX-4.1.2.29882248-rev3-linux": "package-system/PhysX-linux",

+ 2 - 1
package_build_list_host_windows.json

@@ -26,6 +26,7 @@
         "OpenSSL-1.1.1b-rev1-android": "package-system/OpenSSL/build_package_image.py --platform-name android",
         "SPIRVCross-2021.04.29-rev1-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/SPIRVCross --platform-name Windows --package-root ../../package-system --clean",
         "DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/DirectXShaderCompiler --platform-name Windows --package-root ../../package-system --clean",
+        "azslc-1.7.23-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/azslc --platform-name Windows --package-root ../../package-system --clean",
         "PhysX-4.1.2.29882248-rev3-windows" : "package-system/PhysX/build_package_image.py --platform windows",
         "PhysX-4.1.2.29882248-rev3-android" : "package-system/PhysX/build_package_image.py --platform android",
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-windows": "package-system/NvCloth/build_package_image.py --platform-name windows",
@@ -94,7 +95,7 @@
     "v-hacd-2.3-1a49edf-rev1-windows": "package-system/v-hacd-windows",
     "SPIRVCross-2021.04.29-rev1-windows": "package-system/SPIRVCross-windows",
     "DirectXShaderCompilerDxc-1.6.2104-o3de-rev2-windows": "package-system/DirectXShaderCompilerDxc-windows",
-    "azslc-1.7.23-rev1-multiplatform": "package-system/azslc-multiplatform",
+    "azslc-1.7.23-rev2-windows": "package-system/azslc-windows",
     "zstd-1.35-multiplatform": "package-system/zstd-multiplatform",
     "SQLite-3.32.2-rev3-multiplatform": "package-system/SQLite-multiplatform",
     "glad-2.0.0-beta-rev2-multiplatform": "package-system/glad-multiplatform",