---

- name: Install build dependencies
  apt:
    name: "{{ item }}"
  sudo: yes
  with_items:
    - git
#    - build-essential
#    - python-dev
    - libffi-dev
    - libssl-dev

- name: Download
  git:
    repo: "https://github.com/girder/girder.git"
    dest: "{{ girder_path }}"
    version: "{{ girder_version }}"
    update: yes
    force: yes
  notify: Build Girder

- name: Install Pillow
  conda:
    name: Pillow
    version: 3.4.2
    executable: "{{ python_dist_path }}/bin/conda"

- name: Install Python dependencies
  pip:
    requirements: "{{ girder_path }}/requirements.txt"
    virtualenv: "{{ python_dist_path }}"
  sudo: yes if python_dist == "system" else no

- name: Install Python package
  pip:
    requirements: "{{ girder_path }}"
    editable: true
    virtualenv: "{{ python_dist_path }}"
  sudo: yes if python_dist == "system" else no

- name: Deploy config file
  template:
    src: "girder.local.cfg.j2"
    dest: "{{ girder_path }}/girder/conf/girder.local.cfg"

#- name: Install NodeJS dependencies
#  npm:
#    name: "{{ item }}"
#    global: yes
#  with_items:
#    - grunt
#    - grunt-cli
#  sudo: yes

---

- name: Install build dependencies
  apt:
    name: "{{ item }}"
  sudo: yes
  with_items:
    - git
#    - build-essential
#    - python-dev
    - python-tk
    - tcl8.6-dev
    - tk8.6-dev
    - libffi-dev
    - libssl-dev

- name: Download
  git:
    repo: "https://github.com/girder/girder.git"
    dest: "{{ girder_path }}"
    version: "{{ girder_version }}"
    update: yes
    force: yes
  notify: Build Girder

- name: Install Pillow
  conda:
    name: Pillow
    version: 3.4.2
    executable: "{{ python_dist_path }}/bin/conda"

- name: Install Python dependencies
  pip:
    requirements: "{{ girder_path }}/requirements.txt"
    virtualenv: "{{ python_dist_path }}"
  sudo: yes if python_dist == "system" else no

- name: Install Python package
  pip:
    requirements: "{{ girder_path }}"
    editable: true
    virtualenv: "{{ python_dist_path }}"
  sudo: yes if python_dist == "system" else no

- name: Deploy config file
  template:
    src: "girder.local.cfg.j2"
    dest: "{{ girder_path }}/girder/conf/girder.local.cfg"

#- name: Install NodeJS dependencies
#  npm:
#    name: "{{ item }}"
#    global: yes
#  with_items:
#    - grunt
#    - grunt-cli
#  sudo: yes

Install more dependencies for Pillow 3.4.2
Ansible: Install more dependencies for Pillow 3.4.2

Install more dependencies for Pillow 3.4.2. The installation
instructions include additional packages, but this is the minimal set to
fix the compilation error in my case.

See http://pillow.readthedocs.io/en/3.4.x/installation.html.

This fixes the following error while installing Pillow:

    In file included from _imagingtk.c:19:0:
        /home/vagrant/env/include/tk.h:80:25: fatal error: X11/Xlib.h: No such file or directory
