Linux HOWTOs

About | Home | Search


HOWTO: harfbuzz
Description: OpenType text shaping engine
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything


# HarfBuzz 2.0.2
# ==============
# Slackware 14.1: harfbuzz 0.9.16
# Slackware 14.2: harfbuzz 1.2.7
# (and check 'patches' for updates)

# If the web site link above ever stops working, try here:
# http://harfbuzz.org/

# If you ever have trouble with the repository link, it is also mirrored
# on GitHub:
# https://github.com/harfbuzz/harfbuzz

# Prerequisites:
# pkg-config >= 0.2.0
# GLib2 >= 2.10.0
# Cairo >= 1.8.0
#  + pixman
#  + EGL
# Fontconfig
# ICU (optional; Unicode library)
# FreeType
# Graphite2
# gtk-doc (included in Slackware's sgml-tools/linuxdoc-tools packages)
# If you see Uniscribe or DirectWrite anywhere, those are AFAIK Windows things
# If you see CoreText anywhere, that is AFAIK a macOS thing

# Get it
cd
test -f installed/harfbuzz-2.0.2.tar.bz2 &&
 mv -f installed/harfbuzz-2.0.2.tar.bz2 .
test ! -f ./harfbuzz-2.0.2.tar.bz2 &&
 wget https://www.freedesktop.org/software/harfbuzz/release/\
harfbuzz-2.0.2.tar.bz2

# Verify tarball w/ sha256sum:
echo "f6de6c9dc89a56909227ac3e3dc9b18924a0837936ffd9633d13e981bcbd96\
e0  harfbuzz-2.0.2.tar.bz2" | sha256sum -c

# Extract it
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "harfbuzz-*" -exec rm -r {} \;
tar xjvf ~/harfbuzz-2.0.2.tar.bz2
cd harfbuzz-2.0.2
test $UID = 0 && chown -R root:root .

# Read ./README, ./BUILD.md, ./INSTALL (it's the stock one)
# If this is an upgrade, read ./NEWS and/or ./ChangeLog

# If you do not have graphite2 installed, leave that off

# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
 ./configure --prefix=/usr --libdir=/usr/lib64 --with-graphite2

# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
 ./configure --prefix=/usr --with-graphite2

# Build it
make

# Check the build
make check

# Become root to install it
su

# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg harfbuzz

# Install it
make install
ldconfig

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again
exit

# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/harfbuzz-*.tar.*
mv harfbuzz-2.0.2.tar.bz2 installed/


# If you ever want to uninstall HarfBuzz, this should do it:
cd
su
test -d src/harfbuzz-* && ( cd src/harfbuzz-* ; make uninstall )
( cd /usr/bin
  rm -f hb-ot-shape-closure hb-shape hb-subset )
test -d /usr/include/harfbuzz && rm -r /usr/include/harfbuzz
for libdir in /usr/lib /usr/lib64;
do
  test -d $libdir &&
   ( cd $libdir
     rm -f libharfbuzz.la libharfbuzz-icu.* libharfbuzz-subset.* )
  test -d ${libdir}/cmake/harfbuzz && rm -f ${libdir}/cmake/harfbuzz
  test -d ${libdir}/pkgconfig &&
   ( cd ${libdir}/pkgconfig
     rm -f harfbuzz.pc harfbuzz-subset.pc harfbuzz-icu.pc )
done
test -d /usr/share/gtk-doc/html/harfbuzz &&
 rm -r /usr/share/gtk-doc/html/harfbuzz
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "harfbuzz-*" -exec rm -r {} \;
rm -f ~/installed/harfbuzz-*.tar.*

Back to the list


Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>