dyff: fix version output, install shell completions

main
figsoda 3 years ago
parent 7de4bd4e44
commit 17ca0b4d1d
  1. 23
      pkgs/development/tools/dyff/default.nix

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub}:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "dyff";
@ -19,6 +19,27 @@ buildGoModule rec {
"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 = "A diff tool for YAML files, and sometimes JSON";
longDescription = ''

Loading…
Cancel
Save