From 608f7321016d5a9937930d3163fdef9af0a194af Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 5 Oct 2019 20:37:44 -0500 Subject: expect: fix darwin install name (#13042) * expect: fix darwin install name * Fix expect binary as well --- var/spack/repos/builtin/packages/expect/package.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/var/spack/repos/builtin/packages/expect/package.py b/var/spack/repos/builtin/packages/expect/package.py index 01becf4b3f..1c431e9d99 100644 --- a/var/spack/repos/builtin/packages/expect/package.py +++ b/var/spack/repos/builtin/packages/expect/package.py @@ -58,3 +58,15 @@ class Expect(AutotoolsPackage): link_name = join_path(self.prefix.lib, 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) -- cgit v1.2.3-70-g09d2