name=mlibc
version=7b67d09bde0be6d53284d1583058483e1687880c
revision=1
tarball_url="https://github.com/mintsuki/mlibc/archive/${version}.tar.gz"
tarball_blake2b="a18b4fe6ab839088079f5cdcf1d35831ac9f3d25408118f5ddce280d595b730d1cbf7d4869a2da24f4df4edce7d250042acfea67f20266cc7a157db2e1d7c1ed"
imagedeps="meson ninja"
hostdeps="gcc pkg-config libgcc-binaries"
builddeps="cshim cxxshim frigg"
deps="mlibc-headers"

build() {
        LDFLAGS="-Wl,/usr/local/libgcc-binaries/libgcc-x86_64.a" \
    meson_configure \
        --buildtype=debugoptimized \
        -Dmlibc_no_headers=true \
        -Ddefault_library=both \
        -Ddisable_crypt_option=true \
        -Ddisable_iconv_option=true \
        -Ddisable_intl_option=true \
        -Ddisable_libgcc_dependency=true

    ninja -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" ninja install
}
