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/
_______________________________________________
nix-dev mailing list
[email protected]
https://mail.cs.uu.nl/mailman/listinfo/nix-dev

Reply via email to