Files
nixpkgs/pkgs/by-name/di/difftastic/package.nix

49 lines
1.2 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
stdenv,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "difftastic";
version = "0.64.0";
src = fetchFromGitHub {
owner = "wilfred";
repo = "difftastic";
tag = finalAttrs.version;
hash = "sha256-XMvysYO6Kji9cbfGayB6wPVuNp0j2uXLHfZ9H+dBLt0=";
};
cargoHash = "sha256-1u3oUbqhwHXD90ld70pjK2XPJe5hpUbJtU78QpIjAE8=";
env = lib.optionalAttrs stdenv.hostPlatform.isStatic { RUSTFLAGS = "-C relocation-model=static"; };
# skip flaky tests
checkFlags = [ "--skip=options::tests::test_detect_display_width" ];
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgram = "${placeholder "out"}/bin/difft";
versionCheckProgramArg = "--version";
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "Syntax-aware diff";
homepage = "https://github.com/Wilfred/difftastic";
changelog = "https://github.com/Wilfred/difftastic/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
ethancedwards8
figsoda
matthiasbeyer
defelo
];
mainProgram = "difft";
};
})