Merge pull request #143656 from figsoda/dyff-version

dyff: fix version output, install shell completions
This commit is contained in:
figsoda
2021-10-29 09:28:09 -04:00
committed by GitHub
+22 -1
View File
@@ -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 = ''