From 4a01af171804d1760fbf7604e542c146236fc2dc Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Tue, 28 Oct 2014 00:38:14 +0100 Subject: [PATCH] Copy Info.plist from Contents/ to Resources/ in CopyFramework --- admin/mac/macdeploy.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/admin/mac/macdeploy.py b/admin/mac/macdeploy.py index 194b36b71..5648a225d 100755 --- a/admin/mac/macdeploy.py +++ b/admin/mac/macdeploy.py @@ -457,9 +457,24 @@ def CopyFramework(path): menu_nib = os.path.join(os.path.split(path)[0], 'Resources', 'qt_menu.nib') if os.path.exists(menu_nib): - args = ['cp', '-r', menu_nib, resources_dir] + args = ['cp', '-rf', menu_nib, resources_dir] commands.append(args) + # Copy Contents/Info.plist to Resources/Info.plist if Resources/Info.plist does not exist + # If Contents/Info.plist doesn't exist either, error out. If we actually see this, we can copy QtCore's Info.plist + info_plist_in_resources = os.path.join(os.path.split(path)[0], '..', '..', 'Resources', 'Info.plist') + if not os.path.exists(info_plist_in_resources): + info_plist_in_contents = os.path.join(os.path.split(path)[0], '..', '..', 'Contents', 'Info.plist') + framework_resources_dir = os.path.join(full_path, '..', '..', 'Resources') + args = ['mkdir', '-p', framework_resources_dir] + commands.append(args) + if os.path.exists(info_plist_in_contents): + args = ['cp', '-rf', info_plist_in_contents, framework_resources_dir] + commands.append(args) + else: + print "%s: Framework does not contain an Info.plist file in Contents/ or Resources/ folder." % (path) + sys.exit(-1) + return os.path.join(full_path, parts[-1]) def FixId(path, library_name):