The package has a bug to prevent it from installing successfully on Ubuntu 22, because the wrong version of harfbuzz it's compiled on.
The default installed libharfbuzz version is 2.7.4, and at the post installation script of xetex package, running fmtutil generating all formats, xelatex requires the function hb_graphite2_font_get_gr_font, which is depreciated since 1.4.3, and luahbtex requires function hb_face_get_table_tags, which is provided since 1.6.0, please read it
at https://github.com/harfbuzz/harfbuzz/blob/main/NEWS and https://harfbuzz.github.io/harfbuzz-hb-graphite2.html .
So I modified the post installation script of tex-common package at /var/lib/dpkg/info/tex-common.postinst
to skip errors , compiled harfbuzz-1.4.2 at /usr/local/harfbuzz-1.4.2
with --with-graphite2=yes
,
cd /root
apt-get install ragel
wget https://github.com/harfbuzz/harfbuzz/archive/refs/tags/1.4.2.tar.gz
tar -xzvf 1.4.2.tar.gz
cd harfbuzz-1.4.2
./autogen.sh
./configure --prefix '/usr/local/harfbuzz-1.4.2' --with-graphite2=yes
make
make install
and generated formats for xelatex by hand, by pointing LD_LIBRARY_PATH to harfbuzz-1.4.2, and running the three commands:
export PATH=/usr/local/harfbuzz-1.4.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/harfbuzz-1.4.2/lib:$LD_LIBRARY_PATH
cd /var/lib/texmf/web2c/xetex
xetex -ini -jobname=xetex -progname=xetex -etex xetex.ini
xetex -ini -jobname=xelatex -progname=xelatex -etex xelatex.ini
xetex -ini -jobname=xelatex-dev -progname=xelatex-dev -etex xelatex.ini
Here's the function modified to skip format generation errors:
dhit_build_format ()
{
# Added by Jean 2024/5/15 to skip xetex format building,
# Because xetex needs harfbuzz<=1.4.2, and luahbtex needs harfbuzz>=1.6.0
# Skip format building errors for specific engines
echo "Called dhit_build_format with parameters: $@"
tempfile=$(mktemp -p /tmp fmtutil.XXXXXXXX)
# save LANG
LANGSAVE=$LANG
LANG=C
printf "Building format(s) $*.\n\tThis may take some time... "
if $FMTUTIL "$@" > $tempfile 2>&1 ; then
rm -f $tempfile
LANG=$LANGSAVE
echo "done."
else
# exec >&2
LANG=$LANGSAVE
echo
echo "fmtutil failed. Output has been stored in"
echo "$tempfile"
echo "Please include this file if you report a bug."
echo
# exit 1
fi
}
Hope that this bug will be fixed in future releases.
Thanks!
Anonymous
Addressed by compiling the newest harfbuzz-8.5.0 with the "--with-graphite2=yes" option, and pointing LD_LIBRARY_PATH to harfbuzz-8.5.0's installation path.
According to Karl Berry's reply from the tex-k mailing list:
It seems that the harfbuzz-2.7.4 installed by Ubuntu 22 by default is compiled without support of deprciated APIs of Graphite2.
Thanks for the kind help of Karl.
Best respects.
Jean
Glad you found a way through, Jean.
Closing this at Karl's request.