{% set version = '0.3.0' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/decido_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/decido/decido_{{ version }}.tar.gz
  sha256: fc1ad0f9e91e4a12f9c6f7d8be658a35b44d7a166936509f7373f8a27df9c393

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]

  host:
    - r-base
    - r-rcpp

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

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

about:
  home: https://hypertidy.github.io/decido

  license: MIT
  summary: Provides constrained triangulation of polygons. Ear cutting (or ear clipping) applies
    constrained triangulation by successively 'cutting' triangles from a polygon defined
    by path/s. Holes are supported by introducing a bridge segment between polygon paths.
    This package wraps the 'header-only' library 'earcut.hpp' <https://github.com/mapbox/earcut.hpp.git>
    which includes a reference to the method used by Held, M. (2001) <doi:10.1007/s00453-001-0028-4>.

  license_family: MIT
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'
    - LICENSE

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