[Nix-dev] Customizing calibre PYTHONPATH to support plugins...

Eelco Dolstra eelco.dolstra at logicblox.com
Mon Mar 2 11:21:58 CET 2015


Hi,

On 28/02/15 19:10, Michael Alan Dorman wrote:

> I have a plugin for calibre I would like to use that requires pycrypto. 
> I looked at the derivation for calibre, and it seemed to me that it
> would be sufficient to override it thusly:
> 
>     calibre = pkgs.stdenv.lib.overrideDerivation pkgs.calibre (o: {
>       buildInputs = o.buildInputs ++ [ pythonPackages.pycrypto ];
>     });

Try this:

  calibre = pkgs.lib.overrideDerivation pkgs.calibre (o: {
    nativeBuildInputs = o.nativeBuildInputs ++ [ pkgs.pythonPackages.pycrypto ];
  });

This is necessary due to the confusing handling of buildInputs and
nativeBuildInputs in mkDerivation: when not doing a cross-build, buildInputs is
passed to the builder via the $nativeBuildInputs environment variable, and
$buildInputs is empty. It would be better if this remapping were done in the
builder itself so that overrideDerivation would work as expected.

-- 
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/


More information about the nix-dev mailing list