# 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 = "3.6.0" %}

package:
  name: matplotlib-suite
  version: {{ version }}

source:
  url: https://github.com/matplotlib/matplotlib/archive/v{{ version }}.tar.gz
  sha256: 8ff39ddbf1da8e83b4483dbe40a82cf5b3d6c8e2c426396e26dc19aa45278a56

build:
  number: 0

outputs:
  - name: matplotlib-base
    script: build_base.bat  # [win]
    script: build_base.sh  # [not win]
    build:
      skip: true  # [py<38]
      ignore_run_exports_from:
        - zlib
    requirements:
      build:
        - python                                 # [build_platform != target_platform]
        - cross-python_{{ target_platform }}     # [build_platform != target_platform]
        - numpy                                  # [build_platform != target_platform]
        - pkg-config  # [not win]
        - {{ compiler('c') }}
        - {{ compiler('cxx') }}
      host:
        - python
        - pip
        - certifi>=2020.06.20
        - freetype
        # freetype.pc requires zlib.pc
        - zlib
        - numpy
        - setuptools_scm >=7
        - setuptools_scm_git_archive
        - tk  # [linux]
      run:
        - python
        - __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }}  # [osx and x86_64]
        - {{ pin_compatible('numpy') }}
        - numpy >=1.19
        - certifi >=2020.06.20
        - contourpy >=1.0.1
        - cycler >=0.10
        - python-dateutil >=2.7
        - pillow >=6.2.0
        - fonttools >=4.22.0
        - freetype
        - packaging >=20.0
        - pyparsing >=2.2.1
        - tk  # [linux]
        - kiwisolver >=1.0.1
    test:
      imports:
        - matplotlib
        - matplotlib.pyplot
        - matplotlib._image
        - matplotlib._path
        - matplotlib._qhull
        - matplotlib._tri
        - matplotlib._ttconv
        - matplotlib.backends._backend_agg
        - matplotlib.ft2font
        - matplotlib.backends._tkagg  # [not win]
        - mpl_toolkits
        - pylab

  - name: matplotlib
    build:
      skip: true  # [py<38]
    requirements:
      host:
        - python
      run:
        - python
        - pyqt  # [not osx and not aarch64 and not ppc64le and python_impl == "cpython"]
        - tornado
        - {{ pin_subpackage('matplotlib-base', max_pin="x.x.x") }}
    test:
      imports:
        - matplotlib

about:
  home: http://matplotlib.org/
  license: LicenseRef-PSF-2.0 and CC0-1.0
  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
