{% set version = '1.6.4' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/gdistance_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/gdistance/gdistance_{{ version }}.tar.gz
  sha256: 6af5fd3ea7e256f34d705d4817bb88056037ce1d68adfeb28d61c4a640d8992b

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0
  # no skip
  noarch: generic

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: knitr, markdown, rmarkdown, testthat (>= 2.1.0)
requirements:
  build:
    - {{ posix }}zip               # [win]

  host:
    - r-base
    - r-matrix
    - r-igraph >=0.7.0
    - r-raster >=1.9_19
    - r-sp
    - r-terra

  run:
    - r-base
    - r-matrix
    - r-igraph >=0.7.0
    - r-raster >=1.9_19
    - r-sp
    - r-terra

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('gdistance')"           # [not win]
    - "\"%R%\" -e \"library('gdistance')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: https://AgrDataSci.github.io/gdistance/
  license: GPL-2
  summary: Provides classes and functions to calculate various distance measures and routes in
    heterogeneous geographic spaces represented as grids. The package implements measures
    to model dispersal histories first presented by van Etten and Hijmans (2010) <doi:10.1371/journal.pone.0012060>.
    Least-cost distances as well as more complex distances based on (constrained) random
    walks can be calculated. The distances implemented in the package are used in geographical
    genetics, accessibility indicators, and may also have applications in other fields
    of geospatial analysis.
  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - katietz

# The original CRAN metadata for this package was:

# Package: gdistance
# Type: Package
# Title: Distances and Routes on Geographical Grids
# Version: 1.6.4
# Authors@R: c( person("Jacob", "van Etten", role = c("aut"), comment = c(ORCID = "0000-0001-7554-2558")), person("Kaue", "de Sousa", role = c("ctb"), comment = c(ORCID = "0000-0002-7571-7845")), person("Andrew", "Marx", role = c("cre", "ctb"), email = "ajm.rpackages@gmail.com", comment = c(ORCID = "0000-0002-7456-1631")))
# URL: https://AgrDataSci.github.io/gdistance/
# BugReports: https://github.com/AgrDataSci/gdistance/issues
# Description: Provides classes and functions to calculate various distance measures and routes in heterogeneous geographic spaces represented as grids. The package implements measures to model dispersal histories first presented by van Etten and Hijmans (2010) <doi:10.1371/journal.pone.0012060>. Least-cost distances as well as more complex distances based on (constrained) random walks can be calculated. The distances implemented in the package are used in geographical genetics, accessibility indicators, and may also have applications in other fields of geospatial analysis.
# License: GPL (>= 2)
# Encoding: UTF-8
# LazyData: true
# Depends: R (>= 3.2.0), raster (>= 1.9-19), methods, igraph (>= 0.7.0), Matrix
# Imports: sp, stats, terra
# Suggests: knitr, markdown, rmarkdown, testthat (>= 2.1.0)
# RoxygenNote: 7.2.3
# VignetteBuilder: knitr
# NeedsCompilation: no
# Packaged: 2023-06-19 20:47:27 UTC; andrewjmarx
# Author: Jacob van Etten [aut] (<https://orcid.org/0000-0001-7554-2558>), Kaue de Sousa [ctb] (<https://orcid.org/0000-0002-7571-7845>), Andrew Marx [cre, ctb] (<https://orcid.org/0000-0002-7456-1631>)
# Maintainer: Andrew Marx <ajm.rpackages@gmail.com>
# Repository: CRAN
# Date/Publication: 2023-06-19 21:20:02 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
