grafana-loki: 1.6.1 -> 2.0.0

Convert to use buildGoModule and add a patch for a test failing on
golang>=1.15.
This commit is contained in:
Martin Weinelt 2020-10-29 01:13:01 +01:00
parent c29ded49b1
commit 09bbd4017f
No known key found for this signature in database
GPG Key ID: BD4AA0528F63F17E
2 changed files with 19 additions and 15 deletions

View File

@ -1,24 +1,28 @@
{ stdenv, lib, buildGoPackage, fetchFromGitHub, makeWrapper, systemd }:
{ stdenv, lib, buildGoModule, fetchFromGitHub, makeWrapper, systemd, fetchpatch }:
buildGoPackage rec {
version = "1.6.1";
buildGoModule rec {
version = "2.0.0";
pname = "grafana-loki";
goPackagePath = "github.com/grafana/loki";
doCheck = true;
src = fetchFromGitHub {
rev = "v${version}";
owner = "grafana";
repo = "loki";
sha256 = "0bakskzizazc5cd6km3n6facc5val5567zinnxg3yjy29xdi64ww";
sha256 = "09a0mqdmk754vigd1xqijzwazwrmfaqcgdr2c6dz25p7a65568hj";
};
postPatch = ''
substituteInPlace pkg/distributor/distributor_test.go --replace \
'"eth0", "en0", "lo0"' \
'"lo"'
'';
vendorSha256 = null;
subPackages = [ "..." ];
patches = [
(fetchpatch {
# Fix expected return value in Test_validateDropConfig
# https://github.com/grafana/loki/issues/2519
url = "https://github.com/grafana/loki/commit/1316c0f0c5cda7c272c4873ea910211476fc1db8.patch";
sha256 = "06hwga58qpmivbhyjgyqzb75602hy8212a4b5vh99y9pnn6c913h";
})
];
nativeBuildInputs = [ makeWrapper ];
buildInputs = stdenv.lib.optionals stdenv.isLinux [ systemd.dev ];
@ -28,6 +32,8 @@ buildGoPackage rec {
--prefix LD_LIBRARY_PATH : "${lib.getLib systemd}/lib"
'';
doCheck = true;
meta = with stdenv.lib; {
description = "Like Prometheus, but for logs";
license = licenses.asl20;

View File

@ -16565,9 +16565,7 @@ in
grafana = callPackage ../servers/monitoring/grafana { };
grafana-loki = callPackage ../servers/monitoring/loki {
buildGoPackage = buildGo114Package;
};
grafana-loki = callPackage ../servers/monitoring/loki { };
grafana_reporter = callPackage ../servers/monitoring/grafana-reporter { };