Replace rpath to remove if possible #98

Merged
merged 1 commit into from Nov 10, 2016

Replace rpath to remove if possible

If the rpath to remove is available, replace it with an rpath
that is to be added to the target file. This prevents errors as
seen with the curl library where simply adding and removing rpaths
would cause a command load error within the library.
commit e1867522e888f861f1de321550aec3f8fc6d47a8 @chrisroberts chrisroberts committed Nov 7, 2016
@@ -25,6 +25,11 @@
{ target_file_path => $target_file_path }
)
+ exec { "change-${name}-rpath":
+ command => "install_name_tool -rpath ${remove_rpath} ${add_rpath[0]} ${target_file_path}",
+ onlyif => "otool -l ${target_file_path} | grep 'path ${remove_rpath}'"
+ }
+
$add_rpath_stringify = join($add_rpath, "<${target_file_path}>,")
$hacky_add_rpath = split("${add_rpath_stringify}<${target_file_path}>", ",")
vagrant_substrate::staging::darwin_add_rpath { $hacky_add_rpath: