nixpkgs/pkgs/by-name/ju/jujutsu/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

125 lines
2.4 KiB
Nix
Raw Normal View History

{
lib,
2024-09-04 19:03:21 +00:00
stdenv,
rustPlatform,
2024-09-04 19:03:21 +00:00
fetchFromGitHub,
installShellFiles,
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,
buildPackages,
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 = [
installShellFiles
2022-03-14 19:34:02 +00:00
pkg-config
];
buildInputs =
[
zstd
libgit2
libssh2
]
++ 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
libiconv
];
2022-03-14 19:34:02 +00:00
2024-09-04 19:51:44 +00:00
nativeCheckInputs = [
git
gnupg
openssh
];
cargoBuildFlags = [
# Dont install the `gen-protos` build tool.
"--bin"
"jj"
];
2024-09-04 19:51:44 +00:00
useNextest = true;
cargoTestFlags = [
# Dont 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";
};
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
installShellCompletion --cmd jj \
--bash <(${jj} util completion bash) \
--fish <(${jj} util completion fish) \
--zsh <(${jj} util completion zsh)
'';
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; [
_0x4A6F
thoughtpolice
2024-09-05 02:13:04 +00:00
emily
2024-09-05 03:54:18 +00:00
bbigras
];
mainProgram = "jj";
2022-03-14 19:34:02 +00:00
};
}