expect: fix darwin install name (#13042)

* expect: fix darwin install name

* Fix expect binary as well
This commit is contained in:
Adam J. Stewart 2019-10-05 20:37:44 -05:00 committed by GitHub
parent e78ca66087
commit 608f732101
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,3 +58,15 @@ def symlink_library(self):
link_name = join_path(self.prefix.lib, link_name) link_name = join_path(self.prefix.lib, link_name)
symlink(target, link_name) symlink(target, link_name)
@run_after('install')
def darwin_fix(self):
# The shared library is not installed correctly on Darwin; fix this
if self.spec.satisfies('platform=darwin'):
fix_darwin_install_name(
join_path(self.prefix.lib, 'expect{0}'.format(self.version)))
old = 'libexpect{0}.dylib'.format(self.version)
new = glob.glob(join_path(self.prefix.lib, 'expect*', 'libexpect*'))[0]
install_name_tool = Executable('install_name_tool')
install_name_tool('-change', old, new, self.prefix.bin.expect)