1 |
commit: d8168ac771d03175117fe453a1c0f93612a1eb38 |
2 |
Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 29 01:57:55 2020 +0000 |
4 |
Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 29 02:00:46 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8168ac7 |
7 |
|
8 |
eclass/cargo.eclass: move cargo_gen_config definition to the top |
9 |
|
10 |
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> |
11 |
|
12 |
eclass/cargo.eclass | 76 ++++++++++++++++++++++++++--------------------------- |
13 |
1 file changed, 38 insertions(+), 38 deletions(-) |
14 |
|
15 |
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass |
16 |
index bbb3d40a620..e6fec844d27 100644 |
17 |
--- a/eclass/cargo.eclass |
18 |
+++ b/eclass/cargo.eclass |
19 |
@@ -91,6 +91,44 @@ cargo_crate_uris() { |
20 |
done |
21 |
} |
22 |
|
23 |
+# @FUNCTION: cargo_gen_config |
24 |
+# @DESCRIPTION: |
25 |
+# Generate the $CARGO_HOME/config necessary to use our local registry and settings. |
26 |
+# Cargo can also be configured through environment variables in addition to the TOML syntax below. |
27 |
+# For each configuration key below of the form foo.bar the environment variable CARGO_FOO_BAR |
28 |
+# can also be used to define the value. |
29 |
+# Environment variables will take precedent over TOML configuration, |
30 |
+# and currently only integer, boolean, and string keys are supported. |
31 |
+# For example the build.jobs key can also be defined by CARGO_BUILD_JOBS. |
32 |
+# Or setting CARGO_TERM_VERBOSE=false in make.conf will make build quieter. |
33 |
+cargo_gen_config() { |
34 |
+ debug-print-function ${FUNCNAME} "$@" |
35 |
+ |
36 |
+ mkdir -p "${ECARGO_HOME}" || die |
37 |
+ |
38 |
+ cat > "${ECARGO_HOME}/config" <<- _EOF_ || die "Failed to create cargo config" |
39 |
+ [source.gentoo] |
40 |
+ directory = "${ECARGO_VENDOR}" |
41 |
+ |
42 |
+ [source.crates-io] |
43 |
+ replace-with = "gentoo" |
44 |
+ local-registry = "/nonexistant" |
45 |
+ |
46 |
+ [net] |
47 |
+ offline = true |
48 |
+ |
49 |
+ [build] |
50 |
+ jobs = $(makeopts_jobs) |
51 |
+ |
52 |
+ [term] |
53 |
+ verbose = true |
54 |
+ $([[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo "color = 'never'") |
55 |
+ _EOF_ |
56 |
+ |
57 |
+ export CARGO_HOME="${ECARGO_HOME}" |
58 |
+ _CARGO_GEN_CONFIG_HAS_RUN=1 |
59 |
+} |
60 |
+ |
61 |
# @FUNCTION: cargo_src_unpack |
62 |
# @DESCRIPTION: |
63 |
# Unpacks the package and the cargo registry |
64 |
@@ -230,44 +268,6 @@ cargo_live_src_unpack() { |
65 |
cargo_gen_config |
66 |
} |
67 |
|
68 |
-# @FUNCTION: cargo_gen_config |
69 |
-# @DESCRIPTION: |
70 |
-# Generate the $CARGO_HOME/config necessary to use our local registry and settings. |
71 |
-# Cargo can also be configured through environment variables in addition to the TOML syntax below. |
72 |
-# For each configuration key below of the form foo.bar the environment variable CARGO_FOO_BAR |
73 |
-# can also be used to define the value. |
74 |
-# Environment variables will take precedent over TOML configuration, |
75 |
-# and currently only integer, boolean, and string keys are supported. |
76 |
-# For example the build.jobs key can also be defined by CARGO_BUILD_JOBS. |
77 |
-# Or setting CARGO_TERM_VERBOSE=false in make.conf will make build quieter. |
78 |
-cargo_gen_config() { |
79 |
- debug-print-function ${FUNCNAME} "$@" |
80 |
- |
81 |
- mkdir -p "${ECARGO_HOME}" || die |
82 |
- |
83 |
- cat > "${ECARGO_HOME}/config" <<- _EOF_ || die "Failed to create cargo config" |
84 |
- [source.gentoo] |
85 |
- directory = "${ECARGO_VENDOR}" |
86 |
- |
87 |
- [source.crates-io] |
88 |
- replace-with = "gentoo" |
89 |
- local-registry = "/nonexistant" |
90 |
- |
91 |
- [net] |
92 |
- offline = true |
93 |
- |
94 |
- [build] |
95 |
- jobs = $(makeopts_jobs) |
96 |
- |
97 |
- [term] |
98 |
- verbose = true |
99 |
- $([[ "${NOCOLOR}" = true || "${NOCOLOR}" = yes ]] && echo "color = 'never'") |
100 |
- _EOF_ |
101 |
- |
102 |
- export CARGO_HOME="${ECARGO_HOME}" |
103 |
- _CARGO_GEN_CONFIG_HAS_RUN=1 |
104 |
-} |
105 |
- |
106 |
# @FUNCTION: cargo_src_configure |
107 |
# @DESCRIPTION: |
108 |
# Configure cargo package features and arguments. |