Comment 3 for bug 221065

Revision history for this message
In , Mhopf-suse (mhopf-suse) wrote :

Created an attachment (id=2511)
Helper program for creating global cache files

This tool creates a cache file for a given locale and compose file.
Unfortunately, due to the way XIM is integrated into libX11, a Xserver
has to be running in order to create a cache. If somebody sees a clearer
way to deal with this you're very welcome to change it.

For distributors I also add an example script below that shows how global cache

files for the three UTF8 compose tables can created using Xvfb. This is only a
skeleton, though.

Currently paths are hardcoded. Also note that compose tables for non-UTF8
locales currently shouldn't be cached globaly, as the encoding may differ
with different locales. This is something to be addressed.

------> CUT <-------
#!/bin/sh

if [ $# -gt 1 ]; then
  echo "$0 [x11-root]"
  exit 0
fi

if [ $# -eq 1 ]; then
  ROOT=$1
fi

mkdir -p $ROOT/var/X11R6/compose-cache

tmpfile=$(mktemp /tmp/Xvfb.log.XXXXXXXXXX)
$ROOT/usr/X11R6/bin/Xvfb \
  -fp $ROOT/usr/X11R6/lib/X11/fonts/misc/ \
  -sp $ROOT/etc/X11/xserver/SecurityPolicy \
  -co $ROOT/usr/X11R6/lib/X11/rgb \
  :99 &> $tmpfile &
trap "kill $!; rm $tmpfile || true" EXIT

export DISPLAY=:99
export LD_LIBRARY_PATH=$ROOT/usr/X11R6/lib64:$ROOT/usr/X11R6/lib
export XLOCALEDIR=$ROOT/usr/X11R6/lib/X11/locale/
sleep 5
$ROOT/usr/X11R6/bin/xbiff &> /dev/null &

pushd $ROOT/

usr/X11R6/bin/mkcomposecache "en_US.UTF-8"
"usr/X11R6/lib/X11/locale/en_US.UTF-8/Compose" "var/X11R6/compose-cache"
"/usr/X11R6/lib/X11/locale/en_US.UTF-8/Compose"
usr/X11R6/bin/mkcomposecache "pt_BR.UTF-8"
"usr/X11R6/lib/X11/locale/pt_BR.UTF-8/Compose" "var/X11R6/compose-cache"
"/usr/X11R6/lib/X11/locale/pt_BR.UTF-8/Compose"
usr/X11R6/bin/mkcomposecache "el_GR.UTF-8"
"usr/X11R6/lib/X11/locale/el_GR.UTF-8/Compose" "var/X11R6/compose-cache"
"/usr/X11R6/lib/X11/locale/el_GR.UTF-8/Compose"

popd

chmod 444 $ROOT/var/X11R6/compose-cache/*