2021-06-18 17:32:03 +01:00
|
|
|
{ lib, buildGoModule, fetchurl, fetchFromGitHub, nixosTests }:
|
2015-11-16 13:28:03 +00:00
|
|
|
|
2020-05-23 01:04:18 +01:00
|
|
|
buildGoModule rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "grafana";
|
2021-07-08 18:15:16 +01:00
|
|
|
version = "8.0.5";
|
2015-11-16 13:28:03 +00:00
|
|
|
|
2019-02-26 19:30:02 +00:00
|
|
|
excludedPackages = [ "release_publisher" ];
|
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
rev = "v${version}";
|
|
|
|
owner = "grafana";
|
|
|
|
repo = "grafana";
|
2021-07-08 18:15:16 +01:00
|
|
|
sha256 = "sha256-tehqb86Mkg1dD4x34zHwLD9uV/PssslLDIs9bl28ap0=";
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
srcStatic = fetchurl {
|
2019-08-29 16:16:47 +01:00
|
|
|
url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz";
|
2021-07-08 18:15:16 +01:00
|
|
|
sha256 = "sha256-aVZpTQ4ERrJV3YN4U0v/tJoYkTg7vlQVe6sIIK2NE0k=";
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
|
2021-07-08 18:15:16 +01:00
|
|
|
vendorSha256 = "sha256-INvFZ9hNbtpaDXuhBPaSaqBZyi7QJ18tMk+AZjJtYjg=";
|
2021-06-15 11:16:55 +01:00
|
|
|
|
2020-09-26 23:34:59 +01:00
|
|
|
preBuild = ''
|
2021-06-08 23:39:56 +01:00
|
|
|
# The testcase makes an API call against grafana.com:
|
|
|
|
#
|
|
|
|
# --- Expected
|
|
|
|
# +++ Actual
|
|
|
|
# @@ -1,4 +1,4 @@
|
|
|
|
# (map[string]interface {}) (len=2) {
|
|
|
|
# - (string) (len=5) "error": (string) (len=16) "plugin not found",
|
|
|
|
# - (string) (len=7) "message": (string) (len=16) "Plugin not found"
|
|
|
|
# + (string) (len=5) "error": (string) (len=171) "Failed to send request: Get \"https://grafana.com/api/plugins/repo/test\": dial tcp: lookup grafana.com on [::1]:53: read udp [::1]:48019->[::1]:53: read: connection refused",
|
|
|
|
# + (string) (len=7) "message": (string) (len=24) "Failed to install plugin"
|
|
|
|
# }
|
2021-06-15 21:32:40 +01:00
|
|
|
sed -i -e '/func TestPluginInstallAccess/a t.Skip();' pkg/tests/api/plugins/api_install_test.go
|
|
|
|
|
|
|
|
# Skip a flaky test (https://github.com/NixOS/nixpkgs/pull/126928#issuecomment-861424128)
|
|
|
|
sed -i -e '/it should change folder successfully and return correct result/{N;s/$/\nt.Skip();/}'\
|
|
|
|
pkg/services/libraryelements/libraryelements_patch_test.go
|
|
|
|
|
2021-06-08 23:39:56 +01:00
|
|
|
|
|
|
|
# main module (github.com/grafana/grafana) does not contain package github.com/grafana/grafana/scripts/go
|
|
|
|
rm -r scripts/go
|
2020-09-26 23:34:59 +01:00
|
|
|
'';
|
|
|
|
|
2021-06-11 10:34:42 +01:00
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=-s -w -X main.version=${version}
|
|
|
|
'';
|
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
postInstall = ''
|
|
|
|
tar -xvf $srcStatic
|
2020-04-28 02:50:57 +01:00
|
|
|
mkdir -p $out/share/grafana
|
|
|
|
mv grafana-*/{public,conf,tools} $out/share/grafana/
|
2015-11-16 13:28:03 +00:00
|
|
|
'';
|
|
|
|
|
2020-08-20 09:00:54 +01:00
|
|
|
passthru.tests = { inherit (nixosTests) grafana; };
|
|
|
|
|
2015-11-16 13:28:03 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Gorgeous metric viz, dashboards & editors for Graphite, InfluxDB & OpenTSDB";
|
2021-06-09 21:41:53 +01:00
|
|
|
license = licenses.agpl3;
|
2019-08-15 13:30:23 +01:00
|
|
|
homepage = "https://grafana.com";
|
2020-03-21 19:23:26 +00:00
|
|
|
maintainers = with maintainers; [ offline fpletz willibutz globin ma27 Frostman ];
|
2015-11-18 10:33:50 +00:00
|
|
|
platforms = platforms.linux;
|
2015-11-16 13:28:03 +00:00
|
|
|
};
|
|
|
|
}
|