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
|
|
|
|
, 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";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "0.18.0";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "martinvonz";
|
|
|
|
repo = "jj";
|
|
|
|
rev = "v${version}";
|
2024-06-20 14:57:18 +00:00
|
|
|
hash = "sha256-5KKF85RNCPPaXMxBb7m2XC3EaEo+UcEhBdfMEzNPsAg=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
cargoHash = "sha256-MiJuen3Lo7nPaAK30cENw3ACAdoYbHDoiGS05dk5m6U=";
|
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
|
2024-04-21 15:54:59 +00:00
|
|
|
useNextest = false; # nextest is the upstream integration framework, but is problematic for test skipping
|
2023-08-04 22:07:22 +00:00
|
|
|
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 \
|
2024-02-29 20:09:43 +00:00
|
|
|
--bash <($out/bin/jj util completion bash) \
|
|
|
|
--fish <($out/bin/jj util completion fish) \
|
|
|
|
--zsh <($out/bin/jj util completion zsh)
|
2023-08-04 22:07:22 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
checkFlags = [
|
|
|
|
# signing tests spin up an ssh-agent and do git checkouts
|
|
|
|
"--skip=test_ssh_signing"
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Git-compatible DVCS that is both simple and powerful";
|
2022-03-30 09:31:56 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|