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

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

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

build:
  number: 2

outputs:
  - name: matplotlib-base
    script: build_base.bat  # [win]
    script: build_base.sh  # [not win]
    build:
      skip: true  # [py<39]
      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]
        - pybind11 >=2.6                         # [build_platform != target_platform]
        - pkg-config  # [not win]
        - {{ compiler('c') }}
        - {{ stdlib("c") }}
        - {{ compiler('cxx') }}
        - libtool  # [unix]
      host:
        - python
        - pip
        - certifi>=2020.06.20
        - pybind11 >=2.6
        - freetype
        # freetype.pc requires zlib.pc
        - zlib
        - numpy
        - setuptools >=64
        - setuptools_scm >=7
        - setuptools_scm_git_archive
        - tk  # [linux]
      run:
        - python
        - certifi >=2020.06.20
        - contourpy >=1.0.1
        - cycler >=0.10
        - fonttools >=4.22.0
        - kiwisolver >=1.3.1
        - numpy >=1.21
        - packaging >=20.0
        - pillow >=8
        - pyparsing >=2.3.1
        - python-dateutil >=2.7
        - freetype
        - tk  # [linux]
        - importlib-resources>=3.2.0  # [py<310]
    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<39]
    requirements:
      host:
        - python
      run:
        - python
        - pyqt >=5.10  # [not osx and not aarch64 and not ppc64le and python_impl == "cpython"]
        - tornado >=5
        - {{ pin_subpackage('matplotlib-base', max_pin="x.x.x") }}
    test:
      imports:
        - matplotlib

about:
  home: http://matplotlib.org/
  license: PSF-2.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
