2021-12-06 16:07:01 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2021-10-06 13:57:05 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "dyff";
|
2022-01-25 03:21:06 +00:00
|
|
|
version = "1.4.7";
|
2021-10-06 13:57:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "homeport";
|
|
|
|
repo = "dyff";
|
|
|
|
rev = "v${version}";
|
2022-01-25 03:21:06 +00:00
|
|
|
sha256 = "sha256-0/pn+Ld7o4gBnddA+uMzBhrFnov1XoqpRGkTT/vNH3Y=";
|
2021-10-06 13:57:05 +00:00
|
|
|
};
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
vendorSha256 = "sha256-ITg+qEdk4/mWytzBbybYEc2Tw4ibvGUOB/FMu475dSk=";
|
2021-10-06 13:57:05 +00:00
|
|
|
|
|
|
|
subPackages = [
|
|
|
|
"cmd/dyff"
|
|
|
|
"pkg/dyff"
|
|
|
|
"internal/cmd"
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
# test fails with the injected version
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace internal/cmd/cmds_test.go \
|
|
|
|
--replace "version (development)" ${version}
|
|
|
|
'';
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X=github.com/homeport/dyff/internal/cmd.version=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd dyff \
|
|
|
|
--bash <($out/bin/dyff completion bash) \
|
|
|
|
--fish <($out/bin/dyff completion fish) \
|
|
|
|
--zsh <($out/bin/dyff completion zsh)
|
|
|
|
'';
|
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A diff tool for YAML files, and sometimes JSON";
|
|
|
|
longDescription = ''
|
|
|
|
dyff is inspired by the way the old BOSH v1 deployment output reported
|
|
|
|
changes from one version to another by only showing the parts of a YAML
|
|
|
|
file that change.
|
|
|
|
|
|
|
|
Each difference is referenced by its location in the YAML document by
|
|
|
|
using either the Spruce or go-patch path syntax.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/homeport/dyff";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ edlimerkaj ];
|
|
|
|
};
|
|
|
|
}
|