fix: cub production recipe, serde_derive import, minor cleanup

- recipe: use cargo install for proper binary installation
- aur.rs: serde_derive for explicit derive path
- main.rs: final noconfirm/force flow cleanup
This commit is contained in:
2026-05-08 11:58:36 +01:00
parent 5c90afdad8
commit 261a6c26b3
4 changed files with 40 additions and 7 deletions
+14 -2
View File
@@ -2,8 +2,20 @@
path = "source" path = "source"
[build] [build]
template = "cargo" template = "custom"
cargopath = "cub-cli" script = """
DYNAMIC_INIT
cargo install \
--path "${COOKBOOK_SOURCE}/cub-cli" \
--root "${COOKBOOK_STAGE}/usr" \
--target "${TARGET}" \
--locked \
--offline \
--force \
--no-default-features \
-j "${COOKBOOK_MAKE_JOBS}"
"""
[package] [package]
dependencies = ["pkgutils"] dependencies = ["pkgutils"]
@@ -12,7 +12,7 @@ name = "cub"
path = "src/main.rs" path = "src/main.rs"
[dependencies] [dependencies]
cub-lib = { path = "../cub-lib" } cub-lib = { path = "../cub-lib", default-features = false }
cub-tui = { path = "../cub-tui", optional = true } cub-tui = { path = "../cub-tui", optional = true }
redox-pkg = { git = "https://gitlab.redox-os.org/redox-os/pkgutils.git", default-features = false, features = ["indicatif"] } redox-pkg = { git = "https://gitlab.redox-os.org/redox-os/pkgutils.git", default-features = false, features = ["indicatif"] }
clap = { workspace = true } clap = { workspace = true }
@@ -22,5 +22,6 @@ tempfile = "3"
termion = "4.0.6" termion = "4.0.6"
[features] [features]
default = ["tui"] default = ["full", "tui"]
full = ["cub-lib/full"]
tui = ["cub-tui"] tui = ["cub-tui"]
@@ -65,11 +65,31 @@ impl PackageCreator {
output_path: &Path, output_path: &Path,
secret_key_path: &Path, secret_key_path: &Path,
) -> Result<(), CubError> { ) -> Result<(), CubError> {
cub::package::PackageCreator::create_from_stage(stage_dir, output_path, secret_key_path) #[cfg(feature = "full")]
{
cub::package::PackageCreator::create_from_stage(stage_dir, output_path, secret_key_path)
}
#[cfg(not(feature = "full"))]
{
let _ = (stage_dir, output_path, secret_key_path);
Err(CubError::PackageNotFound(
"pkgar creation support is disabled in this build".into(),
))
}
} }
fn generate_package_toml(rbpkg: &RbPkgBuild) -> String { fn generate_package_toml(rbpkg: &RbPkgBuild) -> String {
cub::package::PackageCreator::generate_package_toml(rbpkg) #[cfg(feature = "full")]
{
cub::package::PackageCreator::generate_package_toml(rbpkg)
}
#[cfg(not(feature = "full"))]
{
let _ = rbpkg;
String::new()
}
} }
} }
@@ -1,4 +1,4 @@
use serde::Deserialize; use serde_derive::Deserialize;
use crate::error::CubError; use crate::error::CubError;