<commit_before>language: cpp

compiler:
 - clang
# - gcc

env:
  matrix:
   - DEBUG=True ENABLE_LOG=True DEFAULT_LOG_SEVERITY=debug XMLPARSER="libxml2" DEMO=False BENCHMARK=False CUSTOM_CXXFLAGS="" CUSTOM_LDFLAGS=""
   - DEBUG=False ENABLE_LOG=False DEFAULT_LOG_SEVERITY=none XMLPARSER="ptree" DEMO=False BENCHMARK=False CUSTOM_CXXFLAGS="" CUSTOM_LDFLAGS=""

before_install:
 - nproc
 - free
 # we need at least g++-4.7 for c++11 features
 - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
 # clear out travis postgis
 #- sudo mv /etc/apt/sources.list.d/pgdg-source.list* /tmp
 #- sudo apt-get -qq remove postgis
 # grab more recent gdal/proj
 - sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
 # more recent boost
 - sudo add-apt-repository -y ppa:boost-latest/ppa
 - sudo apt-get update -y
 - sudo apt-get install -qq -y ttf-wqy-microhei postgis postgresql-9.1-postgis-2.0-scripts libstdc++6 libstdc++-4.8-dev make boost1.55 python-nose libicu-dev libpng-dev libjpeg-dev libtiff-dev libwebp-dev libz-dev libfreetype6-dev libxml2-dev libproj-dev libcairo-dev python-cairo-dev libsqlite3-dev
 - createdb -EUTF8 template_postgis -U postgres
 - psql -c 'create extension postgis' template_postgis  -U postgres
 - if [[ "${CXX}" == 'g++' ]]; then sudo apt-get install gcc-4.8 g++-4.8; export CXX="$(which g++-4.8)"; export CC="$(which gcc-4.8)"; fi;
 - if [[ "${CXX}" == 'clang++' ]]; then export CXX="$(which clang++)"; export CC="$(which clang)"; fi;
 - wget http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.34.tar.bz2
 - tar xf harfbuzz-0.9.34.tar.bz2
 - cd harfbuzz-0.9.34
 - ./configure --prefix=/usr --with-icu --with-cairo=no --with-glib=no --with-gobject=no --with-graphite2=no --with-freetype --with-uniscribe=no --with-coretext=no && make && sudo make install
 - cd ../

install:
 - ./configure CXX="${CXX}" CC="${CC}" CUSTOM_CXXFLAGS="${CUSTOM_CXXFLAGS}" CUSTOM_LDFLAGS="${CUSTOM_LDFLAGS}" XML_PARSER="${XML_PARSER}" ENABLE_LOG="${ENABLE_LOG}" DEBUG="${DEBUG}" DEMO="${DEMO}" BENCHMARK="${BENCHMARK}" CPP_TESTS=True CAIRO=True FAST=True || cat config.log
 - if [[ "${CXX}" == 'g++-4.8' ]]; then JOBS=2 make; else JOBS=4 make; fi;

before_script:
 - make test

script:
 - if [[ ${BENCHMARK} != False ]]; then make bench; fi;<commit_msg>port travis fixes from #2380 to master<commit_after>language: cpp

compiler:
 - clang
# - gcc

env:
  matrix:
   - DEBUG=True ENABLE_LOG=True DEFAULT_LOG_SEVERITY=debug XMLPARSER="libxml2" DEMO=False BENCHMARK=False CUSTOM_CXXFLAGS="" CUSTOM_LDFLAGS=""
   - DEBUG=False ENABLE_LOG=False DEFAULT_LOG_SEVERITY=none XMLPARSER="ptree" DEMO=False BENCHMARK=False CUSTOM_CXXFLAGS="" CUSTOM_LDFLAGS=""

# travis + ubuntugis with gdal and postggis leads to many potential dead-end conflicts
# the below is thanks to https://github.com/CartoDB/Windshaft/blob/d82fe08b32fc7907bbe907ab290f8a082215ae26/.travis.yml#L1
before_install:
  - export PGUSER=postgres
  - sudo mv /etc/apt/sources.list.d/pgdg-source.list* /tmp
  - sudo apt-get -qq purge postgis* postgresql*
  - sudo apt-add-repository -y ppa:cartodb/postgresql-9.3
  - sudo apt-add-repository -y ppa:cartodb/gis
  - sudo rm -Rf /var/lib/postgresql /etc/postgresql
  - sudo apt-get update -qq
  - sudo apt-get install -q postgresql-9.3-postgis-2.1
  - sudo apt-get install -q postgresql-contrib-9.3
  - sudo apt-get install -q gdal-bin libgdal-dev
  - echo -e "local\tall\tall\ttrust\nhost\tall\tall\t127.0.0.1/32\ttrust\nhost\tall\tall\t::1/128\ttrust" |sudo tee /etc/postgresql/9.3/main/pg_hba.conf
  - sudo service postgresql restart

install:
 - sudo add-apt-repository -y ppa:boost-latest/ppa
 # we need at least g++-4.7 for c++11 features
 - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
 - sudo apt-get update -qq
 - sudo apt-get install -y ttf-wqy-microhei make valgrind boost1.55 python-nose libicu-dev libproj-dev libcairo-dev python-cairo-dev libcairo-dev python-cairo-dev libpng-dev libjpeg-dev libtiff-dev libwebp-dev libz-dev libfreetype6-dev libxml2-dev libsqlite3-dev

before_script:
 - psql -U postgres -c 'create database template_postgis'
 - psql -U postgres -c 'create extension postgis' -d template_postgis
 - if [[ "${CXX}" == 'g++' ]]; then sudo apt-get install gcc-4.8 g++-4.8; export CXX="$(which g++-4.8)"; export CC="$(which gcc-4.8)"; fi;
 - if [[ "${CXX}" == 'clang++' ]]; then export CXX="$(which clang++)"; export CC="$(which clang)"; fi;
 - wget http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.34.tar.bz2
 - tar xf harfbuzz-0.9.34.tar.bz2
 - cd harfbuzz-0.9.34
 - ./configure --prefix=/usr --with-icu --with-cairo=no --with-glib=no --with-gobject=no --with-graphite2=no --with-freetype --with-uniscribe=no --with-coretext=no && make && sudo make install
 - cd ../

install:
 - ./configure CXX="${CXX}" CC="${CC}" CUSTOM_CXXFLAGS="${CUSTOM_CXXFLAGS}" CUSTOM_LDFLAGS="${CUSTOM_LDFLAGS}" XML_PARSER="${XML_PARSER}" ENABLE_LOG="${ENABLE_LOG}" DEBUG="${DEBUG}" DEMO="${DEMO}" BENCHMARK="${BENCHMARK}" CPP_TESTS=True CAIRO=True FAST=True || cat config.log
 - if [[ "${CXX}" == 'g++-4.8' ]]; then JOBS=2 make; else JOBS=4 make; fi;

before_script:
 - make test
 - source localize.sh && make grind

script:
 - if [[ ${BENCHMARK} != False ]]; then make bench; fi;
{'fraction_non_alphanumeric': 0.16450381679389314, 'fraction_numerical': 0.025954198473282442, 'mean_word_length': 4.058880308880309, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 1, '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': '3977994', 'n_tokens_mistral': 2145, 'n_tokens_neox': 2030, 'n_words': 447}