{% set version = "1.10" %}

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

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

source:
  fn: reticulate_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/reticulate_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/reticulate/reticulate_{{ version }}.tar.gz
  sha256: 58e36d3b8a67d01194c4e5099499657d017f77fc2081213633964b1d57a7e32f

build:
  merge_build_host: True  # [win]
  number: 0
  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-rcpp >=0.12.7
    - r-jsonlite
    - r-matrix

  run:
    - r-base
    - r-rcpp >=0.12.7
    - r-jsonlite
    - r-matrix

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

about:
  home: https://github.com/rstudio/reticulate
  license: Apache 2.0
  summary: Interface to 'Python' modules, classes, and functions. When calling into 'Python',
    R data types are automatically converted to their equivalent 'Python' types. When
    values are returned from 'Python' to R they are converted back to R types. Compatible
    with all versions of 'Python' >= 2.7.
  license_family: APACHE

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