<commit_before>#!/bin/bash
set -ex

readonly BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

presetup_osx() {
    echo "macOS Pre-setup"
}

setup_osx() {
    case "${BUILD_ARCH}" in
      64bit)
      # brew update

      # Use PyPy2 v5.4.0
      brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/c5a201f49c9da47d4771ebc544d10b3f9c579021/Formula/pypy.rb

      brew install sdl2
      ;;
    esac

    # todo: Squeak for jittests

    # Don't install coveralls on macOS, because it's too slow (see #116)
    # curl -L -O https://bootstrap.pypa.io/get-pip.py
    # sudo python get-pip.py
    # sudo pip install coveralls pytest-cov
}

presetup_linux() {
    sudo dpkg --add-architecture i386
    sudo apt-add-repository multiverse
    sudo apt-add-repository universe
    sudo apt-get update -myq || true

    case "$BUILD_ARCH" in
	32bit|lldebug)
	    PACKAGES="
	    gcc-multilib \
	    libasound2-dev:i386 \
	    libbz2-1.0:i386 \
	    libc6-dev-i386 \
	    libc6:i386 \
	    libexpat1:i386 \
	    libffi-dev:i386 \
	    libffi6:i386 \
	    libfreetype6:i386 \
	    libgcrypt11:i386 \
	    libgl1-mesa-dev:i386 \
	    mesa-common-dev:i386 \
	    libgl1-mesa-dri:i386 \
	    libgl1-mesa-glx:i386 \
	    libglapi-mesa:i386 \
	    libglu1-mesa-dev:i386 \
	    libglu1-mesa:i386 \
	    libssl1.0.0:i386 \
	    libssl-dev:i386 \
	    libstdc++6:i386 \
	    libtinfo5:i386 \
	    libxext-dev:i386 \
	    libxt-dev:i386 \
	    zlib1g:i386 \
	    "
	    ;;
	64bit)
	    PACKAGES="
	    libfreetype6:i386 \
	    "
	    ;;
	arm*)
	    PACKAGES="
	    gcc-arm-linux-gnueabi \
	    gcc-arm-linux-gnueabihf \
	    qemu-system \
	    qemu-system-arm \
	    qemu-user \
	    qemu-user-static \
	    sbuild \
	    schroot \
	    scratchbox2 \
	    debootstrap \
	    zlib1g:i386 \
	    libstdc++6:i386 \
	    libffi-dev:i386 \
	    libffi6:i386 \
	    libssl1.0.0:i386 \
	    libssl-dev:i386 \
	    libbz2-1.0:i386 \
	    libc6-dev-i386 \
	    libc6:i386 \
	    libexpat1:i386 \
	    libtinfo5:i386 \
	    "
	    ;;
    esac

    sudo apt-get install -yq \
	 --no-install-suggests --no-install-recommends --force-yes \
	 binfmt-support \
	 build-essential \
	 python-dev \
	 libffi-dev \
	 zlib1g-dev \
	 $PACKAGES
}

setup_linux() {
    # Build and install SDL2 2.0.5 from source
    wget https://www.libsdl.org/release/SDL2-2.0.5.tar.gz
    tar xzf SDL2-2.0.5.tar.gz
    pushd "./SDL2-2.0.5" > /dev/null
    ./configure; make; sudo make install
    popd > /dev/null

    wget http://squeakvm.org/unix/release/Squeak-4.10.2.2614-linux_i386.tar.gz
    tar xzvf Squeak-4.10*.tar.gz
    rm Squeak-4.10*.tar.gz
    ln -s $PWD/Squeak-4.10*/bin/squeak .build/squeak
    case "${BUILD_ARCH}" in
    	32bit)
		    # also install coveralls
			export PATH=.build/pypy-linux32/bin/:$PATH
			pip install coveralls
			;;
    	arm*)
			"${BASE}/setup_arm.sh"
			;;
	esac
}<commit_msg>Compile SDL2 for 32bit when necessary<commit_after>#!/bin/bash
set -ex

readonly BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

presetup_osx() {
    echo "macOS Pre-setup"
}

setup_osx() {
    case "${BUILD_ARCH}" in
      64bit)
      # brew update

      # Use PyPy2 v5.4.0
      brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/c5a201f49c9da47d4771ebc544d10b3f9c579021/Formula/pypy.rb

      brew install sdl2
      ;;
    esac

    # todo: Squeak for jittests

    # Don't install coveralls on macOS, because it's too slow (see #116)
    # curl -L -O https://bootstrap.pypa.io/get-pip.py
    # sudo python get-pip.py
    # sudo pip install coveralls pytest-cov
}

presetup_linux() {
    sudo dpkg --add-architecture i386
    sudo apt-add-repository multiverse
    sudo apt-add-repository universe
    sudo apt-get update -myq || true

    case "$BUILD_ARCH" in
	32bit|lldebug)
	    PACKAGES="
	    gcc-multilib \
	    libasound2-dev:i386 \
	    libbz2-1.0:i386 \
	    libc6-dev-i386 \
	    libc6:i386 \
	    libexpat1:i386 \
	    libffi-dev:i386 \
	    libffi6:i386 \
	    libfreetype6:i386 \
	    g++-multilib \
	    libgcrypt11:i386 \
	    libgl1-mesa-dev:i386 \
	    mesa-common-dev:i386 \
	    libgl1-mesa-dri:i386 \
	    libgl1-mesa-glx:i386 \
	    libglapi-mesa:i386 \
	    libglu1-mesa-dev:i386 \
	    libglu1-mesa:i386 \
	    libssl1.0.0:i386 \
	    libssl-dev:i386 \
	    libstdc++6:i386 \
	    libtinfo5:i386 \
	    libxext-dev:i386 \
	    libxt-dev:i386 \
	    zlib1g:i386 \
	    "
	    ;;
	64bit)
	    PACKAGES="
	    libfreetype6:i386 \
	    "
	    ;;
	arm*)
	    PACKAGES="
	    gcc-arm-linux-gnueabi \
	    gcc-arm-linux-gnueabihf \
	    qemu-system \
	    qemu-system-arm \
	    qemu-user \
	    qemu-user-static \
	    sbuild \
	    schroot \
	    scratchbox2 \
	    debootstrap \
	    zlib1g:i386 \
	    libstdc++6:i386 \
	    libffi-dev:i386 \
	    libffi6:i386 \
	    libssl1.0.0:i386 \
	    libssl-dev:i386 \
	    libbz2-1.0:i386 \
	    libc6-dev-i386 \
	    libc6:i386 \
	    libexpat1:i386 \
	    libtinfo5:i386 \
	    "
	    ;;
    esac

    sudo apt-get install -yq \
	 --no-install-suggests --no-install-recommends --force-yes \
	 binfmt-support \
	 build-essential \
	 python-dev \
	 libffi-dev \
	 zlib1g-dev \
	 $PACKAGES
}

setup_linux() {
    # Build and install SDL2 2.0.5 from source
    wget https://www.libsdl.org/release/SDL2-2.0.5.tar.gz
    tar xzf SDL2-2.0.5.tar.gz
    pushd "./SDL2-2.0.5" > /dev/null
    if [[ "${BUILD_ARCH}" = "32bit" ]]; then
      export CFLAGS="-m32"
      export CXXFLAGS="-m32"
    fi
    ./configure; make; sudo make install
    popd > /dev/null

    wget http://squeakvm.org/unix/release/Squeak-4.10.2.2614-linux_i386.tar.gz
    tar xzvf Squeak-4.10*.tar.gz
    rm Squeak-4.10*.tar.gz
    ln -s $PWD/Squeak-4.10*/bin/squeak .build/squeak
    case "${BUILD_ARCH}" in
    	32bit)
		    # also install coveralls
			export PATH=.build/pypy-linux32/bin/:$PATH
			pip install coveralls
			;;
    	arm*)
			"${BASE}/setup_arm.sh"
			;;
	esac
}
{'fraction_non_alphanumeric': 0.1333220682663062, 'fraction_numerical': 0.0782358905035485, 'mean_word_length': 1.987884906612822, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '1185885', 'n_tokens_mistral': 2921, 'n_tokens_neox': 2453, 'n_words': 395}