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 = "40.2.0";
12 name = "${python.libPrefix}-${pname}-${version}";
13
14 src = fetchPypi {
15 inherit pname version;
16 extension = "zip";
17 sha256 = "47881d54ede4da9c15273bac65f9340f8929d4f0213193fa7894be384f2dcfa6";
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 = python.meta.platforms;
38 priority = 10;
39 };
40}