{% set version = '1.0.1' %}

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

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

source:
  fn: gh_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/gh_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/gh/gh_{{ version }}.tar.gz
  sha256: f3c02b16637ae390c3599265852d94b3de3ef585818b260d00e7812595b391d2

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

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

requirements:
  build:
    - r-base
    - r-httr
    - r-ini
    - r-jsonlite

  run:
    - r-base
    - r-httr
    - r-ini
    - r-jsonlite

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

about:
  home: https://github.com/r-lib/gh#readme
  license: MIT
  summary: Minimal client to access the 'GitHub' 'API'.
  license_family: MIT

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
