--- rebuild-formats 2006-10-29 14:49:00.451130216 +0800 +++ rebuild-formats.gentoo 2006-10-29 18:59:03.162120413 +0800 @@ -6,8 +6,9 @@ # ensure our entries are present in fmtutil.cnf fmtutil_cnf=`kpsewhich --format="web2c files" fmtutil.cnf` +cp --parents ${fmtutil_cnf} ${D} if [ "`fgrep -c xetex ${fmtutil_cnf}`" == "0" ]; then - cat >> ${fmtutil_cnf} <<-__EOT__; + cat >>${D}${fmtutil_cnf} <<-__EOT__; # XeTeX formats xetex xetex - *xetex.ini @@ -21,7 +22,7 @@ if [ -L ${texbin} ]; then texbin=`readlink ${texbin}` fi -texbindir=`dirname ${texbin}` +texbindir=${D}`dirname ${texbin}` # ensure ${texbindir} is in the PATH so that fmtutil can find new xetex # (normal usage may rely on a symlink, which doesn't yet exist) @@ -29,17 +30,29 @@ # patch fmtutil from teTeX 2.x so it doesn't confuse xetex with an etex engine # (discarding any error message in case we have teTeX 3 or an already-patched teTeX 2) -patch -N -r /tmp/fmtutilpatch.rej -p0 `which fmtutil` < fmtutil.tetex-2.patch >/dev/null 2>&1 +cp `which fmtutil` . +patch -N -r /tmp/fmtutilpatch.rej -p0 fmtutil < fmtutil.tetex-2.patch >/dev/null 2>&1 # use system-wide setup if available fmtutil=`type -p fmtutil-sys` || fmtutil=`type -p fmtutil` +# Remove magyar, russian and serbian from hyphenation patterns, +# because they don't currently work with xelatex. +# Make a local copy without them. + +sed -e 's/magyar/% magyar/' \ + -e 's/russian/% russian/' \ + -e 's/serbian/% serbian/' \ + `kpsewhich language.dat` \ + > language.dat + formats="xetex xelatex" for f in ${formats}; do # enable our entries if necessary (in case of pre-existing disabled ones) - ${fmtutil} --enablefmt ${f} - ${fmtutil} --byfmt ${f} + TEXMFLOCAL=${D}usr/share/texmf ./fmtutil --fmtdir `dirname ${D}${fmtutil_cnf}` --cnffile ${D}${fmtutil_cnf} --enablefmt ${f} + TEXMFLOCAL=${D}usr/share/texmf ./fmtutil --fmtdir `dirname ${D}${fmtutil_cnf}` --cnffile ${D}${fmtutil_cnf} --byfmt ${f} done # create symlinks for the newly-built formats -texlinks --silent +texlinks --silent --cnffile ${D}${fmtutil_cnf} `dirname ${D}${fmtutil_cnf}` +