{% set version = "0.99.9" %}

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

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

source:
  fn: rgl_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/rgl_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/rgl/rgl_{{ version }}.tar.gz
  sha256: b5bdc24ba7f86b940158ad72ac9069e7b80067f103493fc916a6af3a007e64e7

build:
  merge_build_host: True  # [win]
  number: 1
  # X-server not available for osx
  skip: true  # [win32 or osx]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-htmltools
    - r-htmlwidgets
    - r-jsonlite >=0.9.20
    - r-knitr
    - r-magrittr
    - r-shiny
    - r-crosstalk
    - libglu               # [linux]

  run:
    - r-base
    - r-htmltools
    - r-htmlwidgets
    - r-crosstalk
    - r-jsonlite >=0.9.20
    - r-knitr
    - r-magrittr
    - r-shiny
    - libglu  # [linux]

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

about:
  home: https://r-forge.r-project.org/projects/rgl/
  license: GPL
  summary: Provides medium to high level functions for 3D interactive graphics, including functions
    modelled on base graphics (plot3d(), etc.) as well as functions for constructing
    representations of geometric objects (cube3d(), etc.).  Output may be on screen
    using OpenGL, or to various standard 3D file formats including WebGL, PLY, OBJ,
    STL as well as 2D image formats, including PNG, Postscript, SVG, PGF.
  license_family: GPL

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