<commit_before>#!/bin/bash

. $(dirname $0)/environment.sh

if [ ! -d $TMPROOT/openssl ] ; then
    mkdir $TMPROOT/openssl
fi

# Check we have a cloned repo
if [ ! -d $TMPROOT/openssl/ios-openssl ] ; then
    echo "ios-openssl repo not found. Pulling latest..."
    try pushd .
    cd $TMPROOT/openssl
    try git clone -b master https://github.com/zen-code/ios-openssl
    try popd
fi

# Build the required binaries
if [ -d $TMPROOT/openssl/ios-openssl ] ; then
    echo "ios-openssl repo found. Building now..."
    if [ ! -d $TMPROOT/openssl/ios-openssl/lib ] ; then
        try mkdir $TMPROOT/openssl/ios-openssl/lib
    fi
    try pushd .
    cd $TMPROOT/openssl/ios-openssl
    # Please refer to the script below for details of the OpenSSL build
    sh build.sh
    try popd
fi

echo "Copying built OpenSSL binaries..."
cp $TMPROOT/openssl/ios-openssl/lib/libssl.a $BUILDROOT/lib/libssl.a
cp $TMPROOT/openssl/ios-openssl/lib/libcrypto.a $BUILDROOT/lib/libcrypto.a

sh $KIVYIOSROOT/tools/build-openssl-link.sh<commit_msg>Skip building if binaries exist<commit_after>#!/bin/bash

. $(dirname $0)/environment.sh

if [ ! -d $TMPROOT/openssl ] ; then
    mkdir $TMPROOT/openssl
fi

# Check we have a cloned repo
if [ ! -d $TMPROOT/openssl/ios-openssl ] ; then
    echo "ios-openssl repo not found. Pulling latest..."
    try pushd .
    cd $TMPROOT/openssl
    try git clone -b master https://github.com/zen-code/ios-openssl
    try popd
fi

# Build the required binaries if not found (long process)
if [ ! -f $BUILDROOT/lib/libssl.a ] ; then
    if [ -d $TMPROOT/openssl/ios-openssl ] ; then
        echo "ios-openssl repo found. Building now..."
        if [ ! -d $TMPROOT/openssl/ios-openssl/lib ] ; then
            try mkdir $TMPROOT/openssl/ios-openssl/lib
        fi
        try pushd .
        cd $TMPROOT/openssl/ios-openssl
        # Please refer to the script below for details of the OpenSSL build
        sh build.sh
        try popd
    fi
else
    echo "Skipping build. Binary found: $BUILDROOT/lib/libssl.a"
fi

echo "Copying built OpenSSL binaries..."
cp $TMPROOT/openssl/ios-openssl/lib/libssl.a $BUILDROOT/lib/libssl.a
cp $TMPROOT/openssl/ios-openssl/lib/libcrypto.a $BUILDROOT/lib/libcrypto.a

sh $KIVYIOSROOT/tools/build-openssl-link.sh
{'fraction_non_alphanumeric': 0.11736049601417184, 'fraction_numerical': 0.0008857395925597874, 'mean_word_length': 2.727722772277228, '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': '5073678', 'n_tokens_mistral': 803, 'n_tokens_neox': 785, 'n_words': 212}