grafana: made phantomjs2 optional

On servers especially, phantomjs2 pulls graphical dependencies which is unecessary.
This pathes enable the package to be linked/installed without
phantomjs2. Phantomjs2 is disabled by default since it has been deprecated in grafana https://grafana.com/docs/grafana/latest/guides/whats-new-in-v6-4/
This commit is contained in:
Netix (Espinet François) 2020-02-20 22:05:20 +01:00 committed by Maximilian Bosch
parent d5db5d12aa
commit 9f0014b6f2
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E
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
'';