Files
nixpkgs/pkgs/development/python-modules/generic/default.nix
Yury G. Kudryashov 144ffa8da6 Squashed commit of the following:
commit 2198fa131ea7afcf512d0992e35d6179748e18ea
Author: viric <viric@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Thu Apr 22 09:57:02 2010 +0000

    Fixing xterm's setting of gid in its pts terminals (group tty)

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21224 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 4b6057dd501887f7bfa00c3008d01f84edea5eb1
Author: viric <viric@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 21:35:38 2010 +0000

    Updating util-linux, so the 2nd util-linux change in few minutes; that may
    annoy less.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21221 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit c070ae50b8202e2b760bb047fe9a5a382eed04c5
Author: viric <viric@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 20:47:15 2010 +0000

    Making utillinux build also 'write'. (Thank you, niksnut)

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21219 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit cc6198feb86d3d924cb4d004228d16fd597ecaec
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 20:07:26 2010 +0000

    * Use OpenSSL's implementation of MD5, SHA-1 and SHA-256, as they're
      a bit faster.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21218 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 4b36eee2b627ba0a0d912cd9eb496f9d9c60afcc
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 14:47:13 2010 +0000

    * Updated nvidia-x11 to 195.36.15.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21209 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 4f70bb47880815c24165a79aaa12b037dd309ba3
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 14:47:13 2010 +0000

    * Reverted a revert that should not have been done :-)
    * Add a version number to svnfs.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21208 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit cad4ba155f029f5e26a9767f0bcd229d56243ab6
Author: andres <andres@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 14:05:17 2010 +0000

    Added gdiff Haskell package.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21207 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit ab8afaa6622646dbc44eb466fb2e67df1314457f
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 14:02:28 2010 +0000

    * Thunderbird 3.0.4.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21206 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit eb8370c154b5fcb211d6cf5be8831e1911d586b5
Author: armijn <armijn@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 13:31:08 2010 +0000

    update libpcap to 1.1.1 and wireshark to 1.3.4

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21205 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit aa509e03e6b4f8ab3a9fa7b72757ab73e2a366b3
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 12:32:16 2010 +0000

    * Update the firmware for the IWL 3945.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21204 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 259fad1c1b8e0c05f74a3db3109eb73da64cce1d
Author: sandervanderburg <sandervanderburg@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 12:06:28 2010 +0000

    - Upgraded SIP to 4.10.2
    - Upgraded PyQt to 4.7.3

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21203 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 8bca2274354fac59170d7d0b061383cf3c46e3d8
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 11:37:15 2010 +0000

    * Updated wpa_supplicant to 0.7.2.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21200 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 0aa860394799232c618e839ba2f176104ed99fac
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 11:21:15 2010 +0000

    * Added rfkill, a tool for controlling the wireless kill switch on
      Linux.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21199 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 072956854fc864f44fc80982792c7d100a157634
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 11:12:06 2010 +0000

    * Cleanup: removed the unused `python-new'.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21198 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 3bab6b666807817a773cf0df734f3ab2b9f70741
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 11:11:42 2010 +0000

    * Cleanup: removed the unused `python-new'.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21197 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit eee1e59b6069ddbb140489484f13958279986d36
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 10:51:15 2010 +0000

    * Reverted most of the recent Python refactorings, as discussed.  It's
      a worthy goal to move the Python packages that are currently in
      all-packages.nix into a single attribute set, but this doesn't
      require moving python-packages.nix or the other changes made to that
      file.  The Python packages in all-packages.nix should simply be
      moved to python-packages.nix, and ideally changed to use
      buildPythonPackage.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21196 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit f23186e8c0083e4106bf2c7ce8e178cd59803f5b
Author: viric <viric@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 10:38:12 2010 +0000

    Enabling again the setuptoolsTrial python package, so at least
    the nixpkgs tarball does not fail.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21195 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit fe3065b1530cee5de759d05d3c0fccde67df6350
Author: eelco <eelco@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 09:47:26 2010 +0000

    * Subversion 1.6.11.  Also updated meta.homepage to reflect that it's
      now an Apache project.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21194 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 4432ae627ade50a75e18664a88c203758c66235c
Author: viric <viric@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Wed Apr 21 07:00:49 2010 +0000

    "Remind" update.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21193 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

commit 57988cf50a91d01e01bbebb2c1aa2cb9e439d5b0
Author: viric <viric@70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb>
Date:   Tue Apr 20 18:29:50 2010 +0000

    Fixing the mechanize python package. That may make calibre build again.

    git-svn-id: https://svn.nixos.org/repos/nix/nixpkgs/trunk@21191 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb

svn path=/nixpkgs/branches/mass-update-01/; revision=21236
2010-04-22 12:37:55 +00:00

99 lines
3.1 KiB
Nix

/* This function provides a generic Python package builder. It is
intended to work with packages that use `setuptools'
(http://pypi.python.org/pypi/setuptools/), which represents a large
number of Python packages nowadays. */
{ python, setuptools, makeWrapper, lib }:
{ name, namePrefix ? "python-", src, meta, patches ? []
, doCheck ? true, checkPhase ? "python setup.py test"
, postInstall ? ""
, ... } @ attrs:
let
# Return the list of recursively propagated build inputs of PKG.
recursiveBuildInputs =
pkg:
[ pkg ] ++
(if pkg ? propagatedBuildNativeInputs
then lib.concatLists (map recursiveBuildInputs
pkg.propagatedBuildNativeInputs)
else []);
in
python.stdenv.mkDerivation (
# Keep extra attributes from ATTR, e.g., `patchPhase', etc.
attrs
//
(rec {
inherit src meta patches doCheck checkPhase;
name = namePrefix + attrs.name;
buildInputs = [ python setuptools makeWrapper ] ++
(if attrs ? buildInputs then attrs.buildInputs else []);
propagatedBuildInputs = [ setuptools ] ++
(if attrs ? propagatedBuildInputs
then attrs.propagatedBuildInputs
else []);
buildPhase = "true";
# XXX: Should we run `easy_install --always-unzip'? It doesn't seem
# to have a noticeable impact on small scripts.
installPhase = ''
ensureDir "$out/lib/${python.libPrefix}/site-packages"
echo "installing \`${name}' with \`easy_install'..."
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
easy_install --prefix="$out" .
${postInstall}
'';
postFixup = ''
# Wrap scripts that are under `{s,}bin/' so that they get the right
# $PYTHONPATH.
for i in "$out/bin/"* "$out/sbin/"*
do
if head -n1 "$i" | grep -q "${python}"
then
echo "wrapping \`$i'..."
# Compute a $PATH prefix for the program.
program_PATH=""
${lib.concatStrings
(map (path:
''if [ -d "${path}/bin" ]
then
program_PATH="${path}/bin'' + "\$" + ''{program_PATH:+:}$program_PATH"
fi
'')
(lib.concatMap recursiveBuildInputs propagatedBuildInputs))}
wrapProgram "$i" \
--prefix PYTHONPATH ":" \
${lib.concatStringsSep ":"
([ "$out/lib/${python.libPrefix}/site-packages" ] ++
(map (path: path + "/lib/${python.libPrefix}/site-packages")
(lib.concatMap recursiveBuildInputs
propagatedBuildInputs)))} \
--prefix PATH ":" "$program_PATH"
fi
done
# If a user installs a Python package, she probably also wants its
# dependencies in the user environment (since Python modules don't
# have something like an RPATH, so the only way to find the
# dependencies is to have them in the PYTHONPATH variable).
if test -e $out/nix-support/propagated-build-inputs; then
ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
fi
'';
}))