# Prerequisites:
# Python (for Meson build system)
# Ninja
# zlib (for PDF, Postscript)
# pkg-config
# pixman >= 0.30.0
# XFree86 or X.org (optional)
# Quartz is MacOS X
# libpng (preferred)
# freetype >= 2.1.9 (required)
# fontconfig (required)
# Ghostscript (--enable-ps) (for the PostScript backend)
# libspectre
# poppler >= 0.8.0,
# and GTK+'s GDK (for the PDF backend)
# librsvg >= 2.15.0 (for SVG backend test)
# gtk-doc > 1.3 (found in Slackware's sgml-tools/linuxdoc-tools packages; pass --enable-gtk-doc to use)
#
# Backends that have to be enabled with a configure flag:
# XCB: XCB (--enable-xcb)
# glitz: glitz (--enable-glitz)
# DirectFB: directfb (--enable-directfb)
# If you want to uninstall Cairo or remove an old version before installing
# this one, skip down to the bottom.
# NOTE: As of the November 28, 2006 update to this howto, we use the /usr
# prefix instead of /usr/local. If you have a Cairo installed under
# /usr/local, skip to the bottom to uninstall your old version before you
# proceed. ('make uninstall' as root in a configured Cairo source)
# Be aware that you may need to rebuild things that use Cairo
# after doing this:
# poppler
# pango
# goffice
# Evolution
# any howto of mine with cairo in it's name, any with cairo as a
# prerequisite...
#
# This will tell you what libtool .la files are set with libcairo's old
# location:
# grep '/usr/local/lib*/libcairo.la' /usr/lib*/*.la | cut -d':' -f1
# libspectre uses Cairo and Cairo uses libspectre, so if you want
# each to support the other, build one, build the other, and build the
# first one again.
# Poppler won't build poppler-glib without Cairo, and Cairo won't build
# Poppler support without poppler-glib, so just keep compiling and
# installing each of them until configure says yes :-)
# Install/upgrade Python's pip and the Meson build system
su
python3 -m pip install -U pip
python3 -m pip install -U meson
exit
# Get the tarball
cd
test -f installed/cairo-1.18.0.tar.xz && mv installed/cairo-1.18.0.tar.xz .
test ! -f cairo-1.18.0.tar.xz &&
wget https://cairographics.org/releases/cairo-1.18.0.tar.xz
# Get the sha256sum file
# 243a0736b978a33dee29f9cca7521733b78a65b5418206fef7bd1c3d4cf10b64
wget -nc https://cairographics.org/releases/\
cairo-1.18.0.tar.xz.sha256sum
## It may say this:
# Run-time dependency gtk+-2.0 found: NO (tried pkgconfig and cmake)
## even though you have GTK+-2.0 installed, if the gtk2-utils feature is
## disabled
# Configure it with Meson (which uses Ninja
meson setup build --prefix=/usr --libdir=/usr/lib64
# Build it
ninja -C build
# Become root to install it
# Your 'su' may require -p to have $USER set, don't even guess and
# just use 'logname' below
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg cairo
# Remove old library files if you are _sure_ they are not needed
rm -f /usr/lib*/libcairo.*
# Install it
ninja -C build 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/cairo-*.tar.*
mv cairo-1.18.0.tar.xz installed/
# If you ever want to uninstall Cairo, this should do it:
cd
su
test -d src/cairo-* && ( cd src/cairo-* ; ninja -C build uninstall )
for pfx in /usr /usr/local;
do
cd $pfx
test -d include/cairo && rm -r include/cairo
test -d share/gtk-doc/html/cairo && rm -r share/gtk-doc/html/cairo
for libdir in ${pfx}/lib ${pfx}/lib64;
do
test ! -d $libdir && continue
cd $libdir
rm -f libcairo.*
test -d pkgconfig &&
( cd pkgconfig
rm -f cairo.pc cairo-fc.pc cairo-ft.pc cairo-pdf.pc cairo-png.pc \
cairo-ps.pc cairo-script.pc cairo-svg.pc )
done
done
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "cairo-*" -exec rm -r {} \;
rm -f ~/installed/cairo-*.tar.*