{% set version = '0.9-7' %}

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

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

source:
  fn: xts_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/xts_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/xts/xts_{{ version }}.tar.gz
  sha256: f11f7cb98f4b92b7f6632a2151257914130880c267736ef5a264b5dc2dfb7098

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-zoo >=1.7_10
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-zoo >=1.7_10
    - libgcc  # [not win]

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

about:
  home: http://r-forge.r-project.org/projects/xts/
  license: GPL (>= 2)
  summary: Provide for uniform handling of R's different time-based data classes by extending
    zoo, maximizing native format information preservation and allowing for user level
    customization and extension, while simplifying cross-class interoperability.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
