[Nix-dev] gitorious mirror -Python refactoring again (second attempt)

Marc Weber marco-oweber at gmx.de
Sun May 9 23:28:28 CEST 2010


Hi urkud, I'd like to push my new Python refactoring to the the
gitorious repository:

Ludovic Courtès, can you have a quick glance at the diffs before I commit this
time?

messages only:

1)

    little Python refactoring:
    - move buildPythonPackage setuptools into python-packages removing
      duplication
    - Add pythonFullBuilder because iotop requires ncurses
      tidy up offlineimap (and update moved url)
    - make buildPythonPackage default to buildPython26Package so that its
      consistent to pythonPackages which defaults to python26Packages

2)

    adding iotop


I hope the changes are easy to follow this time.

Marc Weber


full diff:

commit cd7c4d85b55c9c2a399faa52a1bb5bb014e54c40
Author: Marc Weber <marco-oweber at gmx.de>
Date:   Sun May 9 13:11:54 2010 +0200

    little Python refactoring:
    - move buildPythonPackage setuptools into python-packages removing
      duplication
    - Add pythonFullBuilder because iotop requires ncurses
      tidy up offlineimap (and update moved url)
    - make buildPythonPackage default to buildPython26Package so that its
      consistent to pythonPackages which defaults to python26Packages

diff --git a/pkgs/tools/networking/offlineimap/default.nix b/pkgs/tools/networking/offlineimap/default.nix
index fe9225d..0af8a2a 100644
--- a/pkgs/tools/networking/offlineimap/default.nix
+++ b/pkgs/tools/networking/offlineimap/default.nix
@@ -4,8 +4,9 @@ buildPythonPackage {
   name = "offlineimap-6.2.0";
 
   src = fetchurl {
-    url = "http://software.complete.org/software/attachments/download/413/offlineimap_6.2.0.orig.tar.gz";
-    sha256 = "057pcz2291mdpkjyrwdzxfg831337sg7bbqyxmwfy42k7np5bdi4";
+    url = "http://github.com/jgoerzen/offlineimap/tarball/debian/6.2.0";
+    name = "offlineimap-6.2.0.tgz";
+    sha256 = "00rm2a68ab1cgymxsknnck29ag0lsy2wi9bxkfh04d7z28jy6xyq";
   };
 
   doCheck = false;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index bf8e544..4f881cb 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1251,14 +1251,7 @@ let
     # I did not find any better way of reusing buildPythonPackage+setuptools
     # for a python with openssl support
     buildPythonPackage = assert pythonFull.opensslSupport;
-      import ../development/python-modules/generic {
-        inherit makeWrapper lib;
-        python = pythonFull;
-        setuptools = builderDefsPackage (import ../development/python-modules/setuptools) {
-          inherit makeWrapper;
-          python = pythonFull;
-        };
-      };
+      buildPythonFullPackage;
   };
 
   opendbx = import ../development/libraries/opendbx {
@@ -5480,30 +5473,33 @@ let
 
   ### DEVELOPMENT / PYTHON MODULES
 
-  buildPythonPackage =
-    import ../development/python-modules/generic {
-      inherit python setuptools makeWrapper lib;
-    };
 
-  buildPython26Package =
-    import ../development/python-modules/generic {
-      inherit makeWrapper lib;
-      python = python26;
-      setuptools = setuptools_python26;
-    };
+  buildPython26Package = python26Packages.buildPythonPackage;
+  buildPython26FullPackage = python26Packages.buildPythonFullPackage;
+
+  buildPython25Package = pythonPackages.buildPython25Package;
+  buildPython25FullPackage = python25Packages.buildFullPythonPackage;
+
+  # default version:
+  buildPythonPackage = pythonPackages.buildPythonPackage;
+  buildPythonFullPackage = pythonPackages.buildPythonFullPackage;
 
   pythonPackages = python26Packages;
 
   python25Packages = recurseIntoAttrs (import ./python-packages.nix {
-    inherit pkgs python buildPythonPackage;
+    inherit pkgs python pythonFull buildPythonPackage;
   });
+  setuptools = pythonPackages.setuptools;
 
   python26Packages = recurseIntoAttrs (import ./python-packages.nix {
     inherit pkgs;
     python = python26;
+    pythonFull = python26Full;
     buildPythonPackage = buildPython26Package;
   });
 
+  setuptools_python26 = python26Packages.setuptools;
+
   foursuite = import ../development/python-modules/4suite {
     inherit fetchurl stdenv python;
   };
@@ -5586,15 +5582,6 @@ let
     inherit fetchurl stdenv python makeWrapper;
   };
 
-  setuptools = builderDefsPackage (import ../development/python-modules/setuptools) {
-    inherit python makeWrapper;
-  };
-
-  setuptools_python26 = builderDefsPackage (import ../development/python-modules/setuptools) {
-    inherit makeWrapper;
-    python = python26;
-  };
-
   wxPython = wxPython26;
 
   wxPython26 = import ../development/python-modules/wxPython/2.6.nix {
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 48cdf1f..4c28055 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1,7 +1,19 @@
-{ pkgs, python, buildPythonPackage }:
+{ pkgs, python, pythonFull, buildPythonPackage }:
 
 rec {
-  inherit (pkgs) fetchurl fetchsvn stdenv;
+  inherit (pkgs) fetchurl fetchsvn stdenv makeOverridable makeWrapper lib
+    builderDefsPackage;
+
+  buildPythonPackage =
+    (import ../development/python-modules/generic) {
+      inherit python setuptools makeWrapper lib;
+    };
+
+  buildPythonFullPackage = 
+    (import ../development/python-modules/generic) {
+      inherit setuptools makeWrapper lib;
+      python = pythonFull;
+    };
 
   argparse = buildPythonPackage (rec {
     name = "argparse-0.9.1";
@@ -351,7 +363,6 @@ rec {
         also provides rich support for designer-edited templates, using
         a very small XML attribute language to provide bi-directional
         template manipulation capability.
-
         Nevow also includes formless, a declarative syntax for
         specifying the types of method parameters and exposing these
         methods to the web.  Forms can be rendered automatically, and
@@ -598,6 +609,11 @@ rec {
     };
   });
 
+  setuptools = builderDefsPackage (import ../development/python-modules/setuptools) {
+    inherit makeWrapper;
+    inherit python;
+  };
+
   setuptoolsDarcs = buildPythonPackage {
     name = "setuptools-darcs-1.2.8";
 


commit 17ae280f809bf8fad3846ba5dfd1f54412a585f2
Author: Marc Weber <marco-oweber at gmx.de>
Date:   Sun May 9 22:56:12 2010 +0200

    adding iotop

diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 4c28055..b40c297 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -231,6 +231,37 @@ rec {
     };
   };
 
+  iotop = buildPythonFullPackage {
+    name = "iotop-0.4";
+
+    src = fetchurl {
+      url = http://guichaz.free.fr/iotop/files/iotop-0.4.tar.bz2;
+      sha256 = "00a7f80cp12bi48pb8z7v1839pni4xpp99jhmrwlqmqb98ik7n89";
+    };
+
+    buildInputs = [python];
+
+    checkPhase = ":";
+
+    postInstall = ''
+      cp iotop.py $out/bin/iotop
+    '';
+
+    meta = {
+      description = "top for io traffic";
+      longDescription = "
+        Iotop is a Python program with a top like UI used to show of behalf
+        of which process is the I/O going on. It requires Python ≥ 2.5 (or Python
+            ≥ 2.4 with the ctypes module) and a Linux kernel ≥ 2.6.20 with the
+        TASK_DELAY_ACCT and TASK_IO_ACCOUNTING options enabled.
+      ";
+      homepage = "http://guichaz.free.fr/iotop/";
+      license = "GPL";
+      maintainers = [stdenv.lib.maintainers.marcweber];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  };
+
   jinja2 = buildPythonPackage {
     name = "jinja2-2.2.1";
 



More information about the nix-dev mailing list