From b69d6bf7e099a6d8e5bec8dd2a1d337d3fcd4a3b Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Sat, 4 Feb 2012 09:31:07 +0000 Subject: Moved all LaTeX expressions into tools/typesetting hierarchy. svn path=/nixpkgs/trunk/; revision=32028 --- pkgs/tools/typesetting/tex/tetex/default.nix | 44 ++++++++++ pkgs/tools/typesetting/tex/tetex/environment.patch | 35 ++++++++ pkgs/tools/typesetting/tex/tetex/getline.patch | 96 ++++++++++++++++++++++ pkgs/tools/typesetting/tex/tetex/setup-hook.sh | 7 ++ 4 files changed, 182 insertions(+) create mode 100644 pkgs/tools/typesetting/tex/tetex/default.nix create mode 100644 pkgs/tools/typesetting/tex/tetex/environment.patch create mode 100644 pkgs/tools/typesetting/tex/tetex/getline.patch create mode 100644 pkgs/tools/typesetting/tex/tetex/setup-hook.sh (limited to 'pkgs/tools/typesetting/tex/tetex') diff --git a/pkgs/tools/typesetting/tex/tetex/default.nix b/pkgs/tools/typesetting/tex/tetex/default.nix new file mode 100644 index 000000000000..5e0fb38c3bd5 --- /dev/null +++ b/pkgs/tools/typesetting/tex/tetex/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchurl, flex, bison, zlib, libpng, ncurses, ed }: + +stdenv.mkDerivation { + name = "tetex-3.0"; + + src = fetchurl { + url = ftp://cam.ctan.org/tex-archive/systems/unix/teTeX/current/distrib/tetex-src-3.0.tar.gz; + md5 = "944a4641e79e61043fdaf8f38ecbb4b3"; + }; + + texmf = fetchurl { + url = ftp://cam.ctan.org/tex-archive/systems/unix/teTeX/current/distrib/tetex-texmf-3.0.tar.gz; + md5 = "11aa15c8d3e28ee7815e0d5fcdf43fd4"; + }; + + buildInputs = [ flex bison zlib libpng ncurses ed ]; + + patches = [ ./environment.patch ./getline.patch ]; + + setupHook = ./setup-hook.sh; + + configureFlags = + [ "--disable-multiplatform" + "--without-x11" + "--without-xdvik" + "--without-oxdvik" + "--without-texinfo" + "--without-texi2html" + "--with-system-zlib" + "--with-system-pnglib" + "--with-system-ncurses" + ]; + + postUnpack = + '' + ensureDir $out/share/texmf + ensureDir $out/share/texmf-dist + gunzip < $texmf | (cd $out/share/texmf-dist && tar xvf -) + ''; + + meta = { + description = "A full-featured (La)TeX distribution"; + }; +} diff --git a/pkgs/tools/typesetting/tex/tetex/environment.patch b/pkgs/tools/typesetting/tex/tetex/environment.patch new file mode 100644 index 000000000000..6e652849b773 --- /dev/null +++ b/pkgs/tools/typesetting/tex/tetex/environment.patch @@ -0,0 +1,35 @@ +diff -rc --exclude=texmf.in tetex-src-3.0.orig/texk/kpathsea/texmf.in-teTeX tetex-src-3.0/texk/kpathsea/texmf.in-teTeX +*** tetex-src-3.0.orig/texk/kpathsea/texmf.in-teTeX 2006-01-27 17:33:11.000000000 +0100 +--- tetex-src-3.0/texk/kpathsea/texmf.in-teTeX 2006-01-27 17:38:35.000000000 +0100 +*************** +*** 104,109 **** +--- 104,115 ---- + % TEXMFCONFIG = @texmf@-config + TEXMFCONFIG = $HOME/.texmf-config + ++ % TEXMFNIX is supposed to be unset. It's used by the Nix ++ % system to add trees during the build of nix-expressions. ++ ++ % TEXMFNIXHOME, for packages in the user environment. ++ TEXMFNIXHOME = $HOME/.nix-profile/share/texmf-nix ++ + % Now, list all the texmf trees. If you have multiple trees you can + % use shell brace notation, like this: + % TEXMF = {$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFMAIN} +*************** +*** 111,117 **** + % + % For texconfig to work properly, TEXMFCONGIG and TEXMFVAR should be named + % explicitly and before all other trees. +! TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST} + + % The system trees. These are the trees that are shared by all the users. + SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST +--- 117,123 ---- + % + % For texconfig to work properly, TEXMFCONGIG and TEXMFVAR should be named + % explicitly and before all other trees. +! TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFNIX,$TEXMFHOME,$TEXMFNIXHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST} + + % The system trees. These are the trees that are shared by all the users. + SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST diff --git a/pkgs/tools/typesetting/tex/tetex/getline.patch b/pkgs/tools/typesetting/tex/tetex/getline.patch new file mode 100644 index 000000000000..c82c1b3ac360 --- /dev/null +++ b/pkgs/tools/typesetting/tex/tetex/getline.patch @@ -0,0 +1,96 @@ +Glibc 2.10 has a `getline' symbol that clashes with teTeX's. +Taken from http://lists.ibiblio.org/pipermail/sm-commit/2009-July/024831.html + +diff -rc -x '*~' tetex-src-3.0-orig/texk/dvipsk/afm2tfm.c tetex-src-3.0/texk/dvipsk/afm2tfm.c +*** tetex-src-3.0-orig/texk/dvipsk/afm2tfm.c 2005-01-30 14:17:09.000000000 +0100 +--- tetex-src-3.0/texk/dvipsk/afm2tfm.c 2010-02-03 13:50:21.000000000 +0100 +*************** +*** 257,263 **** + } + + int +! getline P1H(void) { + register char *p ; + register int c ; + +--- 257,263 ---- + } + + int +! tetex_getline P1H(void) { + register char *p ; + register int c ; + +*************** +*** 606,612 **** + ai = newchar() ; + ai->adobenum = -1 ; + ai->adobename = "||" ; /* boundary character name */ +! while (getline()) { + switch(interest(paramstring())) { + case FontName: + fontname = paramnewstring() ; +--- 606,612 ---- + ai = newchar() ; + ai->adobenum = -1 ; + ai->adobename = "||" ; /* boundary character name */ +! while (tetex_getline()) { + switch(interest(paramstring())) { + case FontName: + fontname = paramnewstring() ; +*************** +*** 1882,1888 **** + + while (1) { + while (param == 0 || *param == 0) { +! if (getline() == 0) + error("! premature end in encoding file") ; + for (p=buffer; *p; p++) + if (*p == '%') { +--- 1882,1888 ---- + + while (1) { + while (param == 0 || *param == 0) { +! if (tetex_getline() == 0) + error("! premature end in encoding file") ; + for (p=buffer; *p; p++) + if (*p == '%') { +*************** +*** 1973,1979 **** + p = gettoken() ; + if (strcmp(p, "]")) + error("! token 258 in encoding must be make-array (])") ; +! while (getline()) { + for (p=buffer; *p; p++) + if (*p == '%') { + if (ignoreligkern == 0) +--- 1973,1979 ---- + p = gettoken() ; + if (strcmp(p, "]")) + error("! token 258 in encoding must be make-array (])") ; +! while (tetex_getline()) { + for (p=buffer; *p; p++) + if (*p == '%') { + if (ignoreligkern == 0) +diff -rc -x '*~' tetex-src-3.0-orig/texk/web2c/cpascal.h tetex-src-3.0/texk/web2c/cpascal.h +*** tetex-src-3.0-orig/texk/web2c/cpascal.h 2004-08-28 22:49:59.000000000 +0200 +--- tetex-src-3.0/texk/web2c/cpascal.h 2010-02-03 13:51:04.000000000 +0100 +*************** +*** 240,245 **** +--- 240,255 ---- + #undef getname + #define getname vms_getname + #endif ++ ++ /* Apparently POSIX 2008 has getline and glibc 2.9.90 exports it. ++ * tangle, weave, et al. use that symbol; try to define it away so ++ * something that a standard won't usurp. ++ * From http://tutimura.ath.cx/ptetex/?%C6%B0%BA%EE%CA%F3%B9%F0%2F134 */ ++ #ifdef getline ++ #undef getline ++ #endif ++ #define getline web2c_getline ++ + + /* Declarations for the routines we provide ourselves in lib/. */ + diff --git a/pkgs/tools/typesetting/tex/tetex/setup-hook.sh b/pkgs/tools/typesetting/tex/tetex/setup-hook.sh new file mode 100644 index 000000000000..d79c4fae4196 --- /dev/null +++ b/pkgs/tools/typesetting/tex/tetex/setup-hook.sh @@ -0,0 +1,7 @@ +addTeXMFPath () { + if test -d "$1/share/texmf-nix"; then + export TEXINPUTS="${TEXINPUTS}${TEXINPUTS:+:}$1/share/texmf-nix//:" + fi +} + +envHooks=(${envHooks[@]} addTeXMFPath) -- cgit 1.4.1