Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch iOS frameworks Info.plst with CFBundleShortVersionString value #9

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading