Menu

#200 Bug: texlive-xetex/jammy,now 2021.20220204-1 all on Ubuntu 22 requires harfbuzz-1.4.2

Future
closed
nobody
None
5
2024-05-21
2024-05-18
Jean Ye
No

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!

Discussion

  • Anonymous

    Anonymous - 2024-05-21

    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.

    cd /root
    apt-get install ragel
    wget https://github.com/harfbuzz/harfbuzz/releases/download/8.5.0/harfbuzz-8.5.0.tar.xz
    tar -xvf harfbuzz-8.5.0.tar.xz
    cd harfbuzz-8.5.0
    ./configure --prefix '/usr/local/harfbuzz-8.5.0'   --with-graphite2=yes
    make
    make install
    export PATH=/usr/local/harfbuzz-8.5.0/bin:$PATH
    export LD_LIBRARY_PATH=/usr/local/harfbuzz-8.5.0/lib:$LD_LIBRARY_PATH
    

    According to Karl Berry's reply from the tex-k mailing list:

    Looking at https://sourceforge.net/p/xetex/bugs/200/, this seems
    Ubuntu-specific. You need to ask them to figure out the harfbuzz
    versions needed.  For upstream TL, we are currently compiling xetex with
    harfbuzz 8.5.0.  Harfbuzz 1.4.x was released in 2017.
    
    The tex-common.postinst script is likewise Ubuntu-specific.
    
    I know that the hb_graphite2_font_get_gr_font fn is "deprecated"
    (painfully), but it is still provided in the library. Therefore we
    haven't changed the code (a patch would be welcome; I don't know what
    would be involved). If Ubuntu is explicitly compiling harfbuzz without
    including deprecated functions, well, all I can say is, that causes
    unnecessary trouble.
    

    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

     
  • karl berry

    karl berry - 2024-05-21

    Glad you found a way through, Jean.

     
  • Jonathan Kew

    Jonathan Kew - 2024-05-21
    • status: open --> closed
     
  • Jonathan Kew

    Jonathan Kew - 2024-05-21

    Closing this at Karl's request.

     

Anonymous
Anonymous

Add attachments
Cancel