{% set version = '0.1.6' %}

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

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

source:
  fn: gdtools_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/gdtools_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/gdtools/gdtools_{{ version }}.tar.gz
  sha256: c5c1d9bea7d97ecd62116ee8119c6fb889060469900449a4653c02ac11b37c80

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-rcpp >=0.12.12
    - r-withr
    - pkg-config           # [not win]
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
    - freetype 2.7|2.7.*
    - xorg-libxrender
    - xorg-libxext
    - xorg-libxdmcp
    - xorg-libxau

  run:
    - r-base
    - r-rcpp >=0.12.12
    - r-withr
    - libgcc  # [not win]
    - freetype 2.7|2.7.*
    - xorg-libxrender
    - xorg-libxext
    - xorg-libxdmcp
    - xorg-libxau

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

about:
  home: https://CRAN.R-project.org/package=gdtools
  license: GPL-3
  summary: Useful tools for writing vector graphics devices.
  license_family: GPL3

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