|
root / base / cairo / build.sh
build.sh Bash 33 lines 1.1 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
#!/bin/sh
# Build script for cairo (Meson, Template B).
# Deps: pixman, freetype, fontconfig, libpng, libX11, libXext, libXrender
# (all ported, M2/M3a), glib2 (this task, above).
set -e
cd "$SRCDIR"

export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
# GOTCHA (Task 6, same class as glib2): illumos's <time.h> gates the
# POSIX 2-arg ctime_r()/asctime_r() prototypes behind
# _POSIX_C_SOURCE>=199506L || _POSIX_PTHREAD_SEMANTICS, same as
# getpwnam_r/getpwuid_r in <pwd.h>. Without it, cairo-ps-surface.c's
# 3-arg ctime_r() call ("too few arguments") fails against the POSIX
# 2-arg prototype that __EXTENSIONS__ alone leaves selected.
export CFLAGS="${CFLAGS} -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS"
export LDFLAGS="${LDFLAGS} -Wl,-R,$PREFIX/lib"

meson setup build \
    --prefix="$PREFIX" \
    --libdir=lib \
    --buildtype=release \
    -Ddefault_library=shared \
    -Dxlib=enabled \
    -Dxcb=enabled \
    -Dtests=disabled \
    -Dglib=enabled \
    -Dfreetype=enabled \
    -Dfontconfig=enabled \
    -Dpng=enabled

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