159e378cbb
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
58 lines
1.5 KiB
Nix
58 lines
1.5 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "dyff";
|
|
version = "1.9.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "homeport";
|
|
repo = "dyff";
|
|
rev = "v${version}";
|
|
sha256 = "sha256-y5gep3v+totupFbsAuGhySUbcESmQeGHWteQFFXj2Kw=";
|
|
};
|
|
|
|
vendorHash = "sha256-cRPAjFVvjCgT+m8ceAQJt5ZE8ax7jefzdVWPGM45LpY=";
|
|
|
|
subPackages = [
|
|
"cmd/dyff"
|
|
"pkg/dyff"
|
|
"internal/cmd"
|
|
];
|
|
|
|
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)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Diff tool for YAML files, and sometimes JSON";
|
|
mainProgram = "dyff";
|
|
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 jceb ];
|
|
};
|
|
}
|