Skip to content

Commit

Permalink
Refs #12719. Use system libraries where appropriate.
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsteve committed Jun 17, 2015
1 parent f62992c commit 7f222a7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Code/Mantid/MantidPlot/make_package.rb.in
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,34 @@ if( "@MAKE_VATES@" == "ON" )
`install_name_tool -id @rpath/#{filename_no_dir} Contents/Libraries/#{filename_no_dir}`
end
`install_name_tool -add_rpath @loader_path/../Libraries #{library} > /dev/null 2>&1`
`install_name_tool -add_rpath @loader_path/../MacOS #{library} > /dev/null 2>&1`
`install_name_tool -change #{filename} @rpath/#{filename_no_dir} #{library}`
end
end
end
p "fixed #{issues_found} issues this iteration!"
break if issues_found == 0
end

#use install_name_tool to change dependencies form /usr/local to libraries in the package.
search_patterns = ["Contents/Libraries/*.dylib"]
search_patterns.each do |pattern|
Dir[pattern].each do |library|
dependencies = `otool -L #{library}`
dependencies.split("\n").each do |dependency|
currentname = dependency.strip.split(" ")
name_split_on_slash = currentname[0].strip.split("/")
name_split_on_period = name_split_on_slash[-1].split(".")
prefix = name_split_on_period[0]+"."
library_filenames.each do |filename|
basename = File.basename(filename,"dylib")
if prefix == basename
`install_name_tool -change #{currentname[0]} @rpath/#{basename+"dylib"} #{library}`
end
end
end
end
end
end

#We'll use macdeployqt to fix qt dependencies.
Expand Down

0 comments on commit 7f222a7

Please sign in to comment.