# Full credit goes to https://github.com/conda/conda-recipes for providing this recipe.
# It has been subsequently adapted for automated building with conda-forge.

{% set version = "2.2.0" %}

package:
  name: matplotlib
  version: {{ version }}

source:
  url: https://github.com/matplotlib/matplotlib/archive/v{{ version }}.tar.gz
  sha256: b1dfd2bec5fae524469a046b3d9083772fb41c547a581b2bdf84f017b7649eff
  patches:
    # Find libpng on Windows.
    - setupext.patch  # [win]
    # A patch to make Qt the default backend.
    - cfg_qt5agg.patch  # [not osx]
    # Removes framework check from osx backend (seems unneeded)
    - osx-frame.patch  # [osx]

build:
  number: 0

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
  host:
    - freetype
    - icu     # [linux]
    - python
    - setuptools
    - pkg-config  # [not win]
    - backports.functools_lru_cache  # [py2k]
    - numpy
    - python-dateutil
    - msinttypes  # [win]
    - cycler >=0.10
    - nose
    - pyparsing
    - pytz
    - libpng
    - zlib
    - pyqt 5.6.*  # [not (osx or ppc64le)]
    - tk 8.6.*  # [linux]
    - functools32  # [py2k]
    - subprocess32  # [py2k and unix]
  run:
    - python
    - setuptools
    - backports.functools_lru_cache  # [py2k]
    - numpy
    - cycler >=0.10
    - python-dateutil
    - pytz
    - pyparsing
    - pyqt 5.6.*  # [not (osx or ppc64le)]
    - tk 8.6.*  # [linux]
    - functools32  # [py2k]
    - subprocess32  # [py2k and unix]
    - tornado
    - kiwisolver

test:
  imports:
    - matplotlib
    - matplotlib.pyplot
    - matplotlib._image
    - matplotlib._path
    - matplotlib._png
    - matplotlib._tri
    - matplotlib.backends._backend_agg
    - matplotlib.ft2font
    - matplotlib.ttconv
    - matplotlib.backends._tkagg  # [not win]
    - mpl_toolkits
    - pylab
  commands:
    - conda inspect linkages -p $PREFIX $PKG_NAME  # [not win]
    - conda inspect objects -p $PREFIX $PKG_NAME  # [osx]

about:
  home: http://matplotlib.org/
  license: PSF-based
  license_url: http://matplotlib.sourceforge.net/users/license.html
  license_family: PSF
  license_file: LICENSE/LICENSE
  summary: Publication quality figures in Python
  description: |
    matplotlib is a python 2D plotting library which produces publication
    quality figures in a variety of hardcopy formats and interactive
    environments across platforms. matplotlib can be used in Python scripts,
    the Python and IPython shell (ala MATLAB or Mathematica), web
    application servers, and six graphical user interface toolkits.
  dev_url: https://github.com/matplotlib/matplotlib/
  doc_url: http://matplotlib.org/contents.html

extra:
  recipe-maintainers:
    - mdboom
    - ocefpaf
    - pelson
    - tacaswell
    - dopplershift
