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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/xopen_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/xopen/xopen_{{ version }}.tar.gz
  sha256: e207603844d69c226142be95281ba2f4a056b9d8cbfae7791ba60535637b3bef

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-processx
  run:
    - r-base
    - r-processx

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

about:
  home: https://github.com/r-lib/xopen#readme
  license: MIT
  summary: Cross platform solution to open files, directories or 'URLs' with their associated
    programs.
  license_family: MIT
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\MIT'  # [win]

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