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 = []
|
||||
build = "build.rs"
|
||||
|
||||
|
||||
[features]
|
||||
default = ["all"]
|
||||
all = [
|
||||
unix = [
|
||||
"chroot",
|
||||
"du",
|
||||
"groups",
|
||||
"hostid",
|
||||
"hostname",
|
||||
"id",
|
||||
"kill",
|
||||
"logname",
|
||||
"mkfifo",
|
||||
"mv",
|
||||
"nice",
|
||||
"nohup",
|
||||
"stdbuf",
|
||||
"timeout",
|
||||
"touch",
|
||||
"tty",
|
||||
"uname",
|
||||
"unlink",
|
||||
"uptime",
|
||||
"users",
|
||||
]
|
||||
generic = [
|
||||
"base64",
|
||||
"basename",
|
||||
"cat",
|
||||
"chmod",
|
||||
"chroot",
|
||||
"cksum",
|
||||
"comm",
|
||||
"cp",
|
||||
"cut",
|
||||
"dirname",
|
||||
"du",
|
||||
"echo",
|
||||
"env",
|
||||
"expand",
|
||||
|
@ -27,22 +45,12 @@ all = [
|
|||
"false",
|
||||
"fmt",
|
||||
"fold",
|
||||
"groups",
|
||||
"hashsum",
|
||||
"head",
|
||||
"hostid",
|
||||
"hostname",
|
||||
"id",
|
||||
"kill",
|
||||
"link",
|
||||
"ln",
|
||||
"logname",
|
||||
"mkdir",
|
||||
"mkfifo",
|
||||
"mv",
|
||||
"nice",
|
||||
"nl",
|
||||
"nohup",
|
||||
"nproc",
|
||||
"od",
|
||||
"paste",
|
||||
|
@ -59,30 +67,23 @@ all = [
|
|||
"sleep",
|
||||
"sort",
|
||||
"split",
|
||||
"stdbuf",
|
||||
"sum",
|
||||
"sync",
|
||||
"tac",
|
||||
"tail",
|
||||
"tee",
|
||||
"test",
|
||||
"timeout",
|
||||
"touch",
|
||||
"tr",
|
||||
"true",
|
||||
"truncate",
|
||||
"tsort",
|
||||
"tty",
|
||||
"uname",
|
||||
"unexpand",
|
||||
"uniq",
|
||||
"unlink",
|
||||
"uptime",
|
||||
"users",
|
||||
"wc",
|
||||
"whoami",
|
||||
"yes",
|
||||
]
|
||||
default = ["generic", "unix"]
|
||||
|
||||
[dependencies]
|
||||
uucore = { path="src/uucore" }
|
||||
|
@ -178,4 +179,3 @@ tempdir="*"
|
|||
[[bin]]
|
||||
name="uutils"
|
||||
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) {
|
||||
let krate = key[feature_prefix.len()..].to_lowercase();
|
||||
match krate.as_ref() {
|
||||
"default" => continue,
|
||||
"all" => continue,
|
||||
"default" | "unix" | "generic" => continue,
|
||||
_ => {},
|
||||
}
|
||||
crates.push(krate.to_string());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue