Merge pull request #80666 from netixx/grafana-phantomhs2-optional

grafana: made phantomjs2 optional
This commit is contained in:
Maximilian Bosch 2020-02-25 22:49:51 +01:00 committed by GitHub
commit e661d071f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -59,7 +59,18 @@
<itemizedlist>
<listitem>
<para />
<para>
Grafana is now built without support for phantomjs by default. Phantomjs support has been
<link xlink:href="https://grafana.com/docs/grafana/latest/guides/whats-new-in-v6-4/">deprecated in Grafana</link>
and the <package>phantomjs</package> project is
<link xlink:href="https://github.com/ariya/phantomjs/issues/15344#issue-302015362">currently unmaintained</link>.
It can still be enabled by providing <literal>phantomJsSupport = true</literal> to the package instanciation:
<programlisting>{
services.grafana.package = pkgs.grafana.overrideAttrs (oldAttrs: rec {
phantomJsSupport = false;
});
}</programlisting>
</para>
</listitem>
</itemizedlist>
</section>

View File

@ -1,4 +1,4 @@
{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomjs2 }:
{ lib, buildGoPackage, fetchurl, fetchFromGitHub, phantomJsSupport ? false, phantomjs2 ? null }:
buildGoPackage rec {
pname = "grafana";
@ -31,6 +31,7 @@ buildGoPackage rec {
tar -xvf $srcStatic
mkdir -p $bin/share/grafana
mv grafana-*/{public,conf,tools} $bin/share/grafana/
'' + lib.optionalString phantomJsSupport ''
ln -sf ${phantomjs2}/bin/phantomjs $bin/share/grafana/tools/phantomjs/phantomjs
'';