revive: ensure go is on the PATH at runtime

This is needed due to https://github.com/mgechev/revive/pull/993.
This commit is contained in:
Eric Bailey 2024-07-31 13:32:37 -05:00
parent 849492e6e2
commit 38cfa2e7cc

View File

@ -1,4 +1,4 @@
{ buildGoModule, fetchFromGitHub, lib }:
{ buildGoModule, fetchFromGitHub, go, lib, makeWrapper }:
buildGoModule rec {
pname = "revive";
@ -33,6 +33,15 @@ buildGoModule rec {
ldflags+=" -X 'github.com/mgechev/revive/cli.date=$(cat DATE)'"
'';
allowGoReference = true;
nativeBuildInputs = [ makeWrapper ];
postFixup = ''
wrapProgram $out/bin/revive \
--prefix PATH : ${lib.makeBinPath [ go ]}
'';
# The following tests fail when built by nix:
#
# $ nix log /nix/store/build-revive.1.3.9.drv | grep FAIL