<commit_before># Travis-CI Build for koreader
# see travis-ci.org for details

language: c

sudo: false

compiler:
  - gcc

env:
  - EMULATE_READER=1

cache:
  apt: true
  directories:
    - $HOME/.ccache

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.8
      - libsdl1.2-dev
      # for luasec
      - libssl1.0.0
      - nasm
      # OpenSSL likes this (package contains makedepend)
      - xutils-dev

before_install:
  # don't do this for clang
  - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
  # in case anything ignores the environment variables, override through PATH
  - mkdir bin
  - ln -s $(which gcc-4.8) bin/cc
  - ln -s $(which gcc-4.8) bin/gcc
  - ln -s $(which c++-4.8) bin/c++
  - ln -s $(which g++-4.8) bin/g++
  - export PATH=$PWD/bin:$PATH

install:
  # install our own updated luarocks
  - git clone https://github.com/torch/luajit-rocks.git
  - pushd luajit-rocks
  - git checkout 6529891
  - cmake . -DWITH_LUA52=ON -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/install
  - make install
  - popd
  - export PATH=$PATH:${TRAVIS_BUILD_DIR}/install/bin
  - mkdir $HOME/.luarocks
  - cp ${TRAVIS_BUILD_DIR}/install/etc/luarocks/config.lua $HOME/.luarocks/config.lua
  - echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
  - travis_retry luarocks --local install ansicolors
  - travis_retry luarocks --local install luafilesystem
  - travis_retry luarocks --local install busted 2.0.rc11-0
  #- travis_retry luarocks --local install busted 1.11.1-1
  #- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted
  - travis_retry luarocks --local install luacov
  # luasec doesn't automatically detect 64-bit libs
  - travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu
  - travis_retry luarocks --local install luacov-coveralls --server=http://rocks.moonscript.org/dev
  # add local rocks to $PATH
  # on newer luarocks, `luarocks path --bin` would suffice because it includes the PATH now
  - luarocks path --bin
  - eval $(luarocks path --bin)

script:
  - travis_retry make fetchthirdparty
  - make all
  - make testfront

after_success:
  - make coverage
  - cd koreader-*/koreader && luacov-coveralls -v<commit_msg>build: more travis build fix<commit_after># Travis-CI Build for koreader
# see travis-ci.org for details

language: c

sudo: false

compiler:
  - gcc

env:
  - EMULATE_READER=1

cache:
  apt: true
  directories:
    - $HOME/.ccache

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - g++-4.8
      - libsdl1.2-dev
      # for luasec
      - libssl1.0.0
      - nasm
      # OpenSSL likes this (package contains makedepend)
      - xutils-dev

before_install:
  # don't do this for clang
  - if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
  # in case anything ignores the environment variables, override through PATH
  - mkdir bin
  - ln -s $(which gcc-4.8) bin/cc
  - ln -s $(which gcc-4.8) bin/gcc
  - ln -s $(which c++-4.8) bin/c++
  - ln -s $(which g++-4.8) bin/g++
  - export PATH=$PWD/bin:$PATH

install:
  # install our own updated luarocks
  - git clone https://github.com/torch/luajit-rocks.git
  - pushd luajit-rocks
  - git checkout 6529891
  - cmake . -DCMAKE_INSTALL_PREFIX=${TRAVIS_BUILD_DIR}/install
  - make install
  - popd
  - export PATH=$PATH:${TRAVIS_BUILD_DIR}/install/bin
  - mkdir $HOME/.luarocks
  - cp ${TRAVIS_BUILD_DIR}/install/etc/luarocks/config.lua $HOME/.luarocks/config.lua
  - echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
  - travis_retry luarocks --local install luafilesystem
  - travis_retry luarocks --local install ansicolors
  - travis_retry luarocks --local install busted 2.0.rc11-0
  #- travis_retry luarocks --local install busted 1.11.1-1
  #- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted
  - travis_retry luarocks --local install luacov
  # luasec doesn't automatically detect 64-bit libs
  - travis_retry luarocks --local install luasec OPENSSL_LIBDIR=/usr/lib/x86_64-linux-gnu
  - travis_retry luarocks --local install luacov-coveralls --server=http://rocks.moonscript.org/dev
  # add local rocks to $PATH
  - eval $(luarocks path --bin)

script:
  - travis_retry make fetchthirdparty
  - make all
  - make testfront

after_success:
  - make coverage
  - cd koreader-*/koreader && luacov-coveralls -v
{'fraction_non_alphanumeric': 0.12514220705346984, 'fraction_numerical': 0.020022753128555178, 'mean_word_length': 2.8731277533039647, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5745305', 'n_tokens_mistral': 1721, 'n_tokens_neox': 1653, 'n_words': 403}