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

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

source:
  fn: rjson_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/rjson_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/rjson/rjson_{{ version }}.tar.gz
  sha256: 3a287c1e5ee7c333ed8385913c0a307daf99335fbdf803e9dcca6e3d5adb3f6c

build:
  merge_build_host: True  # [win]
  number: 1002
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_cxx') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

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

about:
  home: https://CRAN.R-project.org/package=rjson
  license: GPL-2
  summary: Converts R object into JSON objects and vice-versa.
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - conda-forge/r
    - croth1
