{% set name = "aws-c-io" %}
{% set version = "0.10.5" %}

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

source:
  url: https://github.com/awslabs/{{ name }}/archive/v{{ version }}.tar.gz
  sha256: 59abd4606661790cc0b777807938f3134cce77c03383015781498cfbfd191811
  patches:
    - 0001-Link-to-ncrypt.patch  # [win]

build:
  number: 0
  run_exports:
    - {{ pin_subpackage("aws-c-io", max_pin="x.x.x") }}

requirements:
  build:
    - cmake !=3.19.0,!=3.19.1
    - {{ compiler('c') }}
    - ninja
  host:
    - aws-c-common
    - aws-c-cal
    - s2n  # [linux]

test:
  commands:
    - test -f $PREFIX/lib/libaws-c-io${SHLIB_EXT}  # [unix]
    - test -f $PREFIX/include/aws/io/io.h  # [unix]
    - if not exist %LIBRARY_INC%\\aws\\io\\io.h exit 1          # [win]
    - if not exist %PREFIX%\\Library\\bin\\aws-c-io.dll exit 1  # [win]

about:
  home: https://github.com/awslabs/aws-c-io
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE
  summary: This is a module for the AWS SDK for C. It handles all IO and TLS work for application protocols.

extra:
  recipe-maintainers:
    - xhochy
