{% set version = "8.1.0" %}
{% set build_number = 1 %}
{% set minor_version = ".".join(version.split(".")[:2]) %}
{% set with_osmesa = os.environ.get('VTK_WITH_OSMESA', 'False') %}

{% if with_osmesa == "False" %}
{% set build_number = build_number + 200 %}
{% endif %}

package:
  name: vtk
  version: {{ version }}

source:
  url: http://www.vtk.org/files/release/{{ minor_version }}/VTK-{{ version }}.tar.gz
  fn:  VTK-{{ version }}.tar.gz
  sha256: 6e269f07b64fb13774f5925161fb4e1f379f4e6a0131c8408c555f6b58ef3cb7
  patches:
    - 0001-Link-libpython-optionally-make-vtkPython-dep-compile.patch

build:
  skip: True  # [win and vc<14]
  number: {{ build_number }}
  features:
{% if with_osmesa == "True" %}
    - mesalib
  skip: True  # [win]
{% endif %}

requirements:
  build:
    - cmake
    - ninja
    - {{ compiler('cxx') }}
  {% if SUBDIR in ('linux-64', 'linux-32') %}
    - {{ cdt('libxcb') }}
    - {{ cdt('libxau') }}
    - {{ cdt('libsm-devel') }}
    - {{ cdt('libxt-devel') }}
    - {{ cdt('libice-devel') }}
    - {{ cdt('libx11-devel') }}
    - {{ cdt('mesa-libgl-devel') }}
    - {{ cdt('xorg-x11-proto-devel') }}
  {% endif %}
  host:
    - python
    # VTK Third Party dependencies
    - zlib
    - freetype
    - hdf5     # [unix]
    - libxml2
    - libpng
    - jpeg
    - libtiff
    - jsoncpp  # [unix]
    - expat
    - tbb
{% if with_osmesa == "True" %}
    - mesalib
{% endif %}
  run:
    - python
    - future  # used in the generated python wrappers
    # VTK Third Party dependencies
    - jsoncpp  # [unix]
    - tbb
    # Rest will be taken care of by run_exports
{% if with_osmesa == "True" %}
    - mesalib
{% endif %}

test:
  imports:
    - vtk
    - vtk.vtkChartsCore
    - vtk.vtkCommonCore
    - vtk.vtkFiltersCore
    - vtk.vtkFiltersGeneric
    - vtk.vtkGeovisCore
    - vtk.vtkFiltersHybrid
    - vtk.vtkIOCore
    - vtk.vtkImagingCore
    - vtk.vtkInfovisCore
    - vtk.vtkRenderingCore
    - vtk.vtkViewsCore
    - vtk.vtkRenderingVolume
    - vtk.vtkInteractionWidgets

about:
  home: http://www.vtk.org/
  license: BSD 3-Clause
  summary: >
    The Visualization Toolkit (VTK) is an open-source, freely available software
    system for 3D computer graphics, modeling, image processing, volume
    rendering, scientific visualization, and information visualization.

extra:
  recipe-maintainers:
    - Korijn
    - ivoflipse
    - Maxyme
    - ccordoba12
    - grlee77
    - msarahan
    - patricksnape
    - dfroger
    - tadeu
    - marcelotrevisani
