From a327b681649e3d6cdfaa201cf0bbd0d8537fb145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Domen=20Ko=C5=BEar?= Date: Fri, 23 Aug 2013 12:41:48 +0200 Subject: [PATCH] pypy: add setuphook for PYTHONPATH --- .../development/interpreters/pypy/2.0/default.nix | 1 + .../interpreters/pypy/2.0/setup-hook.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 pkgs/development/interpreters/pypy/2.0/setup-hook.sh diff --git a/pkgs/development/interpreters/pypy/2.0/default.nix b/pkgs/development/interpreters/pypy/2.0/default.nix index 2dd681239a60..fb64d8040569 100644 --- a/pkgs/development/interpreters/pypy/2.0/default.nix +++ b/pkgs/development/interpreters/pypy/2.0/default.nix @@ -47,6 +47,7 @@ let --replace "libraries = ['curses']" "libraries = ['ncurses']" ''; + setupHook = ./setup-hook.sh; doCheck = true; checkPhase = '' diff --git a/pkgs/development/interpreters/pypy/2.0/setup-hook.sh b/pkgs/development/interpreters/pypy/2.0/setup-hook.sh new file mode 100644 index 000000000000..96a04cb05dd9 --- /dev/null +++ b/pkgs/development/interpreters/pypy/2.0/setup-hook.sh @@ -0,0 +1,15 @@ +addPythonPath() { + addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/pypy2.0/site-packages +} + +toPythonPath() { + local paths="$1" + local result= + for i in $paths; do + p="$i/lib/pypy2.0/site-packages" + result="${result}${result:+:}$p" + done + echo $result +} + +envHooks=(${envHooks[@]} addPythonPath)