language: c, python3

addons:
  apt:
    packages:
      - re2c

install:
  - git clone https://github.com/martine/ninja.git
  - cd ninja
  - ./configure.py --bootstrap
  - export PATH=$(pwd):$PATH
  - cd ..

cache:
  directories:
    - ninja

script:
  - ninja --version
  - make Posix
  - make run-posix

language: c, python3

addons:
  apt:
    packages:
      - re2c

install:
  - CURDIR = $(pwd)
  - if [ ! -d "~/foss/ninja" ]: then
  -   mkdir ~/foss/ninja
  -   git clone https://github.com/martine/ninja.git ~/foss/ninja
  -   cd ~/foss/ninja
  -   ./configure.py --bootstrap
    fi
  - export PATH=$(pwd):$PATH
  - cd $CURDIR

cache:
  directories:
    - ~/foss

script:
  - ninja --version
  - make Posix
  - make run-posix

Add conditional to an install script.
Add conditional to an install script.

Not sure this works, but we need to conditionally do install ninja.
In the future we may need to validate the version if it did get cached.
