Skip to content

Commit

Permalink
update patch file
Browse files Browse the repository at this point in the history
  • Loading branch information
yeatse committed Apr 9, 2024
1 parent bd99585 commit 9b4efdb
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions opencv.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
diff --git a/platforms/ios/Info.plist.in b/platforms/ios/Info.plist.in
index a166934bdf..fa70c29349 100644
index a166934bdf..76ab8fda4f 100644
--- a/platforms/ios/Info.plist.in
+++ b/platforms/ios/Info.plist.in
@@ -2,6 +2,8 @@
@@ -2,6 +2,10 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
+ <key>CFBundleExecutable</key>
+ <string>opencv2</string>
+ <key>MinimumOSVersion</key>
+ <string>100.0</string>
<key>CFBundleName</key>
<string>${OPENCV_APPLE_BUNDLE_NAME}</string>
<key>CFBundleIdentifier</key>
diff --git a/platforms/ios/build_framework.py b/platforms/ios/build_framework.py
index b876812720..efc929bfed 100755
index b876812720..6b05fcbb9e 100755
--- a/platforms/ios/build_framework.py
+++ b/platforms/ios/build_framework.py
@@ -407,7 +407,7 @@ class Builder:
shutil.rmtree(framework_dir)
os.makedirs(framework_dir)

- if self.dynamic:
+ if self.dynamic or builddirs[0].find("iphone") != -1 or builddirs[0].find("vision") != -1:
dstdir = framework_dir
else:
dstdir = os.path.join(framework_dir, "Versions", "A")
@@ -426,6 +426,12 @@ class Builder:
file.write(body)
if self.build_objc_wrapper:
Expand All @@ -28,21 +39,19 @@ index b876812720..efc929bfed 100755
platform_name_map = {
"arm": "armv7-apple-ios",
"arm64": "arm64-apple-ios",
@@ -478,6 +484,35 @@ class Builder:
@@ -456,7 +462,7 @@ class Builder:
execute(lipocmd)

# dynamic framework has different structure, just copy the Plist directly
- if self.dynamic:
+ if self.dynamic or builddirs[0].find("iphone") != -1 or builddirs[0].find("vision") != -1:
resdir = dstdir
shutil.copyfile(self.getInfoPlist(builddirs), os.path.join(resdir, "Info.plist"))
else:
@@ -478,6 +484,24 @@ class Builder:
d = os.path.join(framework_dir, *l[1])
os.symlink(s, d)

+ # Fix build failure on Xcode 15.3
+ root_plist = '''<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict></dict>
+</plist>
+'''
+ root_plist_path = os.path.join(framework_dir, 'Info.plist')
+ with open(root_plist_path, 'w') as root_plist_file:
+ root_plist_file.write(root_plist)
+
+ def mergeModuleHeaders(self, merged_header, module_header):
+ print("Merging module headers:\n\t%s\n\t%s" % (merged_header, module_header))
+ with codecs.open(merged_header, "r", "utf-8") as file:
Expand Down

0 comments on commit 9b4efdb

Please sign in to comment.