mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-24 22:04:19 +08:00
Add cookbook_redoxer, a wrapper to make it simpler to user redoxer
This commit is contained in:
parent
9fefdef37f
commit
364867de5b
830
Cargo.lock
generated
830
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,7 @@ name = "redox_cookbook"
|
||||
version = "0.1.0"
|
||||
authors = ["Jeremy Soller <jackpot51@gmail.com>"]
|
||||
edition = "2018"
|
||||
default-run = "cook"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
@ -10,6 +11,10 @@ edition = "2018"
|
||||
name = "cook"
|
||||
path = "src/bin/cook.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "cookbook_redoxer"
|
||||
path = "src/bin/cookbook_redoxer.rs"
|
||||
|
||||
[lib]
|
||||
name = "cookbook"
|
||||
path = "src/lib.rs"
|
||||
@ -18,6 +23,7 @@ path = "src/lib.rs"
|
||||
blake3 = "0.3.3"
|
||||
pbr = "1.0.2"
|
||||
pkgar = "0.1.6"
|
||||
redoxer = "0.2.18"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
sha2 = "0.8.1"
|
||||
termion = "1.5.5"
|
||||
|
||||
@ -361,7 +361,7 @@ export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig"
|
||||
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
|
||||
|
||||
# cargo template
|
||||
COOKBOOK_CARGO="redoxer"
|
||||
COOKBOOK_CARGO="target/release/cookbook_redoxer"
|
||||
COOKBOOK_CARGO_FLAGS=(
|
||||
--path "${COOKBOOK_SOURCE}"
|
||||
--root "${COOKBOOK_STAGE}"
|
||||
@ -410,7 +410,7 @@ fi
|
||||
};
|
||||
|
||||
let command = {
|
||||
let mut command = Command::new("redoxer");
|
||||
let mut command = Command::new("target/release/cookbook_redoxer");
|
||||
command.arg("env");
|
||||
command.arg("bash").arg("-ex");
|
||||
|
||||
@ -447,6 +447,13 @@ fn package(recipe_dir: &Path, stage_dir: &Path, package: &PackageRecipe) -> Resu
|
||||
let secret_path = "build/secret.key";
|
||||
let public_path = "build/public.key";
|
||||
if ! Path::new(secret_path).is_file() || ! Path::new(public_path).is_file() {
|
||||
if ! Path::new("build").is_dir() {
|
||||
fs::create_dir("build").map_err(|err| format!(
|
||||
"failed to create 'build': {}\n{:?}",
|
||||
err,
|
||||
err
|
||||
))?;
|
||||
}
|
||||
pkgar::bin::keygen(secret_path, public_path).map_err(|err| format!(
|
||||
"failed to generate pkgar keys: {:?}",
|
||||
err
|
||||
|
||||
10
src/bin/cookbook_redoxer.rs
Normal file
10
src/bin/cookbook_redoxer.rs
Normal file
@ -0,0 +1,10 @@
|
||||
use std::env;
|
||||
|
||||
fn main() {
|
||||
let mut args: Vec<String> = env::args().collect();
|
||||
// Ensure all flags go to cargo
|
||||
if args.len() >= 2 {
|
||||
args.insert(2, "--".to_string());
|
||||
}
|
||||
redoxer::main(&args);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user