{% set version = '1.3-0' %}

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

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

source:
  fn: RJSONIO_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/RJSONIO_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/RJSONIO/RJSONIO_{{ version }}.tar.gz
  sha256: 119334b7761c6c1c3cec52fa17dbc1b72eaebb520c53e68d873dea147cf48fb7

build:
  merge_build_host: True  # [win]
  number: 2

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}sed               # [win]
    - {{posix}}grep              # [win]
    - {{posix}}autoconf
    - {{posix}}automake          # [not win]
    - {{posix}}automake-wrapper  # [win]
    - {{posix}}pkg-config
    - {{posix}}make
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]

  host:
    - r-base

  run:
    - r-base
    - {{native}}gcc-libs         # [win]

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

about:
  home: https://CRAN.R-project.org/package=RJSONIO
  license: BSD_3_clause
  summary: This is a package that allows conversion to and from  data in Javascript object notation
    (JSON) format. This allows R objects to be inserted into Javascript/ECMAScript/ActionScript
    code and allows R programmers to read and convert JSON content to R objects. This
    is an alternative to rjson package. Originally, that was too slow for converting
    large R objects to JSON and was not extensible.  rjson's performance is now similar
    to this package, and perhaps slightly faster in some cases. This package uses methods
    and is readily extensible by defining methods for different classes,  vectorized
    operations, and C code and callbacks to R functions for deserializing JSON objects
    to R.  The two packages intentionally share the same basic interface. This package
    (RJSONIO) has many additional options to allow customizing the generation and processing
    of JSON content. This package uses libjson rather than implementing yet another
    JSON parser. The aim is to support other general projects by building on their work,
    providing feedback and benefit from their ongoing development.
  license_family: BSD
  license_file: LICENSE

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
    - croth1
