{% set version = '0.4.7.2' %}

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

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

source:
  fn: highlight_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/highlight_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/highlight/highlight_{{ version }}.tar.gz
  sha256: 20581d440dabd3bfd18872aa2d4b87d1dd071a8359f8c44cc3c3af47df548175

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

  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

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

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

about:
  home: https://github.com/romainfrancois/highlight
  license: GPL (>= 3)
  summary: Syntax highlighter for R code based  on the results of the R parser. Rendering in
    HTML and latex  markup. Custom Sweave driver performing syntax highlighting  of
    R code chunks.
  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
