diff options
author | Harmen Stoppels <me@harmenstoppels.nl> | 2024-12-04 11:28:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-04 02:28:19 -0800 |
commit | 16fd77f9da7e3865ed4e22f7a9bf1d3b0b048006 (patch) | |
tree | 8c99b6b6efca4eb9aee8d1ae756248e75996f59e /var | |
parent | f82554a39ba3faa264741d15f4608654d42d1626 (diff) | |
download | spack-16fd77f9da7e3865ed4e22f7a9bf1d3b0b048006.tar.gz spack-16fd77f9da7e3865ed4e22f7a9bf1d3b0b048006.tar.bz2 spack-16fd77f9da7e3865ed4e22f7a9bf1d3b0b048006.tar.xz spack-16fd77f9da7e3865ed4e22f7a9bf1d3b0b048006.zip |
rust-bootstrap: fix zlib dependency (#47894)
x
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/rust-bootstrap/package.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/rust-bootstrap/package.py b/var/spack/repos/builtin/packages/rust-bootstrap/package.py index 73d6de1223..1603c9e853 100644 --- a/var/spack/repos/builtin/packages/rust-bootstrap/package.py +++ b/var/spack/repos/builtin/packages/rust-bootstrap/package.py @@ -133,6 +133,12 @@ class RustBootstrap(Package): if os in rust_releases[release] and target in rust_releases[release][os]: version(release, sha256=rust_releases[release][os][target]) + # rust-ldd and libLLVM both depend on zlib, which is not vendored. + depends_on("zlib-api") + depends_on("zlib-ng +shared", when="^[virtuals=zlib-api] zlib-ng") + depends_on("zlib +shared", when="^[virtuals=zlib-api] zlib") + depends_on("patchelf@0.13:", when="platform=linux", type="build") + def url_for_version(self, version): if self.os not in ("linux", "darwin"): return None @@ -151,6 +157,15 @@ class RustBootstrap(Package): url = "https://static.rust-lang.org/dist/rust-{0}-{1}-{2}.tar.gz" return url.format(version, target, os) + @run_before("install", when="platform=linux") + def fixup_rpaths(self): + # set rpaths of libLLVM.so and rust-ldd to zlib's lib directory + rpaths = self.spec["zlib-api"].libs.directories + + for binary in find(self.stage.source_path, ["libLLVM.so.*", "rust-lld"]): + patchelf = Executable("patchelf") + patchelf("--add-rpath", ":".join(rpaths), binary) + def install(self, spec, prefix): install_script = Executable("./install.sh") install_args = [f"--prefix={prefix}", "--without=rust-docs"] |