<commit_before>language: c

sudo: false

addons:
  apt_packages:
    - binutils-mingw-w64-i686
    - binutils-mingw-w64-x86-64
    - docbook-xsl
    - gcc-mingw-w64-i686
    - gcc-mingw-w64-x86-64
    - libpcsclite-dev
    - mingw-w64
    - wine
    - xsltproc
    - gengetopt
  coverity_scan:
    project:
      name: "mouse07410OpenSC"
      description: "Build submitted via Travis CI"
    notification_email: <EMAIL>
    build_command:   "make -j 4"
    branch_pattern: coverity_scan

env:
  global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
    # - secure: "<KEY>
    - secure: "<KEY>

matrix:
  fast_finish: true
  include:
    - compiler: clang
      os: osx
    - compiler: gcc
      os: osx
    - compiler: clang
      os: linux
      env: ENABLE_DOC=--enable-doc
    - compiler: gcc
      os: linux
      env: ENABLE_DOC=--enable-doc
    - os: linux
      env: HOST=x86_64-w64-mingw32
    - os: linux
      env: HOST=i686-w64-mingw32

before_install:
  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then
        brew update;
        brew uninstall libtool;
        brew install libtool;
        brew install gengetopt;
    fi

before_script:
  # we run a weekly cron job in travis on the coverity branch
  # just synchronize it with master to get a new report
  - if [ "${COVERITY_SCAN_BRANCH}" == 1 ]; then
      git reset --hard origin/master;
    fi
  - ./bootstrap
  - if [ -z "$HOST" ]; then
      CFLAGS="-Werror" ./configure $ENABLE_DOC --enable-dnie-ui;
    else
      if [ ! -f "$(winepath 'C:/Program Files (x86)/Inno Setup 5/ISCC.exe')" ]; then
        /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16;
        export DISPLAY=:99.0;
        wget http://files.jrsoftware.org/is/5/isetup-5.5.6.exe;
        wine isetup-5.5.6.exe /SILENT /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART;
      fi;
      unset CC;
      unset CXX;
      ./configure --host=$HOST --disable-openssl --disable-readline --disable-zlib --prefix=${TRAVIS_BUILD_DIR}/win32/opensc || cat config.log;
    fi

script:
  - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then
      if [ $TRAVIS_OS_NAME == osx ]; then
        mkdir -p /opt/local/lib;
	mkdir -p /Library/OpenSC/lib;
        ./MacOSX/build;
      else
        make;
      fi;
    fi
  - if [ -z "$HOST" -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then
      make check;
      make dist;
    fi
  - if [ ! -z "$HOST" -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then
      make install;
      wine "C:/Program Files (x86)/Inno Setup 5/ISCC.exe" win32/OpenSC.iss;
    fi

after_script:
  # kill process started during compilation to finish the build, see
  # https://github.com/moodlerooms/moodle-plugin-ci/issues/33 for details
  - if [ ! -z "$HOST" ]; then
      killall services.exe;
    fi

cache: ccache<commit_msg>Maybe now fixed Travis...<commit_after>language: c

sudo: false

addons:
  apt_packages:
    - binutils-mingw-w64-i686
    - binutils-mingw-w64-x86-64
    - docbook-xsl
    - gcc-mingw-w64-i686
    - gcc-mingw-w64-x86-64
    - libpcsclite-dev
    - mingw-w64
    - wine
    - xsltproc
    - gengetopt
  coverity_scan:
    project:
      name: "mouse07410OpenSC"
      description: "Build submitted via Travis CI"
    notification_email: <EMAIL>
    build_command:   "make -j 4"
    branch_pattern: coverity_scan

env:
  global:
    # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
    #   via the "travis encrypt" command using the project repo's public key
    # - secure: "<KEY>
    - secure: "<KEY>

matrix:
  fast_finish: true
  include:
    - compiler: clang
      os: osx
    - compiler: gcc
      os: osx
    - compiler: clang
      os: linux
      env: ENABLE_DOC=--enable-doc
    - compiler: gcc
      os: linux
      env: ENABLE_DOC=--enable-doc
    - os: linux
      env: HOST=x86_64-w64-mingw32
    - os: linux
      env: HOST=i686-w64-mingw32

before_install:
  - if [ "$TRAVIS_OS_NAME" == "osx" ]; then
        brew update;
        brew uninstall libtool;
        brew install libtool;
        brew install gengetopt;
    fi

before_script:
  # we run a weekly cron job in travis on the coverity branch
  # just synchronize it with master to get a new report
  - if [ "${COVERITY_SCAN_BRANCH}" == 1 ]; then
      git reset --hard origin/master;
    fi
  - ./bootstrap
  - if [ -z "$HOST" ]; then
      CFLAGS="-Werror" ./configure $ENABLE_DOC --enable-dnie-ui;
    else
      if [ ! -f "$(winepath 'C:/Program Files (x86)/Inno Setup 5/ISCC.exe')" ]; then
        /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16;
        export DISPLAY=:99.0;
        wget http://files.jrsoftware.org/is/5/isetup-5.5.6.exe;
        wine isetup-5.5.6.exe /SILENT /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART;
      fi;
      unset CC;
      unset CXX;
      ./configure --host=$HOST --disable-openssl --disable-readline --disable-zlib --prefix=${TRAVIS_BUILD_DIR}/win32/opensc || cat config.log;
    fi

script:
  - if [ "${COVERITY_SCAN_BRANCH}" != 1 ]; then
      if [ $TRAVIS_OS_NAME == osx ]; then
        mkdir -p /opt/local/lib;
        mkdir -p /Library/OpenSC/lib;
        ./MacOSX/build;
      else
        make;
      fi;
    fi
  - if [ -z "$HOST" -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then
      make check;
      make dist;
    fi
  - if [ ! -z "$HOST" -a "${COVERITY_SCAN_BRANCH}" != 1 ]; then
      make install;
      wine "C:/Program Files (x86)/Inno Setup 5/ISCC.exe" win32/OpenSC.iss;
    fi

after_script:
  # kill process started during compilation to finish the build, see
  # https://github.com/moodlerooms/moodle-plugin-ci/issues/33 for details
  - if [ ! -z "$HOST" ]; then
      killall services.exe;
    fi

cache: ccache
{'fraction_non_alphanumeric': 0.1277637130801688, 'fraction_numerical': 0.029029535864978903, 'mean_word_length': 2.2101841820151678, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '591306', 'n_tokens_mistral': 2304, 'n_tokens_neox': 2164, 'n_words': 542}