mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-07 13:00:08 +00:00
nix: use a more detailed version for NIX_JJ_GIT_VERSION
Summary: For Ilya's use. Signed-off-by: Austin Seipp <aseipp@pobox.com> Change-Id: I6f2c37ad20c5c16d2ff39ae9d746ded3
This commit is contained in:
parent
17b45d642f
commit
cf39adafac
1 changed files with 11 additions and 3 deletions
14
flake.nix
14
flake.nix
|
@ -18,6 +18,13 @@
|
||||||
} //
|
} //
|
||||||
(flake-utils.lib.eachDefaultSystem (system:
|
(flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
|
# NOTE (aseipp): dirtyRev and dirtyShortRev are part of Nix 2.17.x, so
|
||||||
|
# they're pretty recent and can't be relied on everywhere just yet.
|
||||||
|
gitRev = self.dirtyRev or self.rev or "dirty";
|
||||||
|
gitShortRev = self.dirtyShortRev or self.shortRev or "dirty";
|
||||||
|
gitDate = self.lastModifiedDate or self.lastModified or "19700101";
|
||||||
|
buildVersion = "${builtins.substring 0 8 gitDate}|${gitRev}";
|
||||||
|
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = [
|
||||||
|
@ -47,7 +54,7 @@
|
||||||
packages = {
|
packages = {
|
||||||
jujutsu = ourRustPlatform.buildRustPackage rec {
|
jujutsu = ourRustPlatform.buildRustPackage rec {
|
||||||
pname = "jujutsu";
|
pname = "jujutsu";
|
||||||
version = "unstable-${self.shortRev or "dirty"}";
|
version = "unstable-${gitShortRev}";
|
||||||
buildNoDefaultFeatures = true;
|
buildNoDefaultFeatures = true;
|
||||||
buildFeatures = [ "packaging" ];
|
buildFeatures = [ "packaging" ];
|
||||||
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
|
cargoBuildFlags = ["--bin" "jj"]; # don't build and install the fake editors
|
||||||
|
@ -73,10 +80,10 @@
|
||||||
darwin.apple_sdk.frameworks.Security
|
darwin.apple_sdk.frameworks.Security
|
||||||
darwin.apple_sdk.frameworks.SystemConfiguration
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
||||||
libiconv
|
libiconv
|
||||||
];
|
];
|
||||||
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 "";
|
NIX_JJ_GIT_HASH = buildVersion;
|
||||||
CARGO_INCREMENTAL = "0";
|
CARGO_INCREMENTAL = "0";
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
$out/bin/jj util mangen > ./jj.1
|
$out/bin/jj util mangen > ./jj.1
|
||||||
|
@ -134,6 +141,7 @@
|
||||||
export RUST_BACKTRACE=1
|
export RUST_BACKTRACE=1
|
||||||
export ZSTD_SYS_USE_PKG_CONFIG=1
|
export ZSTD_SYS_USE_PKG_CONFIG=1
|
||||||
export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
||||||
|
export NIX_JJ_GIT_HASH="${buildVersion}"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in a new issue