{% set version = '1.2.1' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/promises_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/promises/promises_{{ version }}.tar.gz
  sha256: 3ce0a26df39ea27536877ec6db13083b2952108245024baa8b40ae856d2ce5be

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0
  # no skip

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: future (>= 1.21.0), knitr, purrr, rmarkdown, spelling, testthat, vembedr
requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base
    - r-r6
    - r-rcpp
    - r-fastmap >=1.1.0
    - r-later
    - r-magrittr >=1.5
    - r-rlang

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-r6
    - r-rcpp
    - r-fastmap >=1.1.0
    - r-later
    - r-magrittr >=1.5
    - r-rlang

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('promises')"           # [not win]
    - "\"%R%\" -e \"library('promises')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: https://rstudio.github.io/promises/, https://github.com/rstudio/promises
  license: MIT
  summary: Provides fundamental abstractions for doing asynchronous programming in R using promises.
    Asynchronous programming is useful for allowing a single R process to orchestrate
    multiple tasks in the background while also attending to something else. Semantics
    are similar to 'JavaScript' promises, but with a syntax that is idiomatic R.
  license_family: MIT
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'
    - LICENSE

extra:
  recipe-maintainers:
    - mingwandroid

# The original CRAN metadata for this package was:

# Type: Package
# Package: promises
# Title: Abstractions for Promise-Based Asynchronous Programming
# Version: 1.2.1
# Authors@R: c( person("Joe", "Cheng", , "joe@posit.co", role = c("aut", "cre")), person("Posit Software, PBC", role = c("cph", "fnd")) )
# Description: Provides fundamental abstractions for doing asynchronous programming in R using promises. Asynchronous programming is useful for allowing a single R process to orchestrate multiple tasks in the background while also attending to something else. Semantics are similar to 'JavaScript' promises, but with a syntax that is idiomatic R.
# License: MIT + file LICENSE
# URL: https://rstudio.github.io/promises/, https://github.com/rstudio/promises
# BugReports: https://github.com/rstudio/promises/issues
# Imports: fastmap (>= 1.1.0), later, magrittr (>= 1.5), R6, Rcpp, rlang, stats
# Suggests: future (>= 1.21.0), knitr, purrr, rmarkdown, spelling, testthat, vembedr
# LinkingTo: later, Rcpp
# VignetteBuilder: knitr
# Config/Needs/website: rsconnect
# Encoding: UTF-8
# Language: en-US
# RoxygenNote: 7.2.3
# NeedsCompilation: yes
# Packaged: 2023-08-09 20:29:25 UTC; garrick
# Author: Joe Cheng [aut, cre], Posit Software, PBC [cph, fnd]
# Maintainer: Joe Cheng <joe@posit.co>
# Repository: CRAN
# Date/Publication: 2023-08-10 16:00:02 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
