1{ stdenv
2, fetchPypi
3, python
4, wrapPython
5, unzip
6}:
7
8# Should use buildPythonPackage here somehow
9stdenv.mkDerivation rec {
10 pname = "setuptools";
11 version = "38.4.0";
12 name = "${python.libPrefix}-${pname}-${version}";
13
14 src = fetchPypi {
15 inherit pname version;
16 extension = "zip";
17 sha256 = "6501fc32f505ec5b3ed36ec65ba48f1b975f52cf2ea101c7b73a08583fd12f75";
18 };
19
20 nativeBuildInputs = [ unzip wrapPython ];
21 buildInputs = [ python ];
22 doCheck = false; # requires pytest
23 installPhase = ''
24 dst=$out/${python.sitePackages}
25 mkdir -p $dst
26 export PYTHONPATH="$dst:$PYTHONPATH"
27 ${python.interpreter} setup.py install --prefix=$out
28 wrapPythonPrograms
29 '';
30
31 pythonPath = [];
32
33 meta = with stdenv.lib; {
34 description = "Utilities to facilitate the installation of Python packages";
35 homepage = https://pypi.python.org/pypi/setuptools;
36 license = with licenses; [ psfl zpl20 ];
37 platforms = platforms.all;
38 priority = 10;
39 };
40}