{% set version = "1.4.4" %}

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

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

source:
  fn: foreach_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/foreach_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/foreach/foreach_{{ version }}.tar.gz

  sha256: c0a71090d5b70b9a95a6936091dabae9c26e1fc6b9609bfe5fb6346033905e48

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-codetools
    - r-iterators

  run:
    - r-base
    - r-codetools
    - r-iterators

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

about:
  home: https://CRAN.R-project.org/package=foreach
  license: Apache 2.0
  summary: Support for the foreach looping construct.  Foreach is an idiom that allows for iterating
    over elements in a collection, without the use of an explicit loop counter.  This
    package in particular is intended to be used for its return value, rather than for
    its side effects.  In that sense, it is similar to the standard lapply function,
    but doesn't require the evaluation of a function.  Using foreach without side effects
    also facilitates executing the loop in parallel.
  license_family: Apache

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
