{% set version = '1.0.1' %}

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

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

source:
  fn: pkgload_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/pkgload_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/pkgload/pkgload_{{ version }}.tar.gz
  sha256: 4861564200598dba71c61462b05c00ea9f365da12ff6ccf2fa4814abf656a056

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

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

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

  host:
    - r-base
    - r-desc
    - r-pkgbuild
    - r-rlang
    - r-rprojroot
    - r-rstudioapi
    - r-withr

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-desc
    - r-pkgbuild
    - r-rlang
    - r-rprojroot
    - r-rstudioapi
    - r-withr

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

about:
  home: https://github.com/r-lib/pkgload
  license: GPL-3
  summary: Simulates the process of installing a package and then attaching it. This is a key
    part of the 'devtools' package as it allows you to rapidly iterate while developing
    a package.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

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