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

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

source:
  fn: celestial_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/celestial_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/celestial/celestial_{{ version }}.tar.gz
  sha256: 7f1e0a607f4683519a0d3576de1f33d5fdc9e0d7c8e87e1a4b5203498b9a6e33

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-nistunits
    - r-rann
    - r-pracma
  run:
    - r-base
    - r-nistunits
    - r-rann
    - r-pracma

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

about:
  home: https://CRAN.R-project.org/package=celestial
  license: GPL-3
  summary: Contains a number of common astronomy conversion routines, particularly the HMS and
    degrees schemes, which can be fiddly to convert between on mass due to the textural
    nature of the former. It allows users to coordinate match datasets quickly. It also
    contains functions for various cosmological calculations.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

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