Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 637186 Details for
Bug 721936
cargo.eclass: allow configuring crate features (PATCH)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch that allows selecting crate features
cargo-eclass-features.patch (text/plain), 1.76 KB, created by
Jannik Glückert
on 2020-05-09 17:32:39 UTC
(
hide
)
Description:
patch that allows selecting crate features
Filename:
MIME Type:
Creator:
Jannik Glückert
Created:
2020-05-09 17:32:39 UTC
Size:
1.76 KB
patch
obsolete
>diff --git a/cargo.eclass b/cargo.eclass >index 6f7ffdb..5c7c9f4 100644 >--- a/cargo.eclass >+++ b/cargo.eclass >@@ -23,7 +23,7 @@ esac > > inherit multiprocessing > >-EXPORT_FUNCTIONS src_unpack src_compile src_install src_test >+EXPORT_FUNCTIONS src_unpack src_configure src_compile src_install src_test > > IUSE="${IUSE} debug" > >@@ -154,6 +154,24 @@ cargo_gen_config() { > [[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo "color = 'never'" >> "${ECARGO_HOME}/config" > } > >+# @FUNCTION: cargo_feature >+# @DESCRIPTION: >+# Enable a crate feature >+cargo_feature() { >+ if ! [ -z ${1} ]; then >+ CARGO_FEATURES="${1},${CARGO_FEATURES}" >+ fi >+} >+ >+# @FUNCTION: cargo_src_configure >+# @DESCRIPTION: >+# Apply the selected features >+cargo_src_configure() { >+ if ! [ -z "${CARGO_FEATURES}" ]; then >+ CARGO_FEATURES="--no-default-features --features ${CARGO_FEATURES}" >+ fi >+} >+ > # @FUNCTION: cargo_src_compile > # @DESCRIPTION: > # Build the package using cargo build >@@ -162,7 +180,7 @@ cargo_src_compile() { > > export CARGO_HOME="${ECARGO_HOME}" > >- cargo build $(usex debug "" --release) "$@" \ >+ cargo build $(usex debug "" --release) ${CARGO_FEATURES} "$@" \ > || die "cargo build failed" > } > >@@ -173,7 +191,7 @@ cargo_src_install() { > debug-print-function ${FUNCNAME} "$@" > > cargo install --path ${CARGO_INSTALL_PATH} \ >- --root="${ED}/usr" $(usex debug --debug "") "$@" \ >+ --root="${ED}/usr" $(usex debug --debug "") ${CARGO_FEATURES} "$@" \ > || die "cargo install failed" > rm -f "${ED}/usr/.crates.toml" > rm -f "${ED}/usr/.crates2.json" >@@ -187,7 +205,7 @@ cargo_src_install() { > cargo_src_test() { > debug-print-function ${FUNCNAME} "$@" > >- cargo test $(usex debug "" --release) "$@" \ >+ cargo test $(usex debug "" --release) ${CARGO_FEATURES} "$@" \ > || die "cargo test failed" > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 721936
: 637186