{% set version = '1.4.1' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/backports_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/backports/backports_{{ version }}.tar.gz
  sha256: 845c3c59fbb05e5a892c4231b955a0afdd331d82b7cc815bcff0672023242474

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/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base

  run:
    - r-base
    - {{native}}gcc-libs         # [win]

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('backports')"           # [not win]
    - "\"%R%\" -e \"library('backports')\""  # [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://github.com/r-lib/backports
  license: GPL-2 | GPL-3
  summary: Functions introduced or changed since R v3.0.0 are re-implemented in this package.
    The backports are conditionally exported in order to let R resolve the function
    name to either the implemented backport, or the respective base version, if available.
    Package developers can make use of new functions or arguments by selectively importing
    specific backports to support older installations.
  license_family: GPL3
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - mingwandroid

# The original CRAN metadata for this package was:

# Package: backports
# Type: Package
# Title: Reimplementations of Functions Introduced Since R-3.0.0
# Version: 1.4.1
# Authors@R: c( person("Michel", "Lang", NULL, "michellang@gmail.com", role = c("cre", "aut"), comment = c(ORCID = "0000-0001-9754-0393")), person("R Core Team", role = "aut"))
# Maintainer: Michel Lang <michellang@gmail.com>
# Description: Functions introduced or changed since R v3.0.0 are re-implemented in this package. The backports are conditionally exported in order to let R resolve the function name to either the implemented backport, or the respective base version, if available. Package developers can make use of new functions or arguments by selectively importing specific backports to support older installations.
# URL: https://github.com/r-lib/backports
# BugReports: https://github.com/r-lib/backports/issues
# License: GPL-2 | GPL-3
# NeedsCompilation: yes
# ByteCompile: yes
# Depends: R (>= 3.0.0)
# Encoding: UTF-8
# RoxygenNote: 7.1.2
# Packaged: 2021-12-13 10:49:30 UTC; michel
# Author: Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), R Core Team [aut]
# Repository: CRAN
# Date/Publication: 2021-12-13 11:30:02 UTC

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