mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 11:07:44 +00:00
build: create group features for target systems
This allows a user to create builds with or without the Unix-specific utilities. Right now the Makefile handles this, but this is needed to migrate away from make. To build Unix-specific utilities (default): cargo build (or) cargo build --features unix --no-default-features To build without the Unix-specific utilities: cargo build --features generic --no-default-features
This commit is contained in:
parent
b46050460e
commit
a8bb7f4417
2 changed files with 79 additions and 80 deletions
48
Cargo.toml
48
Cargo.toml
|
@ -4,21 +4,39 @@ version = "0.0.1"
|
||||||
authors = []
|
authors = []
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["all"]
|
unix = [
|
||||||
all = [
|
"chroot",
|
||||||
|
"du",
|
||||||
|
"groups",
|
||||||
|
"hostid",
|
||||||
|
"hostname",
|
||||||
|
"id",
|
||||||
|
"kill",
|
||||||
|
"logname",
|
||||||
|
"mkfifo",
|
||||||
|
"mv",
|
||||||
|
"nice",
|
||||||
|
"nohup",
|
||||||
|
"stdbuf",
|
||||||
|
"timeout",
|
||||||
|
"touch",
|
||||||
|
"tty",
|
||||||
|
"uname",
|
||||||
|
"unlink",
|
||||||
|
"uptime",
|
||||||
|
"users",
|
||||||
|
]
|
||||||
|
generic = [
|
||||||
"base64",
|
"base64",
|
||||||
"basename",
|
"basename",
|
||||||
"cat",
|
"cat",
|
||||||
"chmod",
|
"chmod",
|
||||||
"chroot",
|
|
||||||
"cksum",
|
"cksum",
|
||||||
"comm",
|
"comm",
|
||||||
"cp",
|
"cp",
|
||||||
"cut",
|
"cut",
|
||||||
"dirname",
|
"dirname",
|
||||||
"du",
|
|
||||||
"echo",
|
"echo",
|
||||||
"env",
|
"env",
|
||||||
"expand",
|
"expand",
|
||||||
|
@ -27,22 +45,12 @@ all = [
|
||||||
"false",
|
"false",
|
||||||
"fmt",
|
"fmt",
|
||||||
"fold",
|
"fold",
|
||||||
"groups",
|
|
||||||
"hashsum",
|
"hashsum",
|
||||||
"head",
|
"head",
|
||||||
"hostid",
|
|
||||||
"hostname",
|
|
||||||
"id",
|
|
||||||
"kill",
|
|
||||||
"link",
|
"link",
|
||||||
"ln",
|
"ln",
|
||||||
"logname",
|
|
||||||
"mkdir",
|
"mkdir",
|
||||||
"mkfifo",
|
|
||||||
"mv",
|
|
||||||
"nice",
|
|
||||||
"nl",
|
"nl",
|
||||||
"nohup",
|
|
||||||
"nproc",
|
"nproc",
|
||||||
"od",
|
"od",
|
||||||
"paste",
|
"paste",
|
||||||
|
@ -59,30 +67,23 @@ all = [
|
||||||
"sleep",
|
"sleep",
|
||||||
"sort",
|
"sort",
|
||||||
"split",
|
"split",
|
||||||
"stdbuf",
|
|
||||||
"sum",
|
"sum",
|
||||||
"sync",
|
"sync",
|
||||||
"tac",
|
"tac",
|
||||||
"tail",
|
"tail",
|
||||||
"tee",
|
"tee",
|
||||||
"test",
|
"test",
|
||||||
"timeout",
|
|
||||||
"touch",
|
|
||||||
"tr",
|
"tr",
|
||||||
"true",
|
"true",
|
||||||
"truncate",
|
"truncate",
|
||||||
"tsort",
|
"tsort",
|
||||||
"tty",
|
|
||||||
"uname",
|
|
||||||
"unexpand",
|
"unexpand",
|
||||||
"uniq",
|
"uniq",
|
||||||
"unlink",
|
|
||||||
"uptime",
|
|
||||||
"users",
|
|
||||||
"wc",
|
"wc",
|
||||||
"whoami",
|
"whoami",
|
||||||
"yes",
|
"yes",
|
||||||
]
|
]
|
||||||
|
default = ["generic", "unix"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
uucore = { path="src/uucore" }
|
uucore = { path="src/uucore" }
|
||||||
|
@ -178,4 +179,3 @@ tempdir="*"
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name="uutils"
|
name="uutils"
|
||||||
path="src/uutils/uutils.rs"
|
path="src/uutils/uutils.rs"
|
||||||
|
|
||||||
|
|
3
build.rs
3
build.rs
|
@ -12,8 +12,7 @@ pub fn main() {
|
||||||
if val == "1" && key.starts_with(feature_prefix) {
|
if val == "1" && key.starts_with(feature_prefix) {
|
||||||
let krate = key[feature_prefix.len()..].to_lowercase();
|
let krate = key[feature_prefix.len()..].to_lowercase();
|
||||||
match krate.as_ref() {
|
match krate.as_ref() {
|
||||||
"default" => continue,
|
"default" | "unix" | "generic" => continue,
|
||||||
"all" => continue,
|
|
||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
crates.push(krate.to_string());
|
crates.push(krate.to_string());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue