[XeTeX] building and installing xetex on a debian(like) system with teTeX 3.0

Ralf Stubner ralf.stubner at physik.uni-erlangen.de
Sat May 20 16:14:19 CEST 2006


Hi everybody,

I have successfully build and installed xetex on my Debian Sarge system
with teTeX 3.0 backports from <URL:http://www.backports.org>. I wanted
to share my experiences, since I had to deviate from the official
installation instructions on some points:

-----------------------
I haven't checked in detail the build dependencies. You will definitly
need libkpathsea-dev, libfreetype6-dev, libfontconfig1-dev, and
libmagick6-dev. There is a slight problem with libmagick6-dev in Debian
Sarge: xetex later on looks for an include file 'wand/magick-wand.h',
but in Debian Sarge there is only 'magick_wand.h' in /usr/include/wand.
I simply created a symbolic link

  /usr/include/wand/magick-wand.h -> magick_wand.h

and haven't encountered any problems so far. Be careful to remove this
link before updating libmagick6-dev to a version that provides
magick-wand.h, though!

-----------------------
I have checked out development versions directly from subversion:

$ svn checkout http://scripts.sil.org/svn-public/xetex/TRUNK xetex
$ svn checkout http://scripts.sil.org/svn-public/xdvipdfmx/TRUNK xdvipdfmx

This creates two directories xetex and xdvipdfmx with the current source
code. 

-----------------------
Building and installing xdvipdfmx was straigtforward:

$ cd xdvipdfmx
$ dpkg-buildpackage -rfakeroot
[time and lots of output passes]
$ sudo dpkg --purge dvipdfmx
$ sudo dpkg --install ../xdvipdfmx_0.1-1_i386.deb

I had to remove (actually purge) the dvipdfmx package, since xdvipdfmx
installs some files into the same location.

The configuration file /usr/share/texmf/dvipdfm/config/dvipdfmx.cfg does
not define any 'D ...' needed for automatic image conversion. One could
either edit that file or (better) copy it to /etc/texmf/dvipdfm/config/
and edit that copy.

(Note: with teTeX 3.0 in Debian /etc/texmf/ is defined as TEXMFSYSCONFIG
and is hence searched for input files.)

-----------------------
Buidling xetex wasn't that difficult either:

$ cd ../xetex
$ ./build-xetex
[time and lots of output passes]
Work/TeX/texk/web2c/xetex
$

In case build-xetex isn't executable, you could either change this with
'chmod a+x build-xetex' or use 'sh build-xetex'.

I then copied the 'xetex' binary to /usr/local/bin and created a link 

  usr/local/bin/xelatex -> xetex

In addition, I copied the pool file Work/TeX/texk/web2c/xetex.pool to
/usr/local/share/texmf/web2c. 

Using the install-xetex script or building a debian package with the
files in debian/ would not be a good idea, since some of the things done
there are geared toward a teTeX 3.0 system:

* debian/postinst and rebuild-formats patch fmtutil.cnf. At least for
  Debian with teTeX 3.0, fmtutil.cnf is generated from the files in
  /etc/texmf/fmt.d. So any changes to it could get lost. I therefore
  created an additional file in /etc/texmf/fmt.d:

$ cat /etc/texmf/fmt.d/10xetex.cnf 
# XeTeX formats
xetex   xetex   -       *xetex.ini
xelatex xetex   language.dat    *xelatex.ini

  Calling 'update-fmtutil' integrates these additions into fmtutil.cnf. 

* debian/postinst and rebuild-formats patch fmtutil itself. This is no
  longer necessary in teTeX 3.0. (There are no .efmt files and hence no
  need for that case statement.)

Now comes the interesting part: Where to place the files from the texmf
subdirectory. AFAIK the contend of texmf/scripts is only necessary on
OSX, hence I ignored that. texmf/doc and texmf/fonts can go straight to 
/usr/local/share/texmf/ (make sure not to copy all the '.svn'
directories). The content of texmf/tex is more interesting. First, there
are hypenation files in texmf/tex/generic/hyphen. These are equally
named as some allready installed hyphenation files. AFAIK they must not
be used together with a normal tex, though. (Is this correct?) Second,
there are input and configuration files for (La)TeX, some of them I
would not like to have in the search path for standard (La)TeX, eg,
geometry.cfg and hyperref.cfg set the driver to (h)dvipdfm.

AFAICT the standard install has no provision to separate the hyphenation
files. It tries to separate the other files by installing them in
TEXMF/tex/xetex and TEXMF/tex/xelatex. I am not sure if the former is a
good idea. The latter approach does not work with teTeX 3.0, since there
texmf.cnf contains:

% XeTeX
TEXINPUTS.xelatex = .;$TEXMF/tex/{latex,generic,}//
TEXINPUTS.xetex   = .;$TEXMF/tex/{plain,generic,}//
[...]
% Earlier entries override later ones, so put this last.
TEXINPUTS = .;$TEXMF/tex/{$progname,generic,}//

Hence xetex and xelatex would not look first into TEXMF/tex/xetex and
TEXMF/tex/xelatex. My solution here is a *really bad* one, since it is
against the spirit of TDS 1.1: I created a directory
/usr/local/share/texmf/xetex and put the things from generic, xetex, and
xelatex into generic, tex and latex directories below that. To have
these files found, I needed an addition to texmf.cnf, which is
automatically created from the files in /etc/texmf/texmf.d:

$ cat /etc/texmf/texmf.d/40XeTeX.cnf 
% this does not conform to TDS, but it helps to separate out 
% XeTeX spcific things

% XeTeX
TEXINPUTS.xelatex = .;$TEXMF/{xetex,tex}/{latex,generic,}//
TEXINPUTS.xetex   = .;$TEXMF/{xetex,tex}/{plain,generic,}//

'update-texmf' integrates these additions into the main texm.cnf. Note
that the number 40 in the file name is choosen such that these entries
come before the above quoted once.

Finally, one can update the filename database with 'mktexlsr' and try to
create the formats with

$ sudo fmtutil-sys --byfmt xetex
$ sudo fmtutil-sys --byfmt xelatex

I had some problems with the last step due to hungarian and serbian
hyphenation files. Since I din't wanted to remove these entries from
language.dat, I created the link

/usr/local/share/texmf/xetex/generic/hyphen/huhyphn.tex -> huhyph.tex

and created an empty file

/usr/local/share/texmf/xetex/generic/hyphen/srhyphc.tex

Not exactly clean solutions...

After that the formats could be created and now I am able to use 
xe(la)tex on Linux. :-)

-----------------------
This message has gotten way to long. I think what is needed is some sort
of separation of the hyphenation files. In configuration files like
geometry.cfg or hyperref.cfg one could shield the statements from normal
TeX using \@ifundefined{XeTeXversion}{..}{..}. That way much of the
above (including going against the spirit of TDS 1.1) would no longer be
necessary.

cheerio
ralf





More information about the XeTeX mailing list