|
root / base / fontconfig / build.sh
build.sh Bash 34 lines 1.2 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
# Build script for fontconfig (Meson, Template B).
# Uses libxml2 as the XML backend (PRESENT in base, /usr/lib) rather than
# expat, per the manifest's dependency line. gperf (devel/gperf) must be
# built/installed first - fontconfig's build uses it to generate perfect
# hash tables.
set -e
cd "$SRCDIR"

export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
export CFLAGS="${CFLAGS} -D__EXTENSIONS__"

# GOTCHA (Task 5): Meson does not set an rpath on the fc-cache/fc-list/
# fc-match consumer binaries by default, and /usr/local/lib is NOT on
# Hammerhead's default runtime ld.so search path (only /lib:/usr/lib -
# confirmed via `crle`). Without this, every installed binary fails at
# runtime with "libfontconfig.so.1: open failed". Force -R via LDFLAGS so
# meson's link step picks it up for all targets (libs + executables).
export LDFLAGS="${LDFLAGS} -Wl,-R,$PREFIX/lib"

meson setup build \
    --prefix="$PREFIX" \
    --libdir=lib \
    --sysconfdir="$SYSCONFDIR" \
    --buildtype=release \
    -Ddefault_library=shared \
    -Ddoc=disabled \
    -Dtests=disabled \
    -Dnls=disabled \
    -Dxml-backend=libxml2

ninja -C build -j${JOBS:-1}
DESTDIR="$PKGDIR" ninja -C build install