feat: Add more variables for template (#1160)

Fixed #775

 - Add dep target-lexicon v0.12.7
 - Add `target-{family, arch, libc, vendor}` to
   `package.metadata.binstall`.

For `{universal, universal2}-apple-darwin`, the `target-arch` is set to
`universal`.

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2023-06-21 08:05:13 +10:00 committed by GitHub
parent 181b5293e7
commit d8419ea5a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 210 additions and 115 deletions

View file

@ -11,7 +11,7 @@ use crate::{
errors::BinstallError,
helpers::{
download::ExtractedFiles, gh_api_client::GhApiClient, remote::Client,
tasks::AutoAbortJoinHandle,
target_triple::TargetTriple, tasks::AutoAbortJoinHandle,
},
manifests::cargo_toml_binstall::{PkgFmt, PkgMeta},
};
@ -72,6 +72,8 @@ pub trait Fetcher: Send + Sync {
/// Return the target for this fetcher
fn target(&self) -> &str;
fn target_data(&self) -> &Arc<TargetData>;
}
#[derive(Clone, Debug)]
@ -186,6 +188,7 @@ impl RepoInfo {
#[derive(Clone, Debug)]
pub struct TargetData {
pub target: String,
pub triple: TargetTriple,
pub meta: PkgMeta,
}