#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2015-2016, 2026 InterGenJLU
#
# libunistring 1.4.2 — Unicode string library
# BLFS 13.0

configure() {
    set -e
    # Fix required by glibc-2.43+
    sed -r '/_GL_EXTERN_C/s/w?memchr|bsearch/(&)/' \
        -i $(find -name \*.in.h)

    ./configure --prefix=/usr    \
                --disable-static \
                --docdir=/usr/share/doc/libunistring-${PKG_VERSION}
}

build() {
    set -e
    make -j${IGOS_JOBS}
}

check() {
    set -e
    pkg_run_tests "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/package.yml" \
        make check
}

do_install() {
    set -e
    make DESTDIR="$DESTDIR" install
}
