{% set version = '1.0.2' %}

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

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

source:
  fn: pkgbuild_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/pkgbuild_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/pkgbuild/pkgbuild_{{ version }}.tar.gz
  sha256: 1a3e2a321742aab8dbda150f952c61b2a04e41618e9517e95d229f7ebaca39c4

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

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

requirements:
  build:
    - {{posix}}zip               # [win]

  host:
    - r-base
    - r-r6
    - r-callr >=2.0.0
    - r-cli
    - r-crayon
    - r-desc
    - r-prettyunits
    - r-rprojroot
    - r-withr >=2.1.2

  run:
    - r-base
    - r-r6
    - r-callr >=2.0.0
    - r-cli
    - r-crayon
    - r-desc
    - r-prettyunits
    - r-rprojroot
    - r-withr >=2.1.2

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

about:
  home: https://github.com/r-lib/pkgbuild
  license: GPL-3
  summary: Provides functions used to build R packages. Locates compilers needed to build R packages
    on various platforms and ensures the PATH is configured appropriately so R can use
    them.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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