Преглед изворни кода

Add OpenEXRpackage list build host for darwin and linux. Refactor pull_and_build_from_git script.

Signed-off-by: hershey5045 <[email protected]>
hershey5045 пре 3 година
родитељ
комит
7bbaeea9bd

+ 10 - 8
Scripts/extras/pull_and_build_from_git.py

@@ -70,6 +70,7 @@ The following keys can exist at the root level or the target-platform level:
                             platforms and configurations.
                             platforms and configurations.
                             The final args will be (cmake_build_args || cmake_build_args_CONFIG) + cmake_build_args_common
                             The final args will be (cmake_build_args || cmake_build_args_CONFIG) + cmake_build_args_common
                             `cmake --build (build folder) --config config` will automatically be supplied.
                             `cmake --build (build folder) --config config` will automatically be supplied.
+* extra_files_to_copy   : (optional) a list of pairs of files to copy [source, destination]. 
  
  
 The following keys can only exist at the target platform level as they describe the specifics for that platform.
 The following keys can only exist at the target platform level as they describe the specifics for that platform.
 
 
@@ -238,6 +239,7 @@ class PackageInfo(object):
         self.cmake_generate_args_common = _get_value("cmake_generate_args_common", required=False)
         self.cmake_generate_args_common = _get_value("cmake_generate_args_common", required=False)
         self.cmake_build_args_common = _get_value("cmake_build_args_common", required=False)
         self.cmake_build_args_common = _get_value("cmake_build_args_common", required=False)
         self.build_configs = _get_value("build_configs", required=False, default=['Debug', 'Release'])
         self.build_configs = _get_value("build_configs", required=False, default=['Debug', 'Release'])
+        self.extra_files_to_copy = _get_value("extra_files_to_copy", required=False)
         if self.cmake_find_template and self.cmake_find_source:
         if self.cmake_find_template and self.cmake_find_source:
             raise BuildError("Bad build config file. 'cmake_find_template' and 'cmake_find_source' cannot both be set in the configuration.")            
             raise BuildError("Bad build config file. 'cmake_find_template' and 'cmake_find_source' cannot both be set in the configuration.")            
         if not self.cmake_find_template and not self.cmake_find_source:
         if not self.cmake_find_template and not self.cmake_find_source:
@@ -783,14 +785,14 @@ class BuildInfo(object):
         """
         """
         Copies any extra files specified in the build config into the destination folder for packaging.
         Copies any extra files specified in the build config into the destination folder for packaging.
         """
         """
-        extra_files_to_copy = self.platform_config.get('extra_files_to_copy', [])
-
-        for (source, dest) in extra_files_to_copy:
-            print(f"Source file: {self.base_folder / source}, Destination file: {self.package_install_root / dest}")
-            shutil.copy2(
-                self.base_folder / source,
-                self.package_install_root / dest
-            )
+        extra_files_to_copy = self.package_info.extra_files_to_copy
+        if extra_files_to_copy:
+            for (source, dest) in extra_files_to_copy:
+                print(f"Source file: {self.base_folder / source}, Destination file: {self.package_install_root / dest}")
+                shutil.copy2(
+                    self.base_folder / source,
+                    self.package_install_root / dest
+                )
 
 
     def build_for_platform(self):
     def build_for_platform(self):
         """
         """

+ 6 - 12
package-system/OpenEXR/build_config.json

@@ -8,6 +8,9 @@
    "package_license_file":"LICENSE.md",
    "package_license_file":"LICENSE.md",
    "cmake_find_source":"FindOpenEXR.cmake",
    "cmake_find_source":"FindOpenEXR.cmake",
    "cmake_find_target":"FindOpenEXR.cmake",
    "cmake_find_target":"FindOpenEXR.cmake",
+   "extra_files_to_copy": [
+      ["FindImath.cmake", "FindImath.cmake"]
+   ],
    "Platforms":{
    "Platforms":{
       "Windows":{
       "Windows":{
          "Windows":{
          "Windows":{
@@ -26,10 +29,7 @@
             ],
             ],
             "custom_test_cmd" : [
             "custom_test_cmd" : [
                "test_openexr_windows.cmd"
                "test_openexr_windows.cmd"
-            ],
-			"extra_files_to_copy": [
-				["FindImath.cmake", "FindImath.cmake"]
-			]
+            ]
          }
          }
       },
       },
       "Darwin":{
       "Darwin":{
@@ -53,10 +53,7 @@
             ],
             ],
             "custom_test_cmd" : [
             "custom_test_cmd" : [
                "./test_openexr_mac.sh"
                "./test_openexr_mac.sh"
-			],
-			"extra_files_to_copy": [
-				["FindImath.cmake", "FindImath.cmake"]
-			]
+            ]
          }
          }
       },
       },
       "Linux":{
       "Linux":{
@@ -74,10 +71,7 @@
                "-DOPENEXR_BUILD_TOOLS=OFF",
                "-DOPENEXR_BUILD_TOOLS=OFF",
                "-DBUILD_SHARED_LIBS=OFF",
                "-DBUILD_SHARED_LIBS=OFF",
                "-DCMAKE_INSTALL_PREFIX=\"../../openexr-linux/OpenEXR\""
                "-DCMAKE_INSTALL_PREFIX=\"../../openexr-linux/OpenEXR\""
-            ],
-			"extra_files_to_copy": [
-				["FindImath.cmake", "FindImath.cmake"]
-			]
+            ]
          }
          }
       }
       }
    }
    }

+ 2 - 2
package_build_list_host_darwin.json

@@ -24,7 +24,7 @@
         "OpenMesh-8.1-rev3-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Mac --package-root ../../package-system --clean",
         "OpenMesh-8.1-rev3-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Mac --package-root ../../package-system --clean",
         "OpenSSL-1.1.1b-rev2-mac": "package-system/OpenSSL/build_package_image.py",
         "OpenSSL-1.1.1b-rev2-mac": "package-system/OpenSSL/build_package_image.py",
         "OpenSSL-1.1.1b-rev2-ios": "package-system/OpenSSL/build_package_image.py --platform ios",
         "OpenSSL-1.1.1b-rev2-ios": "package-system/OpenSSL/build_package_image.py --platform ios",
-        "ilmbase-2.3.0-rev4-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Mac --package-root ../../package-system --clean",
+        "OpenEXR-3.1.3-rev2-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Mac --package-root ../../package-system --clean",
         "PhysX-4.1.2.29882248-rev5-mac": "package-system/PhysX/build_package_image.py --platform mac",
         "PhysX-4.1.2.29882248-rev5-mac": "package-system/PhysX/build_package_image.py --platform mac",
         "PhysX-4.1.2.29882248-rev5-ios": "package-system/PhysX/build_package_image.py --platform ios",
         "PhysX-4.1.2.29882248-rev5-ios": "package-system/PhysX/build_package_image.py --platform ios",
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-mac": "package-system/NvCloth/build_package_image.py --platform-name mac",
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-mac": "package-system/NvCloth/build_package_image.py --platform-name mac",
@@ -72,7 +72,7 @@
         "OpenMesh-8.1-rev3-mac": "package-system/OpenMesh-mac",
         "OpenMesh-8.1-rev3-mac": "package-system/OpenMesh-mac",
         "OpenSSL-1.1.1b-rev2-mac": "package-system/OpenSSL-mac",
         "OpenSSL-1.1.1b-rev2-mac": "package-system/OpenSSL-mac",
         "OpenSSL-1.1.1b-rev2-ios": "package-system/OpenSSL-ios",
         "OpenSSL-1.1.1b-rev2-ios": "package-system/OpenSSL-ios",
-        "ilmbase-2.3.0-rev4-mac": "package-system/ilmbase-mac",
+        "OpenEXR-3.1.3-rev2-mac": "package-system/OpenEXR-mac",
         "tiff-4.2.0.15-rev3-mac": "package-system/tiff-mac",
         "tiff-4.2.0.15-rev3-mac": "package-system/tiff-mac",
         "tiff-4.2.0.15-rev3-ios": "package-system/tiff-ios",
         "tiff-4.2.0.15-rev3-ios": "package-system/tiff-ios",
         "python-3.7.10-rev1-darwin": "package-system/python/darwin_x64/package",
         "python-3.7.10-rev1-darwin": "package-system/python/darwin_x64/package",

+ 2 - 2
package_build_list_host_linux.json

@@ -18,7 +18,7 @@
         "OpenMesh-8.1-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Linux --package-root ../../package-system --clean",
         "OpenMesh-8.1-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Linux --package-root ../../package-system --clean",
         "OpenSSL-1.1.1b-rev2-linux": "package-system/OpenSSL/build_package_image.py",
         "OpenSSL-1.1.1b-rev2-linux": "package-system/OpenSSL/build_package_image.py",
         "pyside2-5.15.2-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2-qt --platform-name Linux --package-root ../../package-system --clean",
         "pyside2-5.15.2-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2-qt --platform-name Linux --package-root ../../package-system --clean",
-        "ilmbase-2.3.0-rev4-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux --package-root ../../package-system --clean",
+        "OpenEXR-3.1.3-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux --package-root ../../package-system --clean",
         "PhysX-4.1.2.29882248-rev5-linux": "package-system/PhysX/build_package_image.py --platform-name linux",
         "PhysX-4.1.2.29882248-rev5-linux": "package-system/PhysX/build_package_image.py --platform-name linux",
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-linux": "package-system/NvCloth/build_package_image.py --platform-name linux",
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-linux": "package-system/NvCloth/build_package_image.py --platform-name linux",
         "poly2tri-7f0487a-rev1-linux": "package-system/poly2tri/build_package_image.py --platform-name linux",
         "poly2tri-7f0487a-rev1-linux": "package-system/poly2tri/build_package_image.py --platform-name linux",
@@ -53,7 +53,7 @@
         "OpenMesh-8.1-rev3-linux": "package-system/OpenMesh-linux",
         "OpenMesh-8.1-rev3-linux": "package-system/OpenMesh-linux",
         "OpenSSL-1.1.1b-rev2-linux": "package-system/OpenSSL-linux",
         "OpenSSL-1.1.1b-rev2-linux": "package-system/OpenSSL-linux",
         "pyside2-5.15.2-rev2-linux": "package-system/pyside2-linux",
         "pyside2-5.15.2-rev2-linux": "package-system/pyside2-linux",
-        "ilmbase-2.3.0-rev4-linux": "package-system/ilmbase-linux",
+        "OpenEXR-3.1.3-rev2-linux": "package-system/OpenEXR-linux",
         "SPIRVCross-2021.04.29-rev1-linux": "package-system/SPIRVCross-linux",
         "SPIRVCross-2021.04.29-rev1-linux": "package-system/SPIRVCross-linux",
         "squish-ccr-deb557d-rev1-linux": "package-system/squish-ccr-linux",
         "squish-ccr-deb557d-rev1-linux": "package-system/squish-ccr-linux",
         "astc-encoder-3.2-rev2-linux": "package-system/astc-encoder-linux",
         "astc-encoder-3.2-rev2-linux": "package-system/astc-encoder-linux",