nixpkgs/pkgs
Eelco Dolstra d17f0f9cbc * Use callPackage for most packages in all-packages.nix.
`callPackage' was described here:

    http://www.mail-archive.com/nix-dev@cs.uu.nl/msg02624.html

  It allows all-packages.nix to be shortened significantly (from 10152
  to 6980 lines) by automatically filling in package functions'
  required arguments from `pkgs'.  That is, a function

    { stdenv, fetchurl, libfoo, libbar }: ...

  can now be called as

    callPackage ./<bla>.nix { };

  rather than

    import ./<bla>.nix {
      inherit stdenv fetchurl libfoo libbar;
    };

  This reduces boring typing work when adding a dependency and reduces
  the number of trivial commits to all-packages.nix.

  Overrides or arguments that don't exist in `pkgs' can be passed
  explicitly, e.g.,

    callPackage ./<bla>.nix {
      libfoo = libfoo_1_2_3;
    };

  The conversion was done automatically with a magic Perl regexp.  I
  checked that `nix-env' produces the same results before and after
  (except for three packages that depend on webkit, which uses
  deepOverride).

  `callPackage' applies `makeOverridable' automatically, so almost
  every package now exports an `override' function.

  There are two downsides to using callPackage:

  - Evaluation is a bit slower (about 15% on `nix-env -qa --drv-path
    \*').

  - There can be unexpected results for functions that have default
    argument values.  For instance, a function

      { libfoo ? null }: ...

    called using `callPackage' will be passed a `libfoo' argument
    provided that `pkgs.libfoo' exists.  If this is used to control
    whether a package has to have a certain dependency, you need to
    explicitly write:

    callPackage ./<bla>.nix {
      libfoo = null;
    };

svn path=/nixpkgs/trunk/; revision=22885
2010-08-02 16:26:58 +00:00
..
applications svn path=/nixpkgs/trunk/; revision=22880 2010-08-02 16:01:55 +00:00
build-support * More cleanup. 2010-07-28 15:35:01 +00:00
data * ltrace: updated to 0.5.3. 2010-07-29 18:55:16 +00:00
desktops Bumped eigen library to version 2.0.15 2010-07-29 13:14:51 +00:00
development svn path=/nixpkgs/trunk/; revision=22874 2010-08-02 12:55:54 +00:00
games svn path=/nixpkgs/trunk/; revision=22839 2010-08-01 15:14:33 +00:00
lib Moved 'zip' function from nixos/lib/build-vms.nix 2010-08-02 16:10:01 +00:00
misc Update Wine 2010-08-02 10:02:23 +00:00
os-specific * Add callPackage etc. 2010-08-02 13:57:57 +00:00
servers pulseaudio: udev and bluez support 2010-07-31 13:05:58 +00:00
shells * Added dash. 2010-06-01 17:05:29 +00:00
stdenv Move "fetchurl restricted" code to requireFile. 2010-05-03 09:13:17 +00:00
test Add a new way to handle option sets. 2008-08-05 17:16:35 +00:00
tools pkgs/tools/networking/nbd: install the README file to $out/share/doc 2010-08-02 13:37:36 +00:00
top-level * Use callPackage for most packages in all-packages.nix. 2010-08-02 16:26:58 +00:00