diff options
author | Bertrand Jacquin <bertrand@jacquin.bzh> | 2022-12-13 01:02:50 +0000 |
---|---|---|
committer | Bertrand Jacquin <bertrand@jacquin.bzh> | 2022-12-20 02:22:44 +0000 |
commit | fa6d7d2e92c57a9e0efe108a5c6ec7d2adace251 (patch) | |
tree | 029e1a55ce67f512c8d439d1e75b47b31642ccfc | |
parent | dev-util/bindgen: new package, add 0.56.0, 0.62.0, 0.63.0 (diff) | |
download | portage-fa6d7d2e92c57a9e0efe108a5c6ec7d2adace251.tar.xz |
eclass/linux-build: add support for rust
-rw-r--r-- | eclass/linux-build.eclass | 17 | ||||
-rw-r--r-- | profiles/use.local.desc | 2 | ||||
-rw-r--r-- | sys-kernel/longterm-sources/metadata.xml | 1 | ||||
-rw-r--r-- | sys-kernel/stable-sources/metadata.xml | 1 |
4 files changed, 19 insertions, 2 deletions
diff --git a/eclass/linux-build.eclass b/eclass/linux-build.eclass index 7682fda0..85c73a12 100644 --- a/eclass/linux-build.eclass +++ b/eclass/linux-build.eclass @@ -40,8 +40,9 @@ BUILDDIR="${WORKDIR}/build" KV_EXTRA="${EXTRAVERSION}" S="${SRCDIR}" -IUSE="build llvm source" -REQUIRED_USE="symlink? ( source )" +IUSE="build llvm rust source" +REQUIRED_USE="symlink? ( source ) + rust? ( llvm )" BDEPEND="${BDEPEND} sys-devel/bc @@ -52,6 +53,10 @@ BDEPEND="${BDEPEND} sys-devel/clang:= sys-devel/llvm:= sys-devel/lld:= + ) + rust? ( + dev-lang/rust:=[rust-src] + <=dev-util/bindgen-0.62.0 )" DEPEND="${DEPEND} sys-apps/kmod" @@ -580,6 +585,14 @@ linux-build_src_prepare() { ) fi + if use rust ; then + copt+=( + HOSTRUSTC=rustc + RUSTC=rustc + BINDGEN=bindgen + ) + fi + copt+=( PKG_CONFIG="$(tc-getPKG_CONFIG)" PYTHON3="${PYTHON}" diff --git a/profiles/use.local.desc b/profiles/use.local.desc index 3f7fdd82..48a42107 100644 --- a/profiles/use.local.desc +++ b/profiles/use.local.desc @@ -12,7 +12,9 @@ net-p2p/dogecoin:utils - Build the utils net-p2p/dogecoin:wallet - Enable wallet support sys-firmware/gnuk:tools - Install aditional tools sys-kernel/longterm-sources:llvm - Build with Clang/LLVM +sys-kernel/longterm-sources:rust - Build with rust support sys-kernel/stable-sources:llvm - Build with Clang/LLVM +sys-kernel/stable-sources:rust - Build with rust support virtual/linux-sources:firmware - Install linux kernel firmware www-client/arcanist:lint - Support for linter www-client/arcanist:mercurial - Support for dev-vcs/mercurial diff --git a/sys-kernel/longterm-sources/metadata.xml b/sys-kernel/longterm-sources/metadata.xml index f0e73364..96de2386 100644 --- a/sys-kernel/longterm-sources/metadata.xml +++ b/sys-kernel/longterm-sources/metadata.xml @@ -7,5 +7,6 @@ </maintainer> <use> <flag name="llvm">Build with Clang/LLVM</flag> + <flag name="rust">Build with rust support</flag> </use> </pkgmetadata> diff --git a/sys-kernel/stable-sources/metadata.xml b/sys-kernel/stable-sources/metadata.xml index f0e73364..96de2386 100644 --- a/sys-kernel/stable-sources/metadata.xml +++ b/sys-kernel/stable-sources/metadata.xml @@ -7,5 +7,6 @@ </maintainer> <use> <flag name="llvm">Build with Clang/LLVM</flag> + <flag name="rust">Build with rust support</flag> </use> </pkgmetadata> |