{% set version = "1.14.3" %}
{% set cross = False %}
{% if build_platform != target_platform and not build_platform.startswith('win') %}
{% set cross = True %}
{% endif %}

package:
  name: cffi
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/c/cffi/cffi-{{ version }}.tar.gz
  sha256: f92f789e4f9241cd262ad7a555ca2c648a98178a953af117ef7fad46aa1d5591
  patches:
    - setup-linux.patch  # [not win]
    - 0001-Link-to-dl-library.patch

build:
  number: 2
  script: {{ PYTHON }} -m pip install . --no-deps -vv

requirements:
  build:
{% if cross %}
    - python
    - cross-python_{{ target_platform }}
{% endif %}
    - {{ compiler('c') }}
  host:
    - python
    - pip
    - libffi  # [not win]
    - pycparser
  run:
    - python
    - libffi  # [not win]
    - pycparser

test:
  imports:
    - cffi
    - _cffi_backend
  requires:
    - pip
    - openssl
  commands:
    - pip check

about:
  home: https://bitbucket.org/cffi/cffi
  license: MIT
  license_file: LICENSE
  summary: Foreign Function Interface for Python calling C code.

  description: |
    Cffi aims to allow users to call C code from Python without having to
    learn a 3rd language. It provides a convenient and reliable way to call
    compiled C code from Python using interface declarations written in C.
  doc_url: http://cffi.readthedocs.org
  dev_url: https://bitbucket.org/cffi/cffi/overview
  doc_source_url: https://bitbucket.org/cffi/cffi/src/default/doc/?at=default

extra:
  recipe-maintainers:
    - goanpeca
    - ocefpaf
    - mingwandroid
