diff options
author | Alec Scott <hi@alecbcs.com> | 2023-11-27 13:15:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-27 20:15:16 +0000 |
commit | c482534c1d3168da8053c4c47a203da300054a71 (patch) | |
tree | 9973729cb6a5a4b15ccd1fd0ffcd98e3301231a1 /var | |
parent | fbec91e491776717c72a61f2791473e9c19e6af6 (diff) | |
download | spack-c482534c1d3168da8053c4c47a203da300054a71.tar.gz spack-c482534c1d3168da8053c4c47a203da300054a71.tar.bz2 spack-c482534c1d3168da8053c4c47a203da300054a71.tar.xz spack-c482534c1d3168da8053c4c47a203da300054a71.zip |
CargoPackage: add new build system for Cargo packages (#41192)
Co-authored-by: Tom Scogland <scogland1@llnl.gov>
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/exa/package.py | 25 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/eza/package.py | 19 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/rust/package.py | 3 |
3 files changed, 37 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/exa/package.py b/var/spack/repos/builtin/packages/exa/package.py index 8488f3b3a1..21be99414a 100644 --- a/var/spack/repos/builtin/packages/exa/package.py +++ b/var/spack/repos/builtin/packages/exa/package.py @@ -6,17 +6,22 @@ from spack.package import * -class Exa(Package): - """exa is a replacement for ls written in Rust.""" +class Exa(CargoPackage): + """DEPRECATED: The exa upstream is no longer maintained, see the eza package for a + replacement. + + exa is a replacement for ls written in Rust.""" homepage = "https://the.exa.website" url = "https://github.com/ogham/exa/archive/v0.9.0.tar.gz" - version("0.10.1", sha256="ff0fa0bfc4edef8bdbbb3cabe6fdbd5481a71abbbcc2159f402dea515353ae7c") - version("0.9.0", sha256="96e743ffac0512a278de9ca3277183536ee8b691a46ff200ec27e28108fef783") - - depends_on("rust") - - def install(self, spec, prefix): - cargo = which("cargo") - cargo("install", "--root", prefix, "--path", ".") + version( + "0.10.1", + sha256="ff0fa0bfc4edef8bdbbb3cabe6fdbd5481a71abbbcc2159f402dea515353ae7c", + deprecated=True, + ) + version( + "0.9.0", + sha256="96e743ffac0512a278de9ca3277183536ee8b691a46ff200ec27e28108fef783", + deprecated=True, + ) diff --git a/var/spack/repos/builtin/packages/eza/package.py b/var/spack/repos/builtin/packages/eza/package.py new file mode 100644 index 0000000000..df9dd5aa8b --- /dev/null +++ b/var/spack/repos/builtin/packages/eza/package.py @@ -0,0 +1,19 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack.package import * + + +class Eza(CargoPackage): + """A modern, maintained replacement for ls.""" + + homepage = "https://github.com/eza-community/eza" + url = "https://github.com/eza-community/eza/archive/refs/tags/v0.15.3.tar.gz" + + maintainers("trws") + + license("MIT") + + version("0.15.3", sha256="09093e565913104acb7a8eba974f8067c95566b6fbedf31138c9923a8cfde42f") diff --git a/var/spack/repos/builtin/packages/rust/package.py b/var/spack/repos/builtin/packages/rust/package.py index 8d0784d95a..a9b7a7530f 100644 --- a/var/spack/repos/builtin/packages/rust/package.py +++ b/var/spack/repos/builtin/packages/rust/package.py @@ -89,6 +89,9 @@ class Rust(Package): match = re.match(r"rustc (\S+)", output) return match.group(1) if match else None + def setup_dependent_package(self, module, dependent_spec): + module.cargo = Executable(os.path.join(self.spec.prefix.bin, "cargo")) + def setup_build_environment(self, env): # Manually inject the path of ar for build. ar = which("ar", required=True) |