2024-09-04 18:43:36 +00:00
|
|
|
|
{
|
|
|
|
|
lib,
|
2024-09-04 19:03:21 +00:00
|
|
|
|
stdenv,
|
2024-09-04 18:43:36 +00:00
|
|
|
|
rustPlatform,
|
2024-09-04 19:03:21 +00:00
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
installShellFiles,
|
2024-09-04 18:43:36 +00:00
|
|
|
|
pkg-config,
|
|
|
|
|
zstd,
|
2024-09-04 19:03:21 +00:00
|
|
|
|
libgit2,
|
|
|
|
|
libssh2,
|
|
|
|
|
openssl,
|
|
|
|
|
darwin,
|
|
|
|
|
libiconv,
|
2024-09-04 19:51:44 +00:00
|
|
|
|
git,
|
|
|
|
|
gnupg,
|
|
|
|
|
openssh,
|
2024-09-04 19:14:04 +00:00
|
|
|
|
buildPackages,
|
2024-09-04 18:43:36 +00:00
|
|
|
|
nix-update-script,
|
|
|
|
|
testers,
|
|
|
|
|
jujutsu,
|
2022-03-14 19:34:02 +00:00
|
|
|
|
}:
|
|
|
|
|
|
2024-09-04 19:16:26 +00:00
|
|
|
|
let
|
2024-10-02 17:39:33 +00:00
|
|
|
|
version = "0.22.0";
|
2024-09-04 19:16:26 +00:00
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
|
pname = "jujutsu";
|
|
|
|
|
inherit version;
|
2022-03-14 19:34:02 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "martinvonz";
|
|
|
|
|
repo = "jj";
|
|
|
|
|
rev = "v${version}";
|
2024-10-02 17:39:33 +00:00
|
|
|
|
hash = "sha256-GbKmX1Ev/8di3A1XT5ZIRjzn2zP6DMye2NpA26PGVIs=";
|
2022-03-14 19:34:02 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-10-02 17:39:33 +00:00
|
|
|
|
cargoHash = "sha256-+3oO2M2293Nba6P8bejgZD5OxgCpkIRdcPICDswJyEU=";
|
2022-03-14 19:34:02 +00:00
|
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2023-07-17 02:18:28 +00:00
|
|
|
|
installShellFiles
|
2022-03-14 19:34:02 +00:00
|
|
|
|
pkg-config
|
|
|
|
|
];
|
|
|
|
|
|
2024-09-04 18:43:36 +00:00
|
|
|
|
buildInputs =
|
|
|
|
|
[
|
|
|
|
|
zstd
|
|
|
|
|
libgit2
|
|
|
|
|
libssh2
|
|
|
|
|
]
|
2024-09-04 19:09:17 +00:00
|
|
|
|
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ openssl ]
|
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-09-04 18:44:31 +00:00
|
|
|
|
darwin.apple_sdk.frameworks.Security
|
|
|
|
|
darwin.apple_sdk.frameworks.SystemConfiguration
|
2024-09-04 18:43:36 +00:00
|
|
|
|
libiconv
|
|
|
|
|
];
|
2022-03-14 19:34:02 +00:00
|
|
|
|
|
2024-09-04 19:51:44 +00:00
|
|
|
|
nativeCheckInputs = [
|
|
|
|
|
git
|
|
|
|
|
gnupg
|
|
|
|
|
openssh
|
|
|
|
|
];
|
|
|
|
|
|
2024-09-04 19:39:55 +00:00
|
|
|
|
cargoBuildFlags = [
|
|
|
|
|
# Don’t install the `gen-protos` build tool.
|
|
|
|
|
"--bin"
|
|
|
|
|
"jj"
|
|
|
|
|
];
|
|
|
|
|
|
2024-09-04 19:51:44 +00:00
|
|
|
|
useNextest = true;
|
|
|
|
|
|
2024-09-04 19:51:44 +00:00
|
|
|
|
cargoTestFlags = [
|
|
|
|
|
# Don’t build the `gen-protos` build tool when running tests.
|
|
|
|
|
"-p"
|
|
|
|
|
"jj-lib"
|
|
|
|
|
"-p"
|
|
|
|
|
"jj-cli"
|
|
|
|
|
];
|
|
|
|
|
|
2024-09-04 19:11:06 +00:00
|
|
|
|
env = {
|
|
|
|
|
# Disable vendored libraries.
|
|
|
|
|
ZSTD_SYS_USE_PKG_CONFIG = "1";
|
|
|
|
|
LIBGIT2_NO_VENDOR = "1";
|
|
|
|
|
LIBSSH2_SYS_USE_PKG_CONFIG = "1";
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-04 19:14:04 +00:00
|
|
|
|
postInstall =
|
|
|
|
|
let
|
|
|
|
|
jj = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/jj";
|
|
|
|
|
in
|
|
|
|
|
lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
|
|
|
|
|
${jj} util mangen > ./jj.1
|
|
|
|
|
installManPage ./jj.1
|
2023-07-17 02:18:28 +00:00
|
|
|
|
|
2024-09-04 19:14:04 +00:00
|
|
|
|
installShellCompletion --cmd jj \
|
|
|
|
|
--bash <(${jj} util completion bash) \
|
|
|
|
|
--fish <(${jj} util completion fish) \
|
|
|
|
|
--zsh <(${jj} util completion zsh)
|
|
|
|
|
'';
|
2023-07-17 02:18:28 +00:00
|
|
|
|
|
2023-07-17 02:03:47 +00:00
|
|
|
|
passthru = {
|
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
|
tests = {
|
|
|
|
|
version = testers.testVersion {
|
|
|
|
|
package = jujutsu;
|
|
|
|
|
command = "jj --version";
|
|
|
|
|
};
|
2022-03-14 19:34:02 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-04 19:01:59 +00:00
|
|
|
|
meta = {
|
2022-03-14 19:34:02 +00:00
|
|
|
|
description = "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";
|
2024-09-04 19:01:59 +00:00
|
|
|
|
license = lib.licenses.asl20;
|
|
|
|
|
maintainers = with lib.maintainers; [
|
2024-09-04 18:43:36 +00:00
|
|
|
|
_0x4A6F
|
|
|
|
|
thoughtpolice
|
2024-09-05 02:13:04 +00:00
|
|
|
|
emily
|
2024-09-05 03:54:18 +00:00
|
|
|
|
bbigras
|
2024-09-04 18:43:36 +00:00
|
|
|
|
];
|
2022-04-01 19:34:55 +00:00
|
|
|
|
mainProgram = "jj";
|
2022-03-14 19:34:02 +00:00
|
|
|
|
};
|
|
|
|
|
}
|