{% set version = '0.1.6' %}

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

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

source:
  fn: sourcetools_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/sourcetools_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/sourcetools/sourcetools_{{ version }}.tar.gz


  sha256: c9f48d2f0b7f7ed0e7fecdf8e730b0b80c4d567f0e1e880d118b0944b1330c51

build:
  number: 0

  rpaths:
    - lib/R/lib/
    - lib/
  skip: True  # [win32]

requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base

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



about:
  home: https://CRAN.R-project.org/package=sourcetools
  license: MIT
  summary: Tools for the reading and tokenization of R code. The 'sourcetools' package provides
    both an R and C++ interface for the tokenization of R code, and helpers for interacting
    with the tokenized representation of R code.
  license_family: MIT
  license_file: LICENSE



extra:
  recipe-maintainers:
    - croth1
