{% set version = "1.4.5" %}

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

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

source:
  fn: httpuv_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/httpuv_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/httpuv/httpuv_{{ version }}.tar.gz
  sha256: f19113d45ba0617ff826abd7963224db61fa0a3dbfdde21f802419f7b362b7b5

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-bh
    - r-later >=0.7.3
    - r-promises
    - r-rcpp >=0.11.0

  run:
    - r-base
    - r-bh
    - r-later >=0.7.3
    - r-promises
    - r-rcpp >=0.11.0

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

about:
  home: https://github.com/rstudio/httpuv
  license: GPL-3
  summary: Provides low-level socket and protocol support for handling HTTP and WebSocket requests
    directly from within R.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - halldc
