|
root / base / imlib2 / build.sh
build.sh Bash 42 lines 1.8 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
34
35
36
37
38
39
40
41
#!/bin/sh
# Build script for imlib2 (autotools, Template A).
# NOTE: imlib2's optional loaders (gif/tiff/webp/heif/jxl/...) are each
# auto-probed via AC_CHECK_LIB/pkg-config in configure.ac - there are no
# --without-<format> flags to pass. Since none of those libs are ported to
# Hammerhead yet, the loaders auto-disable and only png/jpeg (both present)
# get built.
#
# REVISED (Task 1b-3, 2026-07-22): originally built --without-x on the
# assumption that "X11 client apps link libX11 themselves" - WRONG. imlib2's
# X11 support (gated by AC_PATH_XTRA/BUILD_X11) is not just SHM plumbing; it
# ships the imlib_context_set_{display,visual,colormap,drawable}() /
# imlib_render_image_on_drawable*() / imlib_create_image_from_drawable() API
# that feh (wallpaper-setting) and other imlib2 consumers (tint2's
# IMLIB2>=1.4.2 dep) call directly. --without-x drops those symbols entirely,
# so feh failed to link ("undefined reference to imlib_context_set_drawable"
# etc). Enable X11 support instead (needs no explicit flag - AC_PATH_XTRA
# auto-detects libX11 under $PREFIX via the CFLAGS/LDFLAGS -I/-L already
# exported below).
set -e
cd "$SRCDIR"

# MANDATORY libtool fix - see Template A comment in DESKTOP_XLIBRE_PHASE1A_PLAN.md.
if [ -f configure ]; then
    sed -i -E 's/(kopensolaris\*-gnu)([^)]*\))/\1 | hammerhead*\2/' configure
fi

export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:$PREFIX/share/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH"
export CFLAGS="${CFLAGS} -I$PREFIX/include -D__EXTENSIONS__ -D_POSIX_PTHREAD_SEMANTICS"
export LDFLAGS="${LDFLAGS} -L$PREFIX/lib -R$PREFIX/lib"

./configure \
    --prefix="$PREFIX" \
    --build="$BUILD_TRIPLE" \
    --host="$BUILD_TRIPLE" \
    --sysconfdir="$SYSCONFDIR" \
    --disable-static \
    --with-x

gmake -j${JOBS:-1}
gmake install DESTDIR="$PKGDIR"