{% set version = '2.5-8' %}

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

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

source:
  fn: raster_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/raster_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/raster/raster_{{ version }}.tar.gz
  sha256: 47992abd783450513fbce3770298cc257030bf0eb77e42aa3a4b3924b16264cc

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

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

requirements:
  build:
    - r-base
    - r-rcpp
    - r-sp >=1.2_0
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-rcpp
    - r-sp >=1.2_0
    - libgcc  # [not win]

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

about:
  home: http://cran.r-project.org/package=raster
  license: GPL (>= 3)
  summary: Reading, writing, manipulating, analyzing and modeling of gridded spatial data. The
    package implements basic and high-level functions. Processing of very large files
    is supported.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
