{% set version = '2.4' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-curl
  version: {{ version|replace("-", "_") }}

source:
  fn: curl_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/curl_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/curl/curl_{{ version }}.tar.gz
  sha256: f5121a8cc9634acdcc6018919d84adafe6142cc03f07a3d9dd90d89b23113148

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base

test:
  commands:
    - $R -e "library('curl')"  # [not win]
    - "\"%R%\" -e \"library('curl')\""  # [win]

about:
  home: https://github.com/jeroen/curl#readme
  license: MIT
  license_file: LICENSE
  summary: The curl() and curl_download() functions provide highly configurable drop-in replacements
    for base url() and download.file() with better performance, support for encryption
    (https, ftps), gzip compression, authentication, and other 'libcurl' goodies. The
    core of the package implements a framework for performing fully customized requests
    where data can be processed either in memory, on disk, or streaming via the callback
    or connection interfaces. Some knowledge of 'libcurl' is recommended; for a more-user-friendly
    web client see the 'httr' package which builds on this package with http specific
    tools and logic.
  license_family: MIT

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
