Skip to content

Commit d46de28

Browse files
difftastic: modernize
Signed-off-by: Ethan Carter Edwards <[email protected]>
1 parent 7f0f1da commit d46de28

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
fetchFromGitHub,
66
testers,
77
difftastic,
8+
nix-update-script,
9+
versionCheckHook,
810
}:
911

1012
let
@@ -22,8 +24,8 @@ rustPlatform.buildRustPackage rec {
2224

2325
src = fetchFromGitHub {
2426
owner = "wilfred";
25-
repo = pname;
26-
rev = version;
27+
repo = "difftastic";
28+
tag = version;
2729
hash = "sha256-AAnlopJTb+tjkACISK9OC0k59BDt+8michzt37P1lL8=";
2830
};
2931

@@ -41,14 +43,20 @@ rustPlatform.buildRustPackage rec {
4143
-p1 < ${mimallocPatch}
4244
'';
4345

46+
nativeInstallCheckInputs = [ versionCheckHook ];
47+
versionCheckProgram = "${placeholder "out"}/bin/difft";
48+
versionCheckProgramArg = "--version";
49+
doInstallCheck = true;
50+
4451
passthru.tests.version = testers.testVersion { package = difftastic; };
52+
passthru.updateScript = nix-update-script { };
4553

46-
meta = with lib; {
54+
meta = {
4755
description = "Syntax-aware diff";
4856
homepage = "https://github.com/Wilfred/difftastic";
4957
changelog = "https://github.com/Wilfred/difftastic/blob/${version}/CHANGELOG.md";
50-
license = licenses.mit;
51-
maintainers = with maintainers; [
58+
license = lib.licenses.mit;
59+
maintainers = with lib.maintainers; [
5260
ethancedwards8
5361
figsoda
5462
matthiasbeyer

0 commit comments

Comments
 (0)