{% set version = '1.1.3' %}

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

package:
  name: r-utf8
  version: {{ version }}

source:
  fn: utf8_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/utf8_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/utf8/utf8_{{ version }}.tar.gz
  sha256: 43b394c3274ba0f66719d28dc4a7babeb87187e766de8d8ca716e0548091440f

build:
  merge_build_host: True  # [win]
  number: 1
  script: R CMD INSTALL --build .
  skip: True  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
  run:
    - r-base

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

about:
  home: https://cran.r-project.org/web/packages/utf8
  license: Apache 2.0
  license_file: LICENSE
  summary: Process and print 'UTF-8' encoded international text (Unicode). Input, validate, normalize,
    encode, format, and display.

extra:
  recipe-maintainers:
    - ocefpaf
