forked from mirrors/jj
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> {
|
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")
|
if let Ok(output) = Command::new("jj")
|
||||||
.args([
|
.args([
|
||||||
"--ignore-working-copy",
|
"--ignore-working-copy",
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
version = "unstable-${self.shortRev or "dirty"}";
|
version = "unstable-${self.shortRev or "dirty"}";
|
||||||
buildNoDefaultFeatures = true;
|
buildNoDefaultFeatures = true;
|
||||||
buildFeatures = [];
|
buildFeatures = [];
|
||||||
|
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
|
||||||
|
useNextest = true;
|
||||||
src = filterSrc ./. [
|
src = filterSrc ./. [
|
||||||
".*\\.nix$"
|
".*\\.nix$"
|
||||||
"^.jj/"
|
"^.jj/"
|
||||||
|
@ -64,6 +66,7 @@
|
||||||
];
|
];
|
||||||
ZSTD_SYS_USE_PKG_CONFIG = "1";
|
ZSTD_SYS_USE_PKG_CONFIG = "1";
|
||||||
LIBSSH2_SYS_USE_PKG_CONFIG = "1";
|
LIBSSH2_SYS_USE_PKG_CONFIG = "1";
|
||||||
|
NIX_JJ_GIT_HASH = self.rev or "";
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
$out/bin/jj util mangen > ./jj.1
|
$out/bin/jj util mangen > ./jj.1
|
||||||
installManPage ./jj.1
|
installManPage ./jj.1
|
||||||
|
@ -106,6 +109,9 @@
|
||||||
openssl zstd libgit2 libssh2
|
openssl zstd libgit2 libssh2
|
||||||
pkg-config
|
pkg-config
|
||||||
|
|
||||||
|
# Make sure rust-analyzer is present
|
||||||
|
rust-analyzer
|
||||||
|
|
||||||
# Additional tools recommended by contributing.md
|
# Additional tools recommended by contributing.md
|
||||||
cargo-deny
|
cargo-deny
|
||||||
cargo-insta
|
cargo-insta
|
||||||
|
|
Loading…
Reference in a new issue