From c87f37997bc165a94dc23df607716d915c19b096 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 30 Jan 2012 11:03:09 -0800 Subject: [PATCH] Use install_name_tool to make webkit embedable --- Rakefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Rakefile b/Rakefile index 53eb20bd6..d2c5e3544 100644 --- a/Rakefile +++ b/Rakefile @@ -28,6 +28,22 @@ task :install do cp_r "Cocoa/build/Debug/Atomicity.app /Applications" end +desc "Change webkit frameworks to use @rpath as install name" +task :"webkit-fix" do + for framework in FileList["frameworks/*.framework"] + name = framework[/\/([^.]+)/, 1] + executable = framework + "/" + name + + `install_name_tool -id @rpath/#{name}.framework/Versions/A/#{name} #{executable}` + + libs = `otool -L #{executable}` + for name in ["JavaScriptCore", "WebKit", "WebCore"] + _, path, suffix = *libs.match(/\t(\S+(#{name}.framework\S+))/i) + `install_name_tool -change #{path} @rpath/../Frameworks/#{suffix} #{executable}` if path + end + end +end + desc "Remove any 'fit' or 'fdescribe' focus directives from the specs" task :nof do system %{find . -name *spec.coffee | xargs sed -E -i "" "s/f(it|describe) +(['\\"])/\\1 \\2/g"}