mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-27 06:27:43 +00:00
nix: dont install fake binaries and fix dirty jj version
This commit is contained in:
parent
bdb6db88e1
commit
83dd591272
2 changed files with 12 additions and 0 deletions
6
build.rs
6
build.rs
|
@ -37,6 +37,12 @@ fn main() -> std::io::Result<()> {
|
|||
}
|
||||
|
||||
fn get_git_hash() -> Option<String> {
|
||||
if let Some(nix_hash) = std::env::var("NIX_JJ_GIT_HASH")
|
||||
.ok()
|
||||
.filter(|s| !s.is_empty())
|
||||
{
|
||||
return Some(nix_hash);
|
||||
}
|
||||
if let Ok(output) = Command::new("jj")
|
||||
.args([
|
||||
"--ignore-working-copy",
|
||||
|
|
|
@ -41,6 +41,8 @@
|
|||
version = "unstable-${self.shortRev or "dirty"}";
|
||||
buildNoDefaultFeatures = true;
|
||||
buildFeatures = [];
|
||||
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
|
||||
useNextest = true;
|
||||
src = filterSrc ./. [
|
||||
".*\\.nix$"
|
||||
"^.jj/"
|
||||
|
@ -64,6 +66,7 @@
|
|||
];
|
||||
ZSTD_SYS_USE_PKG_CONFIG = "1";
|
||||
LIBSSH2_SYS_USE_PKG_CONFIG = "1";
|
||||
NIX_JJ_GIT_HASH = self.rev or "";
|
||||
postInstall = ''
|
||||
$out/bin/jj util mangen > ./jj.1
|
||||
installManPage ./jj.1
|
||||
|
@ -106,6 +109,9 @@
|
|||
openssl zstd libgit2 libssh2
|
||||
pkg-config
|
||||
|
||||
# Make sure rust-analyzer is present
|
||||
rust-analyzer
|
||||
|
||||
# Additional tools recommended by contributing.md
|
||||
cargo-deny
|
||||
cargo-insta
|
||||
|
|
Loading…
Reference in a new issue