Unverified Commit 99d0c8ba authored by Nick Cao's avatar Nick Cao
Browse files
parent b6c2241f
Loading
Loading
Loading
Loading
+20 −6
Original line number Diff line number Diff line
@@ -3,20 +3,25 @@
  stdenv,
  buildGoModule,
  fetchFromGitHub,
  gotools,
}:

buildGoModule rec {
  pname = "mtail";
  version = "3.0.23";
  version = "3.2.4";

  src = fetchFromGitHub {
    owner = "jaqx0r";
    repo = "mtail";
    rev = "v${version}";
    hash = "sha256-B/to05/qORplhNyz0s7t/WgpmOJ6UZoKnmJfqaf6Htc=";
    hash = "sha256-3ox+EXd5/Rh3N/7GbX+JUmH4C9j/Er+REkUHZndTxw0=";
  };

  vendorHash = "sha256-jE1tcZJ7TaMC3yegBHE3Zad9sF0EfbHxDA8ffehNL4U=";
  vendorHash = "sha256-7EQFO7dlVhBwHdY6c3WmxJo4WdCUJbWKw5P4fL6jBsA=";

  nativeBuildInputs = [
    gotools # goyacc
  ];

  ldflags = [
    "-X=main.Branch=main"
@@ -27,11 +32,20 @@ buildGoModule rec {
  # fails on darwin with: write unixgram -> <tmpdir>/rsyncd.log: write: message too long
  doCheck = !stdenv.hostPlatform.isDarwin;

  meta = with lib; {
  checkFlags = [
    # can only be executed under bazel
    "-skip=TestExecMtail"
  ];

  preBuild = ''
    GOOS= GOARCH= go generate ./...
  '';

  meta = {
    description = "Tool for extracting metrics from application logs";
    homepage = "https://github.com/jaqx0r/mtail";
    license = licenses.asl20;
    maintainers = with maintainers; [ nickcao ];
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ nickcao ];
    mainProgram = "mtail";
  };
}