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

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

source:
  fn: selectr_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/selectr_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/selectr/selectr_{{ version }}.tar.gz
  sha256: 8bd42f167629344e485e586f9b05fed342746132489079084d82133d7b3ee2ca

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-r6
    - r-stringr
  run:
    - r-base
    - r-r6
    - r-stringr

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

about:
  home: https://sjp.co.nz/projects/selectr
  license: BSD_3_clause
  summary: Translates a CSS3 selector into an equivalent XPath expression. This allows us to
    use CSS selectors when working with the XML package as it can only evaluate XPath
    expressions. Also provided are convenience functions useful for using CSS selectors
    on XML nodes. This package is a port of the Python package 'cssselect' (<https://cssselect.readthedocs.io/>).
  license_family: BSD

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