{% set name = "wxPython" %}
{% set version = "4.0.4" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  fn: wxpython-{{ version }}.tar.gz
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: 0d9ef4260cb2f3e23ed9dcf6baa905ba585ac7d631613cddc299c4c83463ae29
  patches:
    - build.py.patch  # make sure windows builds dont try to use msgfmt
    - 0001-MacOSX-Use-libc-not-libstdc.patch
    - 0002-MacOSX-Specify-correct-SDK-path-and-version.patch
    - 0003-Don-t-enable-debug-info-for-all-builds.patch
    - 0004-Use-custom-function-for-python_header-checking-on-Da.patch
    - 0005-Anaconda-Distribution-uses-14.1-for-3.6-too.patch

build:
  number: 0
  osx_is_app: True  # [osx]
  script: python setup.py install --single-version-externally-managed --record record.txt  # [win]
  missing_dso_whitelist:                                           # [osx]
    - /System/Library/Frameworks/QTKit.framework/Versions/A/QTKit  # [osx]

requirements:
  build:
    - pkg-config                         # [unix]
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - {{ cdt('gtk2-devel') }}            # [linux]
    - {{ cdt('libpng-devel') }}          # [linux]
    - {{ cdt('libxrender-devel') }}      # [linux]
    - {{ cdt('mesa-libgl-devel') }}      # [linux]
    - {{ cdt('mesa-dri-drivers') }}      # [linux]
    - {{ cdt('libXxf86vm-devel') }}      # [linux]
    - {{ cdt('libselinux') }}            # [linux]
    - {{ cdt('libdrm-devel') }}          # [linux]
    - {{ cdt('xorg-x11-proto-devel') }}  # [linux]
    - {{ cdt('libxau-devel') }}          # [linux]
    - {{ cdt('libx11-devel') }}          # [linux]
    - {{ cdt('libxfixes-devel') }}       # [linux]
    - {{ cdt('libxext-devel') }}         # [linux]
    - {{ cdt('libxinerama') }}           # [linux]
    - {{ cdt('libxi') }}                 # [linux]
    - {{ cdt('libxcb') }}                # [linux]
    - {{ cdt('libxcursor') }}            # [linux]
    - {{ cdt('libxcomposite') }}         # [linux]
    - {{ cdt('libxdamage-devel') }}      # [linux]
    - {{ cdt('webkitgtk-devel') }}       # [linux]
    - {{ cdt('libsoup-devel') }}         # [linux]
  host:
    - python
    - pthread-stubs
    - setuptools
    - glib              # [linux]
    - xz                # [unix]
    - expat             # [unix]
    - zlib              # [unix]
    - cairo             # [linux]
    - jpeg              # [unix]
    - pango             # [linux]
    - libpng            # [unix]
    - libxml2           # [linux]
    - libiconv          # [osx]
    - gstreamer  # [linux]
    - gst-plugins-base  # [linux]
    - libglu  # [linux]
    - backports.lzma  # [osx]
    - requests
    - gettext  # [not win]
  run:
    - python
    - python.app  # [osx]
    - six
    - gstreamer  # [linux]
    - gst-plugins-base  # [linux]
    - libglu  # [linux]
    - backports.lzma  # [osx]
    # pango doesn't have a run_exports yet
    - {{ pin_compatible('pango') }}  # [linux]
    # Run exports should take care of rest

test:
  # Commenting out since we don't use CDT pkgs during tests
  # Till we have a fix, the package maintainer will test this manually
  imports:
    - wx  # [not linux]
  #commands:
  #  - conda inspect linkages -p $PREFIX wxpython  # [not win]
  #  - conda inspect objects -p $PREFIX wxpython  # [osx]

about:
  home: https://wxpython.org/Phoenix/
  license: wxWindows Library v3.1
  license_family: LGPL
  # license_file: LICENSE.txt
  summary: Cross platform GUI toolkit for Python, "Phoenix" version
  description: |
    Welcome to wxPython's Project Phoenix! Phoenix is the improved next-generation
    wxPython, "better, stronger, faster than he was before." This new
    implementation is focused on improving speed, maintainability and
    extensibility. Just like "Classic" wxPython, Phoenix wraps the wxWidgets C++
    toolkit and provides access to the user interface portions of the wxWidgets
    API, enabling Python applications to have a native GUI on Windows, Macs or
    Unix systems, with a native look and feel and requiring very little (if any)
    platform specific code.
  doc_url: https://wxpython.org/Phoenix/docs/html/index.html
  dev_url: https://github.com/wxWidgets/Phoenix

extra:
  recipe-maintainers:
    - Korijn
    - ocefpaf
