`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
* libdbi / libdbi-drivers: updated to 0.8.3, and make it compile with
SQLite.
* qemu-image: fix the URL.
* gdmap: make it build again (requires an older GTK+).
* rlwrap: updated to 0.37.
* smbfs-fuse -> fusesmb to match the upstream name.
* x11vnc: updated to 0.9.10.
* clearlyU: fix the URL.
* Various packages: follow the coding conventions.
svn path=/nixpkgs/trunk/; revision=22814
The package is required for the regression test suite. Adding it to
buildInputs would probably work, too, but I haven't tried it.
svn path=/nixpkgs/trunk/; revision=22792
* Don't build with "-march=native", because the generated binaries
won't work reliably on systems with a different CPU. Instead,
"--march=i686" is used on x86, and "--march=nocona" an x86_64.
Otherwise, "--march" remains unset.
* Compile with -O3 instead of -O2. This code is performance-critical.
* Don't build with '-g'.
svn path=/nixpkgs/trunk/; revision=22785