{% set version = "1.7.4" %}

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

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

source:
  fn: lubridate_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/lubridate_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/lubridate/lubridate_{{ version }}.tar.gz
  sha256: 510ca87bd91631c395655ee5029b291e948b33df09e56f6be5839f43e3104891

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-rcpp >=0.12.13
    - r-stringr
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
  run:
    - r-base
    - r-rcpp >=0.12.13
    - r-stringr
    - libgcc  # [not win]

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

about:
  home: https://github.com/tidyverse/lubridate
  license: GPL (>= 2)
  summary: Functions to work with date-times and time-spans
  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:
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
