[Nix-dev] Re: [Nix-commits] SVN commit: nix - 15706 - ludo - in nixpkgs/trunk/pkgs: development/python-modules development/python-modules/generic top-level

Eelco Dolstra e.dolstra at tudelft.nl
Mon May 25 23:19:07 CEST 2009


Hi,

Ludovic Courts wrote:

> Log:
> Add a `buildPythonPackage' function.

Looks great, thanks :-)

This kind of construct:

> +    (if attrs ? buildInputs then attrs.buildInputs else []);

can be eliminated by writing the function as:

{ buildInputs ? []
, doCheck ? true
, ... # <-- literal "..."
} @ attrs:

Actually, since you don't have a " // attrs" in the mkDerivation call, you could
leave out the "..." and the "@ attrs".

> +          wrapProgram "$i"                          \
> +            --prefix PYTHONPATH ":"                 \
> +            ${lib.concatStringsSep ":"
> +               ([ "$out/lib/${python.libPrefix}/site-packages" ] ++
> +                (map (path: path + "/lib/${python.libPrefix}/site-packages")
> +                     (lib.concatMap recursiveBuildInputs
> +                                    propagatedBuildInputs)))}

It's more efficient to do this in shell code rather than in the Nix expression.
 In fact, $PYTHONPATH should contain all the propagated build inputs.  So I
think  that

  wrapProgram "$i" --prefix PYTHONPATH ":" $PYTHONPATH

should work.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/



More information about the nix-dev mailing list