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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/clock_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/clock/clock_{{ version }}.tar.gz
  sha256: 6430917f2fbca294488d5887b3355057c3fc9531da38d1eb43b3b749966672a1

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

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-cpp11 >=0.2.7
    - r-ellipsis >=0.3.1
    - r-rlang >=0.4.10
    - r-tzdb >=0.1.1
    - r-vctrs >=0.3.7
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-cpp11 >=0.2.7
    - r-ellipsis >=0.3.1
    - r-rlang >=0.4.10
    - r-tzdb >=0.1.1
    - r-vctrs >=0.3.7

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

about:
  home: https://clock.r-lib.org, https://github.com/r-lib/clock
  license: MIT
  summary: 'Provides a comprehensive library for date-time manipulations using a new family of orthogonal date-time classes (durations, time points, zoned-times, and calendars) that partition responsibilities so that the complexities of time zones are only considered when they are really needed. Capabilities include: date-time
    parsing, formatting, arithmetic, extraction and updating of components, and rounding.'
  license_family: MIT
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/MIT
    - LICENSE

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