new: port the rust template bodies to manifests

This commit is contained in:
2026-09-18 15:05:44 +02:00
parent ffac4d6b57
commit e6f2012835
5 changed files with 130 additions and 65 deletions
+6
View File
@@ -0,0 +1,6 @@
[package]
name = "{crate_name}"
version = "{upstream_version}"
edition = "2021"
[dependencies]
+4
View File
@@ -0,0 +1,4 @@
// Placeholder for {name}, generated by `pkh new`.
fn main() {
println!("Hello from {command}!");
}
+12 -5
View File
@@ -1,8 +1,11 @@
## The `rust` template: a vendored Cargo build (see the module docs of
## src/new/templates/rust.rs for the vendoring strategy). The logic half —
## the cargo vendor post-write hook, the Cargo.toml/src skeletons with
## their crate-name sanitizing, and the `{locked}` / `{artifact}` values of
## rules.extra.tpl — lives in that module.
## src/new/templates/rust.rs for the vendoring strategy). The skeleton
## bodies and the vendored-build rules overrides below are static data; the
## logic half — the cargo vendor post-write hook, the project probe, and
## the `{crate_name}` / `{locked}` / `{artifact}` values of the bodies —
## lives in that module (dpkg package names may carry `+`/`.`, which cargo
## rejects in crate names, so the skeleton crate name is a derived
## placeholder, not the raw `{name}`).
##
## Schema: see src/new/templates/mod.rs.
@@ -23,4 +26,8 @@ rules_extra_file: rules.extra.tpl
gitignore_entries:
- vendor/
- .cargo/config.toml
files: []
files:
- path: Cargo.toml
template: Cargo.toml.tpl
- path: src/main.rs
template: main.rs.tpl