# 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.3" %}

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

source:
  url: https://github.com/matplotlib/matplotlib/archive/v{{ version }}.tar.gz
  sha256: da5b804222864a8e854ed68f16dcbc8b2fa096537d84f879cc8289db368735c8
  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
  ignore_run_exports:
    - pyqt

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.*  # [win and py==27]
    - pyqt 5.9.*  # [not (osx or ppc64le) and not (win and py==27)]
    - 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
    - tk 8.6.*  # [linux]
    - functools32  # [py2k]
    - subprocess32  # [py2k and unix]
    - tornado
    - pyqt 5.6.*  # [win and py==27]
    - pyqt 5.9.*  # [not (osx or ppc64le) and not (win and py==27)]
    - 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
