name=libintl
from_source=gettext
revision=1
hostdeps="gcc automake autoconf libtool pkg-config"
deps="mlibc libgcc libstdc++ libiconv"

build() {
        ACLOCAL=true \
        AUTOCONF=true \
        AUTOMAKE=true \
        AUTOHEADER=true \
    autotools_configure \
        --without-emacs \
        --without-lispdir \
        `# Normally this controls nls behavior in general, but the libintl` \
        `# subdir is skipped unless this is explicitly set.` \
        --enable-nls \
        `# This magic flag enables libintl.` \
        --with-included-gettext \
        --disable-c++ \
        --disable-libasprintf \
        --disable-java \
        --enable-threads=posix \
        --disable-curses \
        --without-git \
        --without-cvs \
        --without-bzip2 \
        --without-xz

    sed -i 's/touch $@//g' gettext-runtime/intl/Makefile

    make -C gettext-runtime/intl -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make -C gettext-runtime/intl install

    post_package_strip
}
