summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-11-05 23:49:24 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2012-11-06 00:06:16 +0100
commita20c9576be916f8e0bad66bd474c5241d05852e4 (patch)
tree9589e117a332af661c95b2f9ad52e3a3105f049d
parent3043690756f5bd2e220e5457f835237869f33001 (diff)
downloadmpv-a20c9576be916f8e0bad66bd474c5241d05852e4.tar.bz2
mpv-a20c9576be916f8e0bad66bd474c5241d05852e4.tar.xz
osxbundle: run install_name_tool -id only on direct dependencies
It looks like that only `install_name_tool -change` must be applied recursively. This allows to bundle up all our stuff without thinkering with the Mach-O headerpad size (which could even be impossible for libraries we don't compile and link ourselves).
-rwxr-xr-xTOOLS/osxbundle.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/TOOLS/osxbundle.py b/TOOLS/osxbundle.py
index 9f2f29d88b..d0c4b7e62b 100755
--- a/TOOLS/osxbundle.py
+++ b/TOOLS/osxbundle.py
@@ -50,30 +50,29 @@ def copy_bundle():
def copy_binary():
shutil.copy(binary_name, target_binary())
-def run_install_name_tool(target_file, dylib_path, destination_directory):
+def run_install_name_tool(target_file, dylib_path, dest_dir, root=True):
new_dylib_path = os.path.join("@executable_path", "lib",
os.path.basename(dylib_path))
sh("install_name_tool -change %s %s %s" % \
(dylib_path, new_dylib_path, target_file))
- sh("install_name_tool -id %s %s" % \
- (new_dylib_path, os.path.join(destination_directory,
- os.path.basename(dylib_path))))
+ if root:
+ sh("install_name_tool -id %s %s" % \
+ (new_dylib_path, os.path.join(dest_dir,
+ os.path.basename(dylib_path))))
-def cp_dylibs(target_file, destination_directory):
+def cp_dylibs(target_file, dest_dir):
for dylib_path in user_dylib_lst(target_file):
- dylib_destination_path = os.path.join(destination_directory,
- os.path.basename(dylib_path))
- shutil.copy(dylib_path, dylib_destination_path)
- os.chmod(dylib_destination_path, 0o755)
- cp_dylibs(dylib_destination_path, destination_directory)
+ dylib_dest_path = os.path.join(dest_dir, os.path.basename(dylib_path))
+ shutil.copy(dylib_path, dylib_dest_path)
+ os.chmod(dylib_dest_path, 0o755)
+ cp_dylibs(dylib_dest_path, dest_dir)
-def fix_dylibs_paths(target_file, destination_directory):
+def fix_dylibs_paths(target_file, dest_dir, root=True):
for dylib_path in user_dylib_lst(target_file):
- dylib_destination_path = os.path.join(destination_directory,
- os.path.basename(dylib_path))
- run_install_name_tool(target_file, dylib_path, destination_directory)
- fix_dylibs_paths(dylib_destination_path, destination_directory)
+ dylib_dest_path = os.path.join(dest_dir, os.path.basename(dylib_path))
+ run_install_name_tool(target_file, dylib_path, dest_dir, root)
+ fix_dylibs_paths(dylib_dest_path, dest_dir, False)
def apply_plist_template(plist_file, version):
sh("sed -i -e 's/{{VERSION}}/%s/g' %s" % (version, plist_file))