about summary refs log tree commit diff
path: root/pkgs/development/python-modules/setuptools/default.nix
blob: a187b67863051b6ed18432c3cc8148512d0ee2a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
a :  
let 
  fetchurl = a.fetchurl;

  version = a.lib.getAttr ["version"] "0.6c9" a; 
  buildInputs = with a; [
    python makeWrapper
  ];
in
rec {
  name = "setuptools-" + version;

  src = fetchurl {
    url = "http://pypi.python.org/packages/source/s/setuptools/${name}.tar.gz";
    sha256 = "1n5k6hf9nn69fnprgsnr9hdxzj2j6ir76qcy9d4b2v0v62bh86g6";
  };

  inherit buildInputs;
  configureFlags = [];

  doCheck = true;

  doMakeCheck = a.fullDepEntry (''
    python setup.py test
  '') ["minInit" "doUnpack" "addInputs" "doBuild"];

  doBuild = a.fullDepEntry(''
    python setup.py build --build-base $out
  '') ["addInputs" "doUnpack"];

  doInstall = a.fullDepEntry(''
    ensureDir "$out/lib/python2.5/site-packages"

    PYTHONPATH="$out/lib/python2.5/site-packages:$PYTHONPATH" \
    python setup.py install --prefix="$out"

    for i in "$out/bin/"*
    do
      wrapProgram "$i"                          \
        --prefix PYTHONPATH ":"			\
          "$out/lib/python2.5/site-packages"
    done
  '') ["doBuild"];

  phaseNames = ["doBuild" "doInstall"];

  meta = {
    description = "Utilities to facilitate the installation of Python packages";
    homepage = http://pypi.python.org/pypi/setuptools;
    licenses = [ "PSF" "ZPL" ];
  };    
}