forked from mirrors/nixpkgs
Merge pull request #24358 from cko/spark_r_backend
spark: activate R backend
This commit is contained in:
commit
91cd7479a6
|
@ -1,4 +1,5 @@
|
||||||
{ stdenv, fetchzip, makeWrapper, jre, pythonPackages
|
{ stdenv, fetchzip, makeWrapper, jre, pythonPackages
|
||||||
|
, RSupport? true, R
|
||||||
, mesosSupport ? true, mesos
|
, mesosSupport ? true, mesos
|
||||||
, version
|
, version
|
||||||
}:
|
}:
|
||||||
|
@ -30,6 +31,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ makeWrapper jre pythonPackages.python pythonPackages.numpy ]
|
buildInputs = [ makeWrapper jre pythonPackages.python pythonPackages.numpy ]
|
||||||
|
++ optional RSupport R
|
||||||
++ optional mesosSupport mesos;
|
++ optional mesosSupport mesos;
|
||||||
|
|
||||||
untarDir = "${name}-bin-${hadoopVersion}";
|
untarDir = "${name}-bin-${hadoopVersion}";
|
||||||
|
@ -46,6 +48,9 @@ stdenv.mkDerivation rec {
|
||||||
export SPARK_HOME="$out/lib/${untarDir}"
|
export SPARK_HOME="$out/lib/${untarDir}"
|
||||||
export PYSPARK_PYTHON="${pythonPackages.python}/bin/${pythonPackages.python.executable}"
|
export PYSPARK_PYTHON="${pythonPackages.python}/bin/${pythonPackages.python.executable}"
|
||||||
export PYTHONPATH="\$PYTHONPATH:$PYTHONPATH"
|
export PYTHONPATH="\$PYTHONPATH:$PYTHONPATH"
|
||||||
|
${optionalString RSupport
|
||||||
|
''export SPARKR_R_SHELL="${R}/bin/R"
|
||||||
|
export PATH=$PATH:"${R}/bin/R"''}
|
||||||
${optionalString mesosSupport
|
${optionalString mesosSupport
|
||||||
''export MESOS_NATIVE_LIBRARY="$MESOS_NATIVE_LIBRARY"''}
|
''export MESOS_NATIVE_LIBRARY="$MESOS_NATIVE_LIBRARY"''}
|
||||||
EOF
|
EOF
|
||||||
|
@ -57,7 +62,7 @@ stdenv.mkDerivation rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Lightning-fast cluster computing";
|
description = "Apache Spark is a fast and general engine for large-scale data processing";
|
||||||
homepage = "http://spark.apache.org";
|
homepage = "http://spark.apache.org";
|
||||||
license = stdenv.lib.licenses.asl20;
|
license = stdenv.lib.licenses.asl20;
|
||||||
platforms = stdenv.lib.platforms.all;
|
platforms = stdenv.lib.platforms.all;
|
||||||
|
|
Loading…
Reference in a new issue