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

package:
  name: r-data.table
  version: {{ version|replace("-", "_") }}

source:
  url:
    - {{ cran_mirror }}/src/contrib/data.table_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/data.table/data.table_{{ version }}.tar.gz
  sha256: d2c433e5c730a32b2127fbb91d5054aa5912e1aaed17e96f3e29517f4765ee12

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

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ posix }}filesystem      # [win]
    - {{ posix }}make
    - {{ posix }}sed             # [win]
    - {{ posix }}coreutils       # [win]
    - {{ posix }}zip             # [win]
    - pkg-config
  host:
    - r-base
    - libgomp                    # [linux]
    - llvm-openmp                # [osx]
    - zlib                       # [not win]
    - {{ native }}zlib           # [win]
  run:
    - r-base
    - {{ native }}gcc-libs       # [win]
    - {{ native }}zlib           # [win]

test:
  requires:
    - r-bit64
    - r-r.utils
  commands:
    - $R -e "library('data.table')"                                           # [not win]
    - $R -e "library('data.table');test.data.table()"                         # [not win]
    - "\"%R%\" -e \"library('data.table')\""                                  # [win]
    - "SET TZ=UTC && \"%R%\" -e \"library('data.table');test.data.table()\""  # [win]

about:
  home: https://r-datatable.com
  dev_url: https://github.com/Rdatatable/data.table
  doc_url: https://rdatatable.gitlab.io/data.table/
  license: MPL-2.0
  summary: Fast aggregation of large data (e.g. 100GB in RAM), fast ordered joins, fast add/modify/delete of columns by group using no copies at all, list columns, friendly and fast character-separated-value read/write. Offers a natural and flexible syntax, for faster development.
  license_family: OTHER
  license_file:
    - LICENSE

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