{% set version = "1.4-7" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/sp_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/sp/sp_{{ version }}.tar.gz
  sha256: 01946953707363b78d3eb8dcf472ea8c6ea0097094aa0ca0b756ce5fac01b1ad

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - r-lattice                  # [build_platform != target_platform]
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-lattice
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-lattice

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

about:
  home: https://github.com/edzer/sp/ https://edzer.github.io/sp/
  license: GPL-2.0-or-later
  summary: Classes and methods for spatial data; the classes document where the spatial location information resides, for 2D or 3D data. Utility functions are provided, e.g. for plotting data as maps, spatial selection, as well as methods for retrieving coordinates, for subsetting, print, summary, etc.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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