diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/recipes/gui/orbutils-background/recipe.sh b/recipes/gui/orbutils-background/recipe.sh deleted file mode 100644 index 237d8b0208e1b0a2b5e0b2ca626657a293b0b832..0000000000000000000000000000000000000000 --- a/recipes/gui/orbutils-background/recipe.sh +++ /dev/null @@ -1,4 +0,0 @@ -GIT=https://gitlab.redox-os.org/redox-os/orbutils.git -BINDIR=/usr/bin -CARGOFLAGS="--bin background -p orbutils" -DEPENDS="orbital" diff --git a/recipes/gui/orbutils-background/recipe.toml b/recipes/gui/orbutils-background/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..9b13e8168b773c35ba89a0cf47a6630b7d77fe4c --- /dev/null +++ b/recipes/gui/orbutils-background/recipe.toml @@ -0,0 +1,12 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/orbutils.git" + +[build] +template = "cargo" +package_path = "orbutils" +cargoflags = "--bin background" + +[package] +dependencies = [ + "orbital" +] diff --git a/recipes/gui/orbutils-launcher/recipe.sh b/recipes/gui/orbutils-launcher/recipe.sh deleted file mode 100644 index 4b4975b508afeca47b71e3ccf05accdb60b87316..0000000000000000000000000000000000000000 --- a/recipes/gui/orbutils-launcher/recipe.sh +++ /dev/null @@ -1,4 +0,0 @@ -GIT=https://gitlab.redox-os.org/redox-os/orbutils.git -BINDIR=/usr/bin -CARGOFLAGS="--bin launcher -p orbutils" -DEPENDS="orbital" diff --git a/recipes/gui/orbutils-launcher/recipe.toml b/recipes/gui/orbutils-launcher/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..78125ba932aca5e422658a9c502299527c6ee485 --- /dev/null +++ b/recipes/gui/orbutils-launcher/recipe.toml @@ -0,0 +1,11 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/orbutils.git" + +[build] +template = "cargo" +package_path = "launcher" + +[package] +dependencies = [ + "orbital" +] diff --git a/recipes/gui/orbutils-orblogin/recipe.sh b/recipes/gui/orbutils-orblogin/recipe.sh deleted file mode 100644 index a7dd5f5368bb0fa569deaebd2db7d850d32e3d74..0000000000000000000000000000000000000000 --- a/recipes/gui/orbutils-orblogin/recipe.sh +++ /dev/null @@ -1,4 +0,0 @@ -GIT=https://gitlab.redox-os.org/redox-os/orbutils.git -BINDIR=/usr/bin -CARGOFLAGS="--bin orblogin -p orbutils" -DEPENDS="orbital" diff --git a/recipes/gui/orbutils-orblogin/recipe.toml b/recipes/gui/orbutils-orblogin/recipe.toml new file mode 100644 index 0000000000000000000000000000000000000000..6871a92e620e71311dc5ba3f6ae24e8b32044736 --- /dev/null +++ b/recipes/gui/orbutils-orblogin/recipe.toml @@ -0,0 +1,12 @@ +[source] +git = "https://gitlab.redox-os.org/redox-os/orbutils.git" + +[build] +template = "cargo" +package_path = "orbutils" +cargoflags = "--bin orblogin" + +[package] +dependencies = [ + "orbital" +] diff --git a/src/bin/cook.rs b/src/bin/cook.rs index 5767d7cac84c35a7393b4fa91944baa82fe2b12a..d271117a046aabf9b0181f87641f74c6535abe3b 100644 --- a/src/bin/cook.rs +++ b/src/bin/cook.rs @@ -466,7 +466,7 @@ fi COOKBOOK_CARGO="${COOKBOOK_REDOXER}" function cookbook_cargo { "${COOKBOOK_CARGO}" install \ - --path "${COOKBOOK_SOURCE}" \ + --path "${COOKBOOK_SOURCE}/${PACKAGE_PATH}" \ --root "${COOKBOOK_STAGE}/usr" \ --locked \ --no-track \ @@ -480,7 +480,7 @@ function cookbook_cargo_examples { for example in "$@" do "${COOKBOOK_CARGO}" build \ - --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \ + --manifest-path "${COOKBOOK_SOURCE}/${PACKAGE_PATH}/Cargo.toml" \ --example "${example}" \ ${build_flags} mkdir -pv "${COOKBOOK_STAGE}/usr/bin" @@ -496,7 +496,7 @@ function cookbook_cargo_packages { for package in "$@" do "${COOKBOOK_CARGO}" build \ - --manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \ + --manifest-path "${COOKBOOK_SOURCE}/${PACKAGE_PATH}/Cargo.toml" \ --package "${package}" \ ${build_flags} mkdir -pv "${COOKBOOK_STAGE}/usr/bin" @@ -560,9 +560,11 @@ done //TODO: configurable target //TODO: Add more configurability, convert scripts to Rust? let script = match &build.kind { - BuildKind::Cargo => "cookbook_cargo", - BuildKind::Configure => "cookbook_configure", - BuildKind::Custom { script } => script + BuildKind::Cargo { package_path, cargoflags } => { + format!("PACKAGE_PATH={} cookbook_cargo {cargoflags}", package_path.as_deref().unwrap_or(".")) + } + BuildKind::Configure => "cookbook_configure".to_owned(), + BuildKind::Custom { script } => script.clone(), }; let command = { diff --git a/src/recipe.rs b/src/recipe.rs index 197396c756b9552ff05b8435446cb89f8f24b6b9..ca74754f33ad2ac6992c682f235a4ef716472466 100644 --- a/src/recipe.rs +++ b/src/recipe.rs @@ -38,7 +38,13 @@ pub enum SourceRecipe { pub enum BuildKind { /// Will build and install using cargo #[serde(rename = "cargo")] - Cargo, + Cargo { + #[serde(default)] + package_path: Option<String>, + + #[serde(default)] + cargoflags: String, + }, /// Will build and install using configure and make #[serde(rename = "configure")] Configure,