From f4e6e80bcf6113f570a9fb440185c11a1c31af7c Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 24 May 2009 12:20:08 +0000 Subject: [PATCH] Restoring builderDefs functionality in setuptools svn path=/nixpkgs/trunk/; revision=15697 --- .../python-modules/setuptools/default.nix | 33 ++++++++++++++----- pkgs/top-level/all-packages.nix | 4 +-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index c94b6369f035..a187b6786305 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -1,21 +1,34 @@ -{ fetchurl, stdenv, python, makeWrapper }: +a : +let + fetchurl = a.fetchurl; -stdenv.mkDerivation rec { - name = "setuptools-0.6c9"; + 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"; }; - buildInputs = [ python makeWrapper ]; + inherit buildInputs; + configureFlags = []; doCheck = true; - buildPhase = "python setup.py build --build-base $out"; - checkPhase = "python setup.py test"; + doMakeCheck = a.fullDepEntry ('' + python setup.py test + '') ["minInit" "doUnpack" "addInputs" "doBuild"]; - installPhase = '' + 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" \ @@ -27,11 +40,13 @@ stdenv.mkDerivation rec { --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" ]; - }; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c6678e3f78da..055fdb55a927 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4316,8 +4316,8 @@ let inherit fetchurl stdenv python makeWrapper; }; - setuptools = import ../development/python-modules/setuptools { - inherit fetchurl stdenv python makeWrapper; + setuptools = builderDefsPackage (import ../development/python-modules/setuptools) { + inherit python makeWrapper; }; simplejson = import ../development/python-modules/simplejson {