<commit_before>require ${BPN}.inc

SRC_URI += " \
    file://0002-configure.ac-skip-some-cross-compile-sections-they-d.patch \
    file://0003-Makefile.in-avoid-building-target-cross-toolset.patch \
    file://0004-remove-paths-for-gb_Executable_get_command.patch \
    file://0005-ensure-that-native-gendict-build-by-libreoffice-is-u.patch \
"

DEPENDS += " \
    ${BPN}-native \
    gtk+3 \
    curl \
    boost \
    icu \
    expat \
    poppler \
    harfbuzz \
    openldap \
    nss \
    zlib \
    mariadb \
    jpeg \
    neon \
    libpng \
    apr \
    serf \
    libatomic-ops \
    lcms \
    harfbuzz \
    cppunit \
    glew \
    openssl \
    \
    mdds \
    glm \
    redland \
    libabw \
    libwps \
    libwpg \
    libwpd \
    libcdr \
    librevenge \
    libcmis \
    libfreehand \
    libe-book \
    libmwaw \
    libetonyek \
    libvisio \
    libmspub \
    libpagemaker \
    libodfgen \
    libgltf \
    libexttextcat \
    clucene-core \
    vigra \
"

# necessary to let the call for python-config succeed
export BUILD_SYS
export HOST_SYS
export STAGING_LIBDIR
export STAGING_INCDIR

# By default many many sources are downloaded from libreoffice mirrors. 
# This can be avoided by --with-system-.. To see what's still loaded check
# log.do_compile.
# problems during configure detected for (TBD?)
# * boost: 'configure: error: Could not find a version of the library!'
EXTRA_OECONF += " \
    --enable-gtk3 \
    --disable-postgresql-sdbc \
    --disable-collada \
    --disable-coinmp \
    --enable-python=system \
    --with-tls=nss \
    --with-system-poppler \
    --with-system-openldap \
    --with-system-zlib \
    --with-system-mariadb \
    --with-system-jpeg \
    --with-system-neon \
    --with-system-libpng \
    --with-system-nss \
    --with-system-apr \
    --with-system-serf \
    --with-system-libatomic_ops \
    --with-system-lcms2 \
    --with-system-libxml \
    --with-system-icu \
    --with-system-expat \
    --with-system-curl \
    --with-system-harfbuzz \
    --with-system-cppunit \
    --with-system-glew \
    --with-system-openssl \
    \
    --with-system-glm \
    --with-system-mdds \
    --with-system-redland \
    --with-system-libabw \
    --with-system-libwps \
    --with-system-libwpg \
    --with-system-libwpd \
    --with-system-libcdr \
    --with-system-librevenge \
    --with-system-libcmis \
    --with-system-libfreehand \
    --with-system-libebook \
    --with-system-libmwaw \
    --with-system-libetonyek \
    --with-system-libvisio \
    --with-system-libmspub \
    --with-system-libpagemaker \
    --with-system-libodfgen \
    --with-system-libgltf \
    --with-system-libexttextcat \
    --with-system-clucene \
    --with-system-vigra \
"

do_configure() {
    olddir=`pwd`
    cd ${S}
    aclocal --system-acdir=${B}/aclocal-copy/ -I ${S}/m4
    gnu-configize
    autoconf
    cd $olddir
    oe_runconf

    mkdir -p ${B}/workdir/Executable

    # icu binaries ar expected in our build tree
    mkdir -p ${B}/workdir/UnpackedTarball/icu/source/
    cd ${B}/workdir/UnpackedTarball/icu/source/
    ln -sf ${STAGING_DATADIR_NATIVE}/icu/55.1/bin
}

# for scripting (requires python >= 3.3)
#RDEPENDS_${PN} = "python3"<commit_msg>libreoffice: verbose output for compile / write down some notes / fix typo<commit_after>require ${BPN}.inc

SRC_URI += " \
    file://0002-configure.ac-skip-some-cross-compile-sections-they-d.patch \
    file://0003-Makefile.in-avoid-building-target-cross-toolset.patch \
    file://0004-remove-paths-for-gb_Executable_get_command.patch \
    file://0005-ensure-that-native-gendict-build-by-libreoffice-is-u.patch \
"

DEPENDS += " \
    ${BPN}-native \
    gtk+3 \
    curl \
    boost \
    icu \
    expat \
    poppler \
    harfbuzz \
    openldap \
    nss \
    zlib \
    mariadb \
    jpeg \
    neon \
    libpng \
    apr \
    serf \
    libatomic-ops \
    lcms \
    harfbuzz \
    cppunit \
    glew \
    openssl \
    \
    mdds \
    glm \
    redland \
    libabw \
    libwps \
    libwpg \
    libwpd \
    libcdr \
    librevenge \
    libcmis \
    libfreehand \
    libe-book \
    libmwaw \
    libetonyek \
    libvisio \
    libmspub \
    libpagemaker \
    libodfgen \
    libgltf \
    libexttextcat \
    clucene-core \
    vigra \
"

# necessary to let the call for python-config succeed
export BUILD_SYS
export HOST_SYS
export STAGING_LIBDIR
export STAGING_INCDIR

# Notes:
#
# 1. By default many many sources are downloaded from libreoffice mirrors.
# This can be avoided by --with-system-.. To see what's still loaded check
# log.do_compile.
#
# 2. problems during configure detected for (TBD?)
# * boost: 'configure: error: Could not find a version of the library!'
#
# 3. in case of trouble in do_compile: configure with --enable-verbose might
# help detecting culprit
#
# 4. TODO --with-parallelism

EXTRA_OECONF += " \
    --enable-verbose \
    \
    --enable-gtk3 \
    --disable-postgresql-sdbc \
    --disable-collada \
    --disable-coinmp \
    --enable-python=system \
    --with-tls=nss \
    \
    --with-system-poppler \
    --with-system-openldap \
    --with-system-zlib \
    --with-system-mariadb \
    --with-system-jpeg \
    --with-system-neon \
    --with-system-libpng \
    --with-system-nss \
    --with-system-apr \
    --with-system-serf \
    --with-system-libatomic_ops \
    --with-system-lcms2 \
    --with-system-libxml \
    --with-system-icu \
    --with-system-expat \
    --with-system-curl \
    --with-system-harfbuzz \
    --with-system-cppunit \
    --with-system-glew \
    --with-system-openssl \
    \
    --with-system-glm \
    --with-system-mdds \
    --with-system-redland \
    --with-system-libabw \
    --with-system-libwps \
    --with-system-libwpg \
    --with-system-libwpd \
    --with-system-libcdr \
    --with-system-librevenge \
    --with-system-libcmis \
    --with-system-libfreehand \
    --with-system-libebook \
    --with-system-libmwaw \
    --with-system-libetonyek \
    --with-system-libvisio \
    --with-system-libmspub \
    --with-system-libpagemaker \
    --with-system-libodfgen \
    --with-system-libgltf \
    --with-system-libexttextcat \
    --with-system-clucene \
    --with-system-vigra \
"

do_configure() {
    olddir=`pwd`
    cd ${S}
    aclocal --system-acdir=${B}/aclocal-copy/ -I ${S}/m4
    gnu-configize
    autoconf
    cd $olddir
    oe_runconf

    mkdir -p ${B}/workdir/Executable

    # icu binaries are expected in our build tree
    mkdir -p ${B}/workdir/UnpackedTarball/icu/source/
    cd ${B}/workdir/UnpackedTarball/icu/source/
    ln -sf ${STAGING_DATADIR_NATIVE}/icu/55.1/bin
}

# for scripting (requires python >= 3.3)
#RDEPENDS_${PN} = "python3"
{'fraction_non_alphanumeric': 0.1417521939610293, 'fraction_numerical': 0.008329614755317566, 'mean_word_length': 1.8383284086112284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '245409', 'n_tokens_mistral': 2621, 'n_tokens_neox': 2536, 'n_words': 424}