diff options
Diffstat (limited to 'pkgs/development/python-modules/pyspark/default.nix')
-rw-r--r-- | pkgs/development/python-modules/pyspark/default.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/pyspark/default.nix b/pkgs/development/python-modules/pyspark/default.nix index a5e35e698c99f..7ffcf52bea8a3 100644 --- a/pkgs/development/python-modules/pyspark/default.nix +++ b/pkgs/development/python-modules/pyspark/default.nix @@ -29,6 +29,17 @@ buildPythonPackage rec { --replace py4j== 'py4j>=' ''; + postFixup = '' + # find_python_home.py has been wrapped as a shell script + substituteInPlace $out/bin/find-spark-home \ + --replace 'export SPARK_HOME=$($PYSPARK_DRIVER_PYTHON "$FIND_SPARK_HOME_PYTHON_SCRIPT")' \ + 'export SPARK_HOME=$("$FIND_SPARK_HOME_PYTHON_SCRIPT")' + # patch PYTHONPATH in pyspark so that it properly looks at SPARK_HOME + substituteInPlace $out/bin/pyspark \ + --replace 'export PYTHONPATH="''${SPARK_HOME}/python/:$PYTHONPATH"' \ + 'export PYTHONPATH="''${SPARK_HOME}/..:''${SPARK_HOME}/python/:$PYTHONPATH"' + ''; + propagatedBuildInputs = [ py4j ]; passthru.optional-dependencies = { |