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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/humaniformat_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/humaniformat/humaniformat_{{ version }}.tar.gz
  sha256: 861232c66bf6d4ff91b073193506104f4d99eca5e9a9488327f39ef2bfb45e6d

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

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-rcpp
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp

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

about:
  home: https://github.com/ironholds/humaniformat/
  license: MIT
  summary: Human names are complicated and nonstandard things. Humaniformat, which is based on
    Anthony Ettinger's 'humanparser' project (https://github.com/ chovy/humanparser)
    provides functions for parsing human names, making a best- guess attempt to distinguish
    sub-components such as prefixes, suffixes, middle names and salutations.
  license_family: MIT
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/MIT
    - LICENSE

extra:
  recipe-maintainers:
    - conda-forge/r
