Commit 38cfa2e7 authored by Eric Bailey's avatar Eric Bailey
Browse files

revive: ensure go is on the PATH at runtime

parent 849492e6
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
{ 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