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

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

source:
  fn: stringi_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/stringi_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/stringi/stringi_{{ version }}.tar.gz
  sha256: 01570a200a25bde62c47b241636e67d73425efa10b924b63959a867796ea86f8

build:
  merge_build_host: True  # [win]
  number: 1001
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}sed               # [win]
    - {{posix}}grep              # [win]
    - {{posix}}autoconf
    - {{posix}}automake          # [not win]
    - {{posix}}automake-wrapper  # [win]
    - {{posix}}pkg-config
    - {{posix}}make
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{native}}icu
    - {{native}}gcc-libs         # [win]

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

about:
  home: http://www.gagolewski.com/software/stringi/ http://site.icu-project.org/ http://www.unicode.org/
  license: FOSS
  license_file: LICENSE
  summary: 'Allows for fast, correct, consistent, portable, as well as convenient character string/text
    processing in every locale and any native encoding. Owing to the use of the ''ICU''
    library, the package provides ''R'' users with platform-independent functions known
    to ''Java'', ''Perl'', ''Python'', ''PHP'', and ''Ruby'' programmers. Available
    features include: pattern searching (e.g., with ''Java''-like regular expressions
    or the ''Unicode'' collation algorithm), random string generation, case mapping,
    string transliteration, concatenation, Unicode normalization, date-time formatting
    and parsing, and many more.'
  license_family: OTHER

extra:
  recipe-maintainers:
    - ocefpaf
    - mariusvniekerk
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
