{% set name = "zstandard" %}
{% set version = "0.19.0" %}
{% set zstd_version = "1.5.2" %}

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

source:
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: 31d12fcd942dd8dbf52ca5f6b1bbe287f44e5d551a081a983ff3ea2082867863

build:
  number: 2

requirements:
  build:
    - python                                 # [build_platform != target_platform]
    - cross-python_{{ target_platform }}     # [build_platform != target_platform]
    - cffi                                   # [build_platform != target_platform]
    - zstd {{ zstd_version }}                # [build_platform != target_platform]
    - {{ compiler('c') }}
  host:
    - python
    - pip
    - cffi >=1.11
    - zstd {{ zstd_version }}
  run:
    - python
    - cffi >=1.11
    # The Python bindings use private APIs and are tightly coupled to zstd
    # https://github.com/indygreg/python-zstandard/blob/0063333790a853360c816101511635865405834f/c-ext/backend_c.c#L149
    - {{ pin_compatible("zstd", max_pin="x.x.x") }}

test:
  requires:
    - pip
  commands:
    - pip check
  imports:
    - zstandard

about:
  home: https://github.com/indygreg/python-zstandard
  license: BSD-3-Clause
  license_file: LICENSE
  summary: Zstandard bindings for Python
  description: |
    This project provides Python bindings for interfacing with the
    Zstandard compression library. A C extension and CFFI interface are
    provided.
  doc_url: https://github.com/indygreg/python-zstandard/blob/master/README.rst#python-zstandard
  dev_url: https://github.com/indygreg/python-zstandard

extra:
  recipe-maintainers:
    - rmax
    - xhochy
