* Fix teTeX on Glibc 2.11.

svn path=/nixpkgs/branches/stdenv-updates/; revision=19781
This commit is contained in:
Eelco Dolstra 2010-02-03 13:04:12 +00:00
parent 3687f56e7a
commit 0662fcbd23
3 changed files with 118 additions and 26 deletions

View file

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

View file

@ -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";
};

View file

@ -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/. */