{% set version = '0.4.1' %}

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

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

source:
  fn: bigrquery_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/bigrquery_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/bigrquery/bigrquery_{{ version }}.tar.gz
  sha256: 2168e9cdd76aa253f65ee3bf1670af7c4e19e52e3ef8c49c64a96241d12f111e

build:
  merge_build_host: True  # [win]
  number: 1002
  skip: true  # [win32]

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
    - r-dbi
    - r-assertthat
    - r-httr
    - r-jsonlite
    - r-progress
    - r-readr

  run:
    - r-base
    - r-dbi
    - r-assertthat
    - r-httr
    - r-jsonlite
    - r-progress
    - r-readr

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

about:
  home: https://github.com/rstats-db/bigrquery
  license: GPL-3
  summary: Easily talk to Google's 'BigQuery' database from R.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - adrianzo
