buildPythonPackage: add shell hook for instant development
This commit is contained in:
parent
f0f2125620
commit
0558c87288
@ -38,6 +38,12 @@
|
|||||||
|
|
||||||
, meta ? {}
|
, meta ? {}
|
||||||
|
|
||||||
|
# Execute before shell hook
|
||||||
|
, preShellHook ? ""
|
||||||
|
|
||||||
|
# Execute after shell hook
|
||||||
|
, postShellHook ? ""
|
||||||
|
|
||||||
, ... } @ attrs:
|
, ... } @ attrs:
|
||||||
|
|
||||||
# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
|
# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
|
||||||
@ -150,6 +156,16 @@ python.stdenv.mkDerivation (attrs // {
|
|||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
shellHook = attrs.shellHook or ''
|
||||||
|
mkdir -p /tmp/$name/lib/${python.libPrefix}/site-packages
|
||||||
|
${preShellHook}
|
||||||
|
export PATH="/tmp/$name/bin:$PATH"
|
||||||
|
export PYTHONPATH="/tmp/$name/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
||||||
|
python setup.py develop --prefix /tmp/$name
|
||||||
|
${postShellHook}
|
||||||
|
return
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with lib.maintainers; {
|
meta = with lib.maintainers; {
|
||||||
# default to python's platforms
|
# default to python's platforms
|
||||||
platforms = python.meta.platforms;
|
platforms = python.meta.platforms;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user