From a80c0e021742426b05dca0cfe7b83f01db7e533d Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 5 Aug 2022 08:10:42 +0200 Subject: [PATCH] mbedtls, xz: add missing install_name fixes on macOS (#31919) --- var/spack/repos/builtin/packages/mbedtls/package.py | 5 +++++ var/spack/repos/builtin/packages/xz/package.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/var/spack/repos/builtin/packages/mbedtls/package.py b/var/spack/repos/builtin/packages/mbedtls/package.py index 3d5121ba1f..da5ed25658 100644 --- a/var/spack/repos/builtin/packages/mbedtls/package.py +++ b/var/spack/repos/builtin/packages/mbedtls/package.py @@ -137,3 +137,8 @@ def build(self, spec, prefix): def install(self, spec, prefix): make("install", "DESTDIR={0}".format(prefix)) + + @run_after("install") + def darwin_fix(self): + if self.spec.satisfies("platform=darwin"): + fix_darwin_install_name(self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index f6e2f9f1a2..440e67608a 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -53,3 +53,8 @@ def determine_version(cls, exe): output = Executable(exe)("--version", output=str, error=str) match = re.search(r"xz \(XZ Utils\) (\S+)", output) return match.group(1) if match else None + + @run_after("install") + def darwin_fix(self): + if self.spec.satisfies("platform=darwin"): + fix_darwin_install_name(self.prefix.lib)