{% set version = '0.3-6' %}

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

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

source:
  fn: geometry_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/geometry_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/geometry/geometry_{{ version }}.tar.gz
  sha256: 2be231ac99171367635cd957f27da77705329df97520ab86f655839c41dc0968

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

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

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

about:
  home: https://cran.r-project.org/package=geometry
  license: GPL (>= 3)
  license_file: LICENSE
  summary: Makes the qhull library (www.qhull.org) available in R, in a similar manner as in
    Octave and MATLAB. Qhull computes convex hulls, Delaunay triangulations, halfspace
    intersections about a point, Voronoi diagrams, furthest-site Delaunay triangulations,
    and furthest-site Voronoi diagrams. It runs in 2-d, 3-d, 4-d, and higher dimensions.
    It implements the Quickhull algorithm for computing the convex hull. Qhull does
    not support constrained Delaunay triangulations, or mesh generation of non-convex
    objects, but the package does include some R functions that allow for this. Currently
    the package only gives access to Delaunay triangulation and convex hull computation.

extra:
  recipe-maintainers:
    - ocefpaf
