<commit_before>#!/bin/sh

p_source="$pkg_dist_dir/glib-2.40.2.tar.xz"

use_toolchain target

PKG_CONFIG_SYSROOT_DIR="$target_dir"

pkg_patch() {
    # removes hard dependency on python
    p_run patch -p1 \
        < "$pkg_patch_dir/glib-2.40.0-external-gdbus-codegen.patch"
    # leave python shebang alone
    p_run sed -e '/${PYTHON}/d' \
        -i glib/Makefile.{am,in}
    p_run autoreconf -if
}

pkg_build() {
    local cache="cross_cache.conf"
    echo "glib_cv_stack_grows=no" > "$cache"
    echo "ac_cv_func_posix_getpwuid_r=yes" >> "$cache"
    echo "ac_cv_func_posix_getgrgid_r=yes" >> "$cache"
    echo "glib_cv_uscore=yes" >> "$cache"

    # export LIBFFI_CFLAGS="-I$(echo ${target_dir}${target_prefix}/lib/libffi-*/include)"
    # export LIBFFI_LIBS="-L${target_dir}${target_prefix}/lib -lffi"

    p_run ./configure \
        --cache-file="$cache" \
        --host="$target_system" \
        --prefix="$target_prefix" \
        --disable-gc-friendly \
        --disable-mem-pools \
        --disable-rebuilds \
        --disable-installed-tests \
        --disable-always-build-tests \
        --enable-largefile \
        --disable-static \
        --enable-shared \
        --enable-fast-install \
        --enable-libtool-lock \<commit_msg>Removed bash-specific expansion in glib script<commit_after>#!/bin/sh

p_source="$pkg_dist_dir/glib-2.40.2.tar.xz"

use_toolchain target

PKG_CONFIG_SYSROOT_DIR="$target_dir"

pkg_patch() {
    # removes hard dependency on python
    p_run patch -p1 \
        < "$pkg_patch_dir/glib-2.40.0-external-gdbus-codegen.patch"
    # leave python shebang alone
    p_run sed -ie '/${PYTHON}/d' \
        glib/Makefile.am glib/Makefile.in
    p_run autoreconf -if
}

pkg_build() {
    local cache="cross_cache.conf"
    echo "glib_cv_stack_grows=no" > "$cache"
    echo "ac_cv_func_posix_getpwuid_r=yes" >> "$cache"
    echo "ac_cv_func_posix_getgrgid_r=yes" >> "$cache"
    echo "glib_cv_uscore=yes" >> "$cache"

    # export LIBFFI_CFLAGS="-I$(echo ${target_dir}${target_prefix}/lib/libffi-*/include)"
    # export LIBFFI_LIBS="-L${target_dir}${target_prefix}/lib -lffi"

    p_run ./configure \
        --cache-file="$cache" \
        --host="$target_system" \
        --prefix="$target_prefix" \
        --disable-gc-friendly \
        --disable-mem-pools \
        --disable-rebuilds \
        --disable-installed-tests \
        --disable-always-build-tests \
        --enable-largefile \
        --disable-static \
        --enable-shared \
        --enable-fast-install \
        --enable-libtool-lock \
{'fraction_non_alphanumeric': 0.1550175712612261, 'fraction_numerical': 0.007028504490433424, 'mean_word_length': 2.4715447154471546, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3060483', 'n_tokens_mistral': 958, 'n_tokens_neox': 933, 'n_words': 133}