{% set version = '1.1.0' %}

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

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

source:
  fn: memoise_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/memoise_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/memoise/memoise_{{ version }}.tar.gz
  sha256: b276f9452a26aeb79e12dd7227fcc8712832781a42f92d70e86040da0573980c

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

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-digest >=0.6.3
  run:
    - r-base
    - r-digest >=0.6.3

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

about:
  home: https://github.com/hadley/memoise
  license: MIT
  summary: Cache the results of a function so that when you call it again with the same arguments
    it returns the pre-computed value.
  license_family: MIT
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\MIT'  # [win]

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