{% set name = "aws-sdk-cpp" %}
{% set version = "1.8.185" %}

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

source:
  url: https://github.com/aws/{{ name }}/archive/{{ version }}.tar.gz
  sha256: 6fc110579098268700fac428cebe2fcda14f4e389ee5194bad5cae52b5445e6b
  patches:
    # Pass CMAKE_INSTALL_LIBDIR to dependencies as well
    - 0001-fix-libdir-for-deps.patch
    - 0002-force-openssl-use.patch  # [unix]
    - 0003-Fix-AWSSDKConfig.cmake.patch
    - 0004-demote-compilation-errors.patch

build:
  number: 1
  run_exports:
    - {{ pin_subpackage("aws-sdk-cpp", max_pin="x.x.x") }}
  missing_dso_whitelist:
   - '$RPATH/ld64.so.1'  # [s390x]

requirements:
  build:
    - cmake >=3.2
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - ninja
    - make  # [unix]
    - patch     # [not win]
    - m2-patch  # [win]

  host:
    - aws-c-common 0.6.8
    - aws-c-event-stream 0.1.6
    - libcurl 7.88.1
    # Force all platforms except win to use OpenSSL, rather than OS-supplied APIs.
    # Note that OpenSSL is implictly pulled in as a libcurl dependency, but we
    # explicitly list it as a host requirement so our run_exports are correct.
    - openssl {{ openssl }}  # [unix]
  run:
    - openssl 3.*

test:
  files:
    - test.cpp
    - CMakeLists.txt
  requires:
    - cmake
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - ninja
    - make  # [unix]
  commands:

about:
  home: https://github.com/aws/aws-sdk-cpp
  license: Apache-2.0
  license_family: Apache
  license_file: LICENSE
  summary: C++ library that makes it easy to integrate C++ applications with AWS services
  description: |
    The AWS SDK for C++ provides a modern C++ (version C++ 11 or later) interface for Amazon Web Services (AWS).
    It is meant to be performant and fully functioning with low- and high-level SDKs,
    while minimizing dependencies and providing platform portability (Windows, OSX, Linux, and mobile).
  doc_url: https://docs.aws.amazon.com/sdk-for-cpp
  dev_url: https://github.com/aws/aws-sdk-cpp

extra:
  recipe-maintainers:
    - jakebolewski
    - pitrou
    - ihnorton
    - xhochy
