Convert orbutils recipes from recipe.sh to recipe.toml

This commit is contained in:
bjorn3 2024-07-06 22:00:18 +02:00
parent 8c8136bb6d
commit 0bfd573dda
8 changed files with 50 additions and 19 deletions

View File

@ -1,4 +0,0 @@
GIT=https://gitlab.redox-os.org/redox-os/orbutils.git
BINDIR=/usr/bin
CARGOFLAGS="--bin background -p orbutils"
DEPENDS="orbital"

View File

@ -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"
]

View File

@ -1,4 +0,0 @@
GIT=https://gitlab.redox-os.org/redox-os/orbutils.git
BINDIR=/usr/bin
CARGOFLAGS="--bin launcher -p orbutils"
DEPENDS="orbital"

View File

@ -0,0 +1,11 @@
[source]
git = "https://gitlab.redox-os.org/redox-os/orbutils.git"
[build]
template = "cargo"
package_path = "launcher"
[package]
dependencies = [
"orbital"
]

View File

@ -1,4 +0,0 @@
GIT=https://gitlab.redox-os.org/redox-os/orbutils.git
BINDIR=/usr/bin
CARGOFLAGS="--bin orblogin -p orbutils"
DEPENDS="orbital"

View File

@ -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"
]

View File

@ -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 = {

View File

@ -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,