1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-23 14:11:36 +00:00
nixpkgs/pkgs/top-level
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
..
all-packages.nix * Use callPackage for most packages in all-packages.nix. 2010-08-02 16:26:58 +00:00
guile-2-test.nix guile-2-test: Remove `guile_1_9_coverage'. 2010-07-04 21:53:01 +00:00
haskell-packages.nix Switched the default version of ghc and Haskell Platform to 6.12.3 and 2010.2.0.0. 2010-07-22 18:47:59 +00:00
make-tarball.nix typo 2010-05-18 08:39:31 +00:00
mingw.nix * Remove execute permission. 2006-09-11 13:37:46 +00:00
perl-packages.nix update ikiwiki and fix its dependencies. 2010-07-09 13:16:00 +00:00
platforms.nix Making the sheevaplug kernel have nfs4 server and client 2010-06-12 17:42:17 +00:00
python-packages.nix pkgs/top-level/python-packages.nix: added python-mock-0.6.0 2010-07-28 13:09:04 +00:00
release-cross.nix Attempt to cross-build Nix for GNU. 2010-06-22 13:02:31 +00:00
release-lib.nix * A quick hack to make release.nix evaluate in a reasonable amount of 2010-05-25 10:35:14 +00:00
release.nix Minor fix for release.nix. 2010-07-22 18:55:32 +00:00