nixpkgs-suyu/pkgs/development/interpreters/python
Peter Simons 29588edfe1 python-wrapper: split 'extraLibs' into 'stdLibs' and 'extraLibs', and add 'postBuild' step
The default setting for extraLibs used to be the set of modules that come with
python by default but aren't usually enabled in our standard python derivation
because they require additional libraries. This meant that users who want to
*add* libraries to that set had to use a fairly complicated override, to add
more entries without loosing the ones set by default.

After this patch, the "standard libraries" such as "curses' are listed in
stdLibs while the extraLibs argument remains empty by default. This allows
users to override extraLibs without overriding the standard libraries.

Furthermore, the wrapper environment can be messed around with in an
additional 'postBuild' step. One nice application of this build step is
to patch scripts and binaries to use the wrapped python interpreter
instead of the pristine one, thereby enabling them to pick up all
modules that have been configured. The following example shows how this
is done for the 'pylint' utility:

  pkgs.python27Full.override {
    extraLibs = [pkgs.pylint];
    postBuild = ''
      cd ${pkgs.pylint}/bin
      for i in *; do
        rm $out/bin/$i
        sed -r -e "s|^exec |exec $out/bin/python -- |" <$i >$out/bin/$i
        chmod +x $out/bin/$i
      done;
    '';
  };
2013-11-07 15:13:02 +01:00
..
2.6 Reflect addition of curses_panel python module 2013-10-18 12:54:49 +04:00
2.7 Adding Glances system monitoring tool 2013-10-18 11:11:47 +04:00
3.2 recurse into python33 and pypy packages 2013-07-29 14:52:19 +02:00
3.3 recurse into python33 and pypy packages 2013-07-29 14:52:19 +02:00
docs pythonDocs: recurseIntoAttrs does not recurse, bypass problem 2013-03-13 13:16:03 +01:00
python-linkme-wrapper.nix python-linkme-wrapper 2013-01-22 15:28:30 +01:00
python-linkme-wrapper.sh python: fix linkme-wrapper 2013-02-15 06:14:58 +01:00
wrapper.nix python-wrapper: split 'extraLibs' into 'stdLibs' and 'extraLibs', and add 'postBuild' step 2013-11-07 15:13:02 +01:00