2023-08-04 22:07:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2022-03-30 09:31:56 +00:00
|
|
|
, fetchFromGitHub
|
2023-08-04 22:07:22 +00:00
|
|
|
, rustPlatform
|
2022-03-30 09:31:56 +00:00
|
|
|
, Security
|
|
|
|
, SystemConfiguration
|
2023-08-04 22:07:22 +00:00
|
|
|
, pkg-config
|
2022-03-30 09:31:56 +00:00
|
|
|
, libiconv
|
2023-08-04 22:07:22 +00:00
|
|
|
, openssl
|
|
|
|
, gzip
|
|
|
|
, libssh2
|
|
|
|
, libgit2
|
|
|
|
, zstd
|
|
|
|
, fetchpatch
|
|
|
|
, installShellFiles
|
|
|
|
, nix-update-script
|
2022-04-27 09:35:20 +00:00
|
|
|
, testers
|
2022-03-30 09:31:56 +00:00
|
|
|
, jujutsu
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "jujutsu";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.11.0";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "martinvonz";
|
|
|
|
repo = "jj";
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-yEW7+0MnJlW0WeZ6UItaCDrihPLA52mLcu15tJwZx9w=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
cargoHash = "sha256-xA9SDq1Kc0u8qFEPFFCic9uwE2Y/BXJzUHBCs1Czxtw=";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
cargoBuildFlags = [ "--bin" "jj" ]; # don't install the fake editors
|
|
|
|
useNextest = true; # nextest is the upstream integration framework
|
|
|
|
ZSTD_SYS_USE_PKG_CONFIG = "1"; # disable vendored zlib
|
|
|
|
LIBSSH2_SYS_USE_PKG_CONFIG = "1"; # disable vendored libssh2
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
gzip
|
|
|
|
installShellFiles
|
2022-03-30 09:31:56 +00:00
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
openssl
|
2023-08-04 22:07:22 +00:00
|
|
|
zstd
|
|
|
|
libgit2
|
|
|
|
libssh2
|
2022-03-30 09:31:56 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
Security
|
|
|
|
SystemConfiguration
|
|
|
|
libiconv
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
postInstall = ''
|
|
|
|
$out/bin/jj util mangen > ./jj.1
|
|
|
|
installManPage ./jj.1
|
|
|
|
|
|
|
|
installShellCompletion --cmd jj \
|
|
|
|
--bash <($out/bin/jj util completion --bash) \
|
|
|
|
--fish <($out/bin/jj util completion --fish) \
|
|
|
|
--zsh <($out/bin/jj util completion --zsh)
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
tests = {
|
|
|
|
version = testers.testVersion {
|
|
|
|
package = jujutsu;
|
|
|
|
command = "jj --version";
|
|
|
|
};
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A Git-compatible DVCS that is both simple and powerful";
|
|
|
|
homepage = "https://github.com/martinvonz/jj";
|
|
|
|
changelog = "https://github.com/martinvonz/jj/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = licenses.asl20;
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ _0x4A6F thoughtpolice ];
|
2022-04-27 09:35:20 +00:00
|
|
|
mainProgram = "jj";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
}
|