Skip to content

Commit

Permalink
Patch iOS frameworks Info.plst with CFBundleShortVersionString va…
Browse files Browse the repository at this point in the history
…lue (#9)
  • Loading branch information
misl6 authored Feb 17, 2024
1 parent 6a34b0e commit d3e10c1
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/angle_builder/angle.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,25 @@ def _create_macos_dylibs(self, output_artifact_mode: str) -> list:

return [libEGL_dylib_path, libGLESv2_dylib_path]

def _patch_frameworks_plist(self, framework_path: str) -> None:
# The Info.plist file is missing CFBundleShortVersionString which
# is required for the framework to be accepted by the App Store.
# We need to patch the Info.plist file to add the missing key.

self._logger.info("Patching Info.plist files for iphoneos frameworks")

subprocess.run(
[
"plutil",
"-replace",
"CFBundleShortVersionString",
"-string",
"1.0",
os.path.join(framework_path, "Info.plist"),
],
check=True,
)

def _create_iphoneos_frameworks(self, output_artifact_mode: str) -> list:

output_extension = (
Expand Down Expand Up @@ -578,6 +597,23 @@ def build(self, output_artifact_mode: str, output_folder: str) -> None:

for build_target in build_targets:
self._autoninja_build(build_target)
if build_target["name"].startswith("iphone"):
self._patch_frameworks_plist(
os.path.join(
self.angle_path,
"out",
build_target["name"],
"libEGL.framework",
)
)
self._patch_frameworks_plist(
os.path.join(
self.angle_path,
"out",
build_target["name"],
"libGLESv2.framework",
)
)

include_folder_path = os.path.join(self.angle_path, "include")
license_path = os.path.join(self.angle_path, "LICENSE")
Expand Down

0 comments on commit d3e10c1

Please sign in to comment.