{% set version = "1.41.0" %}
{% set posix = 'm2-' if win else '' %}

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/parallelly_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/parallelly/parallelly_{{ version }}.tar.gz
  sha256: 31fe14e3d26e2ce31d316cdd0b5b203ea890ff95d1947f3dfa5477dedc34e50f

build:
  missing_dso_whitelist:
    - '*/R.dll'           # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - {{ compiler('c') }}        # [not win]
    - {{ stdlib("c") }}          # [not win]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ stdlib("m2w64_c") }}    # [win]
    - {{ posix }}filesystem      # [win]
    - {{ posix }}make
    - {{ posix }}sed             # [win]
    - {{ posix }}coreutils       # [win]
    - {{ posix }}zip             # [win]
  host:
    - r-base
  run:
    - r-base

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

about:
  home: https://parallelly.futureverse.org
  dev_url: https://github.com/HenrikBengtsson/parallelly
  license: LGPL-2.1-or-later
  summary: Utility functions that enhance the 'parallel' package and support the built-in parallel backends of the 'future' package.  For example, availableCores() gives the number of CPU cores available to your R process as given by R options and environment variables, including those set by job schedulers on high-performance
    compute clusters. If none is set, it will fall back to parallel::detectCores(). Another example is makeClusterPSOCK(), which is backward compatible with parallel::makePSOCKcluster() while doing a better job in setting up remote cluster workers without the need for configuring the firewall to do port-forwarding to your
    local computer.
  license_family: LGPL
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/LGPL-2.1

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