@@ -0,0 +1,32 @@
1+{ stdenv, python3Packages }:
2+with python3Packages; buildPythonApplication rec {
3+ name = "${pname}-${version}";
4+ pname = "pew";
5+ version = "1.1.0";
6+
7+ src = fetchPypi {
8+ inherit pname version;
9+ sha256 = "0b8z1vjsll1kgnh3mmdjps5rr9gayy091rapp2dra71jrwkx3yfh";
10+ };
11+
12+ propagatedBuildInputs = [ virtualenv virtualenv-clone setuptools ];
13+
14+ postFixup = ''
15+ set -euo pipefail
16+ PEW_SITE="$out/lib/${python.libPrefix}/site-packages"
17+ SETUPTOOLS="${setuptools}/lib/${python.libPrefix}/site-packages"
18+ SETUPTOOLS_SITE=$SETUPTOOLS/$(cat $SETUPTOOLS/setuptools.pth)
19+ CLONEVENV_SITE="${virtualenv-clone}/lib/${python.libPrefix}/site-packages"
20+ SITE_PACKAGES="[\'$PEW_SITE\',\'$SETUPTOOLS_SITE\',\'$CLONEVENV_SITE\']"
21+ substituteInPlace $PEW_SITE/pew/pew.py \
22+ --replace "from pew.pew" "import sys; sys.path.extend($SITE_PACKAGES); from pew.pew" \
23+ --replace 'sys.executable, "-m", "virtualenv"' "'${virtualenv}/bin/virtualenv'"
24+ '';
25+
26+ meta = with stdenv.lib; {
27+ description = "Tools to manage multiple virtualenvs written in pure python";
28+ license = licenses.mit;
29+ platforms = platforms.all;
30+ maintainers = with maintainers; [ berdario ];
31+ };
32+ }