sudo: required
language: python
dist: bionic

services:
  - xvfb

python:
  - "3.7"

before_install:
  - sudo apt-get update
  - sudo apt-get install python python3 python3-dev
  - sudo apt-get install build-essential libboost-python-dev libboost-all-dev systemtap-sdt-dev
  - sudo apt-get install libfuzzy-dev graphviz libgraphviz-dev tesseract-ocr unrar xfonts-base xfonts-75dpi
  - wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb
  - sudo dpkg -i wkhtmltox_0.12.5-1.bionic_amd64.deb
  - git clone https://github.com/buffer/libemu.git
  - cd libemu
  - autoreconf -v -i
  - ./configure
  - sudo make install
  - cd -
  - sudo ldconfig

install:
  - pip3 install pylibemu
  - pip3 install tox

script:
  - sudo mkdir -p /etc/thug/{rules,personalities,scripts}
  - sudo cp -R thug/Classifier/rules/* /etc/thug/rules/
  - sudo cp -R thug/DOM/personalities/* /etc/thug/personalities
  - sudo cp -t /etc/thug/scripts thug/DOM/{thug.js,storage.js,date.js,eval.js,write.js}
  - sudo cp -t /etc/thug/ conf/thug.conf
  - sudo cp -t /etc/thug/ conf/inspector.json
  - tox
  - echo "Build done"
