summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/rust-bindgen/package.py
blob: 0076bb725dacdf6657093b5b4a947f84e77bfa5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 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)

import os

from spack.package import *


class RustBindgen(Package):
    """The rust programming language toolchain"""

    homepage = "https://www.rust-lang.org"
    url = "https://github.com/servo/rust-bindgen/archive/v0.20.5.tar.gz"

    license("BSD-3-Clause")

    version("0.20.5", sha256="4f5236e7979d262c43267afba365612b1008b91b8f81d1efc6a8a2199d52bb37")

    extends("rust")
    depends_on("llvm")

    def install(self, spec, prefix):
        env = dict(os.environ)
        env["LIBCLANG_PATH"] = os.path.join(spec["llvm"].prefix, "lib")
        cargo("install", "--root", prefix, env=env)