7.7. gettext-tiny 0.3.3

gettext-tiny provides lightweight gettext tooling for builds in chroot, including msgfmt and a musl-compatible libintl flavor.

Input assumption: gettext-tiny-0.3.3.tar.xz is already present in /sources from the chapter 4 source staging step.

Licenses:

Dependencies:

gettext-tiny is a lightweight replacement for key GNU gettext tools and libintl compatibility pieces. we need it to provide msgfmt and musl-friendly libintl compatibility for package builds inside chapter 7 chroot.

Extract and Enter the Source Tree

cd /sources
tar -xf gettext-tiny-0.3.3.tar.xz
cd gettext-tiny-0.3.3

Patch the install symlink rule for BSD install

The upstream install rule uses install -l for symlinks, but BSD install does not support that option. Replace that line with a normal directory creation plus ln -sf.

awk '
/^[[:space:]]*\$\(INSTALL\) -D -l / {
    print "\tmkdir -p $(patsubst %m4/,%,$(dir $@))"
    print "\tln -sf ../$(subst $(datarootdir)/,,$(datadir))/$< $(patsubst %m4/,%,$(dir $@))/$(notdir $@)"
    next
}
{ print }
' Makefile > Makefile.new
mv Makefile.new Makefile

Build gettext-tiny

make $LWI_MAKE_FLAGS \
    LIBINTL=musl \
    CPPFLAGS="-I/system/headers" \
    CFLAGS="-I/system/headers" \
    LDFLAGS="-L/system/libraries" \
    CC="cc -B/system/libraries -B/system/libraries/clang/22/lib/linux"

Install gettext-tiny

make $LWI_MAKE_FLAGS \
    LIBINTL=musl \
    CPPFLAGS="-I/system/headers" \
    CFLAGS="-I/system/headers" \
    LDFLAGS="-L/system/libraries" \
    CC="cc -B/system/libraries -B/system/libraries/clang/22/lib/linux" \
    prefix=/system \
    bindir=/system/binaries \
    includedir=/system/headers \
    libdir=/system/libraries \
    datarootdir=/system/documentation \
    datadir=/system/documentation/gettext-tiny \
    acdir=/system/documentation/aclocal \
    install

Command Explanations