Hi,

Michael Raskin wrote:

Added:
   nixpkgs/trunk/pkgs/misc/tex/texlive/
   nixpkgs/trunk/pkgs/misc/tex/texlive/default.nix
   nixpkgs/trunk/pkgs/misc/tex/texlive/setup-hook.sh

Log:
Added TeXLive; still some troubles with texmf; just not to break nix-env -qas *

Cool :-)  We can't stay on teTeX forever...

However, I have some problems with the Nix expression (https://svn.cs.uu.nl:12443/viewvc/trace/nixpkgs/trunk/pkgs/misc/tex/texlive/default.nix?revision=11216&view=markup&pathrev=11216):

- It is not indented in the proper way (and it uses tabs...). For instance, the big "let localDefs" is indented, which it shouldn't be, and readability would be improved by separating the let-block from the surrounding code with empty lines.

- There is one gigantic doInstall phase. Why not use the generic builder in the right way? (Or is that because of texmfSrc?)

- I don't understand all the strange "null" values, e.g. in "with builderDefs {src="";} null;" (and what does src="" do anyway?) and in "let localDefs = builderDefs (rec { ... }) args null; /* null is a terminator for sumArgs */".

- What does FullDepEntry do?

- Why is configureFlags set to [], but then configure is called with a long of arguments?

- Why does "meta" have "src" and "srcs" attributes?

- For consistency, don't put a "." at the end of the description, and write it on one line, i.e.

    meta = {
      description = "A TeX distribution";
    };

(BTW, "description" is intended for one-line descriptions on the Nixpkgs release page, but maybe we could also use an attribute for longer descriptions.)

- Is the line

    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${stdenv.glibc}/include"

really needed? The Glibc includes should be found by default, and don't exist anyway on non-Linux platforms.

To reflect on the whole builderDefs / FullDepEntry / textClosure / null arguments style: it looks to me significantly more complicated than the old style of writing Nix expressions, compare e.g. the TeXLive expression to the teTeX expression (https://svn.cs.uu.nl:12443/repos/trace/nixpkgs/trunk/pkgs/misc/tex/tetex/default.nix). There is a lot of duplicated code between expressions written in the style, which suggests that some abstraction is in order: if you find yourself writing (or cutting&pasting) the same code over and over, then it's time to put the commonality in a function...

--
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