From 262d5e67916e7bf8b5d34e8b907e1c5a0932a439 Mon Sep 17 00:00:00 2001 From: Hans Fangohr Date: Thu, 9 Dec 2021 18:44:18 +0100 Subject: New package: dust (#27845) --- var/spack/repos/builtin/packages/dust/package.py | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 var/spack/repos/builtin/packages/dust/package.py diff --git a/var/spack/repos/builtin/packages/dust/package.py b/var/spack/repos/builtin/packages/dust/package.py new file mode 100644 index 0000000000..6835d1917e --- /dev/null +++ b/var/spack/repos/builtin/packages/dust/package.py @@ -0,0 +1,51 @@ +# Copyright 2013-2021 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 import * + + +class Dust(Package): + """du + rust = dust. Like du but more intuitive.""" + + homepage = "https://github.com/bootandy/dust" + url = "https://github.com/bootandy/dust/archive/v0.7.5.tar.gz" + + maintainers = ["fangohr"] + + version( + "0.7.5", + sha256="f892aaf7a0a7852e12d01b2ced6c2484fb6dc5fe7562abdf0c44a2d08aa52618", + ) + + depends_on("rust") + + sanity_check_is_file = [join_path("bin", "dust")] + + def install(self, spec, prefix): + cargo = which("cargo") + cargo("install", "--root", prefix, "--path", ".") + + @run_after("install") + def check_install(self): + print("Attempt to call 'dust' with '--version'") + dust = Executable(join_path(self.spec["dust"].prefix.bin, "dust")) + output = dust( + "--version", + output=str.split, + ) + print("stdout received fromm dust is '{}".format(output)) + assert "Dust " in output + + def test(self): + """Run this smoke test when requested explicitly""" + + dustpath = join_path(self.spec["dust"].prefix.bin, "dust") + options = ["--version"] + purpose = "Check dust can execute (with option '--version')" + expected = ["Dust "] + + self.run_test( + dustpath, options=options, expected=expected, status=[0], purpose=purpose + ) -- cgit v1.2.3-70-g09d2