From 0662fcbd23d1f522be6c126ff907eeeb53174dea Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 3 Feb 2010 13:04:12 +0000 Subject: [PATCH] * Fix teTeX on Glibc 2.11. svn path=/nixpkgs/branches/stdenv-updates/; revision=19781 --- pkgs/misc/tex/tetex/builder.sh | 22 ------- pkgs/misc/tex/tetex/default.nix | 26 +++++++-- pkgs/misc/tex/tetex/getline.patch | 96 +++++++++++++++++++++++++++++++ 3 files changed, 118 insertions(+), 26 deletions(-) delete mode 100644 pkgs/misc/tex/tetex/builder.sh create mode 100644 pkgs/misc/tex/tetex/getline.patch diff --git a/pkgs/misc/tex/tetex/builder.sh b/pkgs/misc/tex/tetex/builder.sh deleted file mode 100644 index 0611f6763472..000000000000 --- a/pkgs/misc/tex/tetex/builder.sh +++ /dev/null @@ -1,22 +0,0 @@ -source $stdenv/setup - -postUnpack=postUnpack -postUnpack() { - ensureDir $out/share/texmf - ensureDir $out/share/texmf-dist - gunzip < $texmf | (cd $out/share/texmf-dist && tar xvf -) -} - -configureFlags="\ - --disable-multiplatform \ - --without-x11 \ - --without-xdvik \ - --without-oxdvik \ - --without-texinfo \ - --without-texi2html \ - --with-system-zlib \ - --with-system-pnglib \ - --with-system-ncurses \ - " - -genericBuild diff --git a/pkgs/misc/tex/tetex/default.nix b/pkgs/misc/tex/tetex/default.nix index 9ff50dd5ab38..5e0fb38c3bd5 100644 --- a/pkgs/misc/tex/tetex/default.nix +++ b/pkgs/misc/tex/tetex/default.nix @@ -1,8 +1,7 @@ -{stdenv, fetchurl, flex, bison, zlib, libpng, ncurses, ed}: +{ stdenv, fetchurl, flex, bison, zlib, libpng, ncurses, ed }: stdenv.mkDerivation { name = "tetex-3.0"; - builder = ./builder.sh; src = fetchurl { url = ftp://cam.ctan.org/tex-archive/systems/unix/teTeX/current/distrib/tetex-src-3.0.tar.gz; @@ -14,12 +13,31 @@ stdenv.mkDerivation { md5 = "11aa15c8d3e28ee7815e0d5fcdf43fd4"; }; - buildInputs = [flex bison zlib libpng ncurses ed]; + buildInputs = [ flex bison zlib libpng ncurses ed ]; - patches = [./environment.patch]; + 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/misc/tex/tetex/getline.patch b/pkgs/misc/tex/tetex/getline.patch new file mode 100644 index 000000000000..c82c1b3ac360 --- /dev/null +++ b/pkgs/misc/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/. */ +