<commit_before>project(libffi)
cmake_minimum_required(VERSION 3.5.1)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/../cmake_modules")
include("koreader_thirdparty_common")

enable_language(C)

assert_var_defined(HOST)
assert_var_defined(CC)
assert_var_defined(CFLAGS)
assert_var_defined(LDFLAGS)

ep_get_source_dir(BINARY_DIR)
ep_get_source_dir(SOURCE_DIR)

set(CFG_CMD sh -c "CC=\"${CC}\" CFLAGS=\"${CFLAGS}\" LDFLAGS=\"${LDFLAGS}\" ${SOURCE_DIR}/configure --prefix=${BINARY_DIR} --host=${HOST} --enable-static")
if(DEFINED SYSROOT)
    set(CFG_CMD "${CFG_CMD} CFLAGS=\"--sysroot ${SYSROOT}\"")
endif()

include(ExternalProject)
set(LIBFFI_VER "3.2.1")
ExternalProject_Add(
    ${PROJECT_NAME}
    DOWNLOAD_DIR ${KO_DOWNLOAD_DIR}
    URL https://sourceware.org/pub/libffi/libffi-${LIBFFI_VER}.tar.gz
    URL_MD5 83b89587607e3eb65c70d361f13bab43
    CONFIGURE_COMMAND ${CFG_CMD}
    # skip the rest, we only need the header for glib
    BUILD_COMMAND ${KO_MAKE_RECURSIVE} -j${PARALLEL_JOBS}
    INSTALL_COMMAND ${KO_MAKE_RECURSIVE} -j${PARALLEL_JOBS} uninstall install
)<commit_msg>thirdparty/libffi v3.3 (#1017)<commit_after>project(libffi)
cmake_minimum_required(VERSION 3.5.1)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/../cmake_modules")
include("koreader_thirdparty_common")

enable_language(C)

assert_var_defined(HOST)
assert_var_defined(CC)
assert_var_defined(CFLAGS)
assert_var_defined(LDFLAGS)

ep_get_source_dir(BINARY_DIR)
ep_get_source_dir(SOURCE_DIR)

set(CFG_CMD sh -c "CC=\"${CC}\" CFLAGS=\"${CFLAGS}\" LDFLAGS=\"${LDFLAGS}\" ${SOURCE_DIR}/configure --prefix=${BINARY_DIR} --host=${HOST} --enable-static")
if(DEFINED SYSROOT)
    set(CFG_CMD "${CFG_CMD} CFLAGS=\"--sysroot ${SYSROOT}\"")
endif()

include(ExternalProject)
set(LIBFFI_VER "3.3")
ExternalProject_Add(
    ${PROJECT_NAME}
    DOWNLOAD_DIR ${KO_DOWNLOAD_DIR}
    URL https://sourceware.org/pub/libffi/libffi-${LIBFFI_VER}.tar.gz
    URL_MD5 6313289e32f1d38a9df4770b014a2ca7
    CONFIGURE_COMMAND ${CFG_CMD}
    # skip the rest, we only need the header for glib
    BUILD_COMMAND ${KO_MAKE_RECURSIVE} -j${PARALLEL_JOBS}
    INSTALL_COMMAND ${KO_MAKE_RECURSIVE} -j${PARALLEL_JOBS} uninstall install
)
{'fraction_non_alphanumeric': 0.14356213548676536, 'fraction_numerical': 0.02826379542395693, 'mean_word_length': 6.689655172413793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '6866397', 'n_tokens_mistral': 937, 'n_tokens_neox': 877, 'n_words': 126}