From f5a8602748eff4bafea5fd37ffc270f7892c19c8 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 17 Mar 2022 02:31:14 -0700 Subject: fix(build): remove vergen --- Cargo.toml | 7 ------- build.rs | 7 ++++++- src/main.rs | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 705d216..aa43a21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,13 +25,6 @@ codegen-units = 1 # Optimize for size opt-level = "s" -[build-dependencies] -# Build variables -vergen = "7.0.0" - -# `Result` -anyhow = "1.0.56" - [dependencies] # CLI clap = "3.1.6" diff --git a/build.rs b/build.rs index 5512a66..bf80569 100644 --- a/build.rs +++ b/build.rs @@ -16,4 +16,9 @@ // Copyright (C) 2022-2022 Fuwn // SPDX-License-Identifier: GPL-3.0-only -fn main() -> anyhow::Result<()> { vergen::vergen(vergen::Config::default()) } +use std::env::var; + +fn main() { + println!("cargo:rustc-env=TARGET={}", var("TARGET").unwrap()); + println!("cargo:rustc-env=PROFILE={}", var("PROFILE").unwrap()); +} diff --git a/src/main.rs b/src/main.rs index 96513f6..8321019 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,11 +25,10 @@ use crate::export::Exporter; fn main() { let matches = clap::Command::new(env!("CARGO_PKG_NAME")) .version(&*format!( - "{}(1)-{}-({})-{}", + "{}(1)-{}-({})", env!("CARGO_PKG_VERSION"), - env!("VERGEN_CARGO_PROFILE"), - env!("VERGEN_CARGO_TARGET_TRIPLE"), - env!("VERGEN_GIT_SHA").get(0..7).unwrap(), + env!("PROFILE"), + env!("TARGET"), )) .author(env!("CARGO_PKG_AUTHORS")) .subcommand_required(true) -- cgit v1.2.3