From bede9c4d50ed8d079dc386ff1c5964f3f1816e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 24 May 2009 21:08:39 +0000 Subject: [PATCH] Change Nevow, SimpleJSON, and Foolscap to use `buildPythonPackage'. svn path=/nixpkgs/trunk/; revision=15707 --- .../python-modules/foolscap/default.nix | 53 ---------- .../python-modules/nevow/default.nix | 80 --------------- .../python-modules/simplejson/default.nix | 45 --------- pkgs/top-level/all-packages.nix | 4 + pkgs/top-level/python-packages.nix | 97 +++++++++++++++++++ 5 files changed, 101 insertions(+), 178 deletions(-) delete mode 100644 pkgs/development/python-modules/foolscap/default.nix delete mode 100644 pkgs/development/python-modules/nevow/default.nix delete mode 100644 pkgs/development/python-modules/simplejson/default.nix create mode 100644 pkgs/top-level/python-packages.nix diff --git a/pkgs/development/python-modules/foolscap/default.nix b/pkgs/development/python-modules/foolscap/default.nix deleted file mode 100644 index c52a9be538a..00000000000 --- a/pkgs/development/python-modules/foolscap/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ fetchurl, stdenv, python, setuptools, twisted, pyopenssl }: - -stdenv.mkDerivation rec { - name = "foolscap-0.3.2"; - - src = fetchurl { - url = "http://foolscap.lothar.com/releases/${name}.tar.gz"; - sha256 = "1wkqgm6anlxvz8dnqx7ki008255nm1mlhak5n9xy6g1yf31fn3l0"; - }; - - buildInputs = [ python ]; - propagatedBuildInputs = [ setuptools twisted pyopenssl ]; - - doCheck = true; - - buildPhase = "python setup.py build --build-base $out"; - checkPhase = "python setup.py test"; - - # FIXME: `$out/bin/flogtool' can't find its friends: - # - # $ ./result/bin/flogtool --help - # Traceback (most recent call last): - # File "./result/bin/flogtool", line 4, in - # import pkg_resources - # ImportError: No module named pkg_resources - - installPhase = '' - ensureDir "$out/lib/python2.5/site-packages" - - PYTHONPATH="$out/lib/python2.5/site-packages:$PYTHONPATH" \ - python setup.py install --prefix="$out" - - ensureDir "$out/doc/${name}" - cp -rv "doc/"* "$out/doc/${name}" - ''; - - - meta = { - homepage = http://foolscap.lothar.com/; - - description = "Foolscap, an RPC protocol for Python that follows the distributed object-capability model"; - - longDescription = '' - "Foolscap" is the name for the next-generation RPC protocol, - intended to replace Perspective Broker (part of Twisted). - Foolscap is a protocol to implement a distributed - object-capabilities model in Python. - ''; - - # See http://foolscap.lothar.com/trac/browser/LICENSE. - license = "MIT"; - }; -} diff --git a/pkgs/development/python-modules/nevow/default.nix b/pkgs/development/python-modules/nevow/default.nix deleted file mode 100644 index 2c971b4a86a..00000000000 --- a/pkgs/development/python-modules/nevow/default.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ fetchurl, stdenv, python, setuptools, twisted, makeWrapper, lib }: - -stdenv.mkDerivation rec { - name = "nevow-0.9.33"; - - src = fetchurl { - url = "http://divmod.org/trac/attachment/wiki/SoftwareReleases/Nevow-0.9.33.tar.gz?format=raw"; - sha256 = "1b6zhfxx247b60n1qi2hrawhiaah88v8igg37pf7rjkmvy2z1c6c"; - name = "${name}.tar.gz"; - }; - - buildInputs = [ python makeWrapper ]; - propagatedBuildInputs = [ setuptools twisted ]; - - doCheck = true; - - buildPhase = "python setup.py build --build-base $out"; - checkPhase = "python runtests"; - - installPhase = '' - ensureDir "$out/lib/python2.5/site-packages" - - PYTHONPATH="$out/lib/python2.5/site-packages:$PYTHONPATH" \ - python setup.py install --prefix="$out" - - ensureDir "$out/doc/${name}" - cp -rv "doc/"* "$out/doc/${name}" - - ${postInstall} - ''; - - /* FIXME: Wrapping programs like this is not enough: - - $ ./result/bin/nit --help - Traceback (most recent call last): - File "/nix/store/p5a9qbdjqcfzqmaya8absvm5279l9wd0-nevow-0.9.33/bin/.wrapped-nit", line 4, in - import pkg_resources - [...] - pkg_resources.DistributionNotFound: Nevow==0.9.33-r17222 - - Ideas welcome. */ - postInstall = '' - for i in "$out/bin/"* - do - wrapProgram "$i" \ - --prefix PYTHONPATH ":" \ - ${lib.concatStringsSep ":" - ([ "$out/lib/python2.5/site-packages/src" ] ++ - (map (path: path + "/lib/python2.5/site-packages") - (propagatedBuildInputs - ++ twisted.propagatedBuildInputs)))} - done - ''; - - meta = { - description = "Nevow, a web application construction kit for Python"; - - longDescription = '' - Nevow - Pronounced as the French "nouveau", or "noo-voh", Nevow - is a web application construction kit written in Python. It is - designed to allow the programmer to express as much of the view - logic as desired in Python, and includes a pure Python XML - expression syntax named stan to facilitate this. However it - 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 - form posts will be validated and input coerced, rendering error - pages if appropriate. Once a form post has validated - successfully, the method will be called with the coerced values. - ''; - - homepage = http://divmod.org/trac/wiki/DivmodNevow; - - license = "BSD-style"; - }; -} diff --git a/pkgs/development/python-modules/simplejson/default.nix b/pkgs/development/python-modules/simplejson/default.nix deleted file mode 100644 index 9f53d9364f1..00000000000 --- a/pkgs/development/python-modules/simplejson/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ fetchsvn, stdenv, python, setuptools }: - -stdenv.mkDerivation rec { - name = "simplejson-2.0.9"; - - src = fetchsvn { - url = "http://simplejson.googlecode.com/svn/tags/${name}"; - sha256 = "a48d5256fdb4f258c33da3dda110ecf3c786f086dcb08a01309acde6d1ddb921"; - rev = "172"; # to be on the safe side - }; - - buildInputs = [ python ]; - propagatedBuildInputs = [ setuptools ]; - - doCheck = true; - - buildPhase = "python setup.py build --build-base $out"; - checkPhase = "python setup.py test"; - - installPhase = '' - ensureDir "$out/lib/python2.5/site-packages" - - PYTHONPATH="$out/lib/python2.5/site-packages:$PYTHONPATH" \ - python setup.py install --prefix="$out" - - # Remove irrelevant directories. - rm -rvf "$out/"lib.* "$out/"temp.* - ''; - - meta = { - description = "simplejson is a simple, fast, extensible JSON encoder/decoder for Python"; - - longDescription = '' - simplejson is compatible with Python 2.4 and later with no - external dependencies. It covers the full JSON specification - for both encoding and decoding, with unicode support. By - default, encoding is done in an encoding neutral fashion (plain - ASCII with \uXXXX escapes for unicode characters). - ''; - - homepage = http://code.google.com/p/simplejson/; - - license = "MIT"; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d05dee98912..1bb2df8f2cd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4209,6 +4209,10 @@ let inherit python setuptools makeWrapper lib; }; + pythonPackages = recurseIntoAttrs (import ./python-packages.nix { + inherit pkgs; + }); + foursuite = import ../development/python-modules/4suite { inherit fetchurl stdenv python; }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix new file mode 100644 index 00000000000..c961a5b2d12 --- /dev/null +++ b/pkgs/top-level/python-packages.nix @@ -0,0 +1,97 @@ +{ pkgs }: + +rec { + inherit (pkgs) buildPythonPackage fetchurl fetchsvn stdenv python; + + nevow = buildPythonPackage (rec { + name = "nevow-0.9.33"; + + src = fetchurl { + url = "http://divmod.org/trac/attachment/wiki/SoftwareReleases/Nevow-0.9.33.tar.gz?format=raw"; + sha256 = "1b6zhfxx247b60n1qi2hrawhiaah88v8igg37pf7rjkmvy2z1c6c"; + name = "${name}.tar.gz"; + }; + + propagatedBuildInputs = [ pkgs.twisted ]; + + meta = { + description = "Nevow, a web application construction kit for Python"; + + longDescription = '' + Nevow - Pronounced as the French "nouveau", or "noo-voh", Nevow + is a web application construction kit written in Python. It is + designed to allow the programmer to express as much of the view + logic as desired in Python, and includes a pure Python XML + expression syntax named stan to facilitate this. However it + 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 + form posts will be validated and input coerced, rendering error + pages if appropriate. Once a form post has validated + successfully, the method will be called with the coerced values. + ''; + + homepage = http://divmod.org/trac/wiki/DivmodNevow; + + license = "BSD-style"; + }; + }); + + simplejson = buildPythonPackage (rec { + name = "simplejson-2.0.9"; + + src = fetchsvn { + url = "http://simplejson.googlecode.com/svn/tags/${name}"; + sha256 = "a48d5256fdb4f258c33da3dda110ecf3c786f086dcb08a01309acde6d1ddb921"; + rev = "172"; # to be on the safe side + }; + + meta = { + description = "simplejson is a simple, fast, extensible JSON encoder/decoder for Python"; + + longDescription = '' + simplejson is compatible with Python 2.4 and later with no + external dependencies. It covers the full JSON specification + for both encoding and decoding, with unicode support. By + default, encoding is done in an encoding neutral fashion (plain + ASCII with \uXXXX escapes for unicode characters). + ''; + + homepage = http://code.google.com/p/simplejson/; + + license = "MIT"; + }; + }); + + foolscap = buildPythonPackage (rec { + name = "foolscap-0.3.2"; + + src = fetchurl { + url = "http://foolscap.lothar.com/releases/${name}.tar.gz"; + sha256 = "1wkqgm6anlxvz8dnqx7ki008255nm1mlhak5n9xy6g1yf31fn3l0"; + }; + + propagatedBuildInputs = [ pkgs.twisted pkgs.pyopenssl ]; + + meta = { + homepage = http://foolscap.lothar.com/; + + description = "Foolscap, an RPC protocol for Python that follows the distributed object-capability model"; + + longDescription = '' + "Foolscap" is the name for the next-generation RPC protocol, + intended to replace Perspective Broker (part of Twisted). + Foolscap is a protocol to implement a distributed + object-capabilities model in Python. + ''; + + # See http://foolscap.lothar.com/trac/browser/LICENSE. + license = "MIT"; + }; + }); + +}