{% set version = '1.1-2' %}

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

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

source:
  fn: RSQLite_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/RSQLite_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/RSQLite/RSQLite_{{ version }}.tar.gz
  sha256: e4022e6a134bb0ff00d33474d2189a7bb48ee12b513d258e957b78bb1bf4e955

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

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

requirements:
  build:
    - r-base
    - r-bh
    - r-dbi >=0.4_9
    - r-rcpp
    - r-memoise
    - r-plogr
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-bh
    - r-dbi >=0.4_9
    - r-rcpp
    - r-memoise
    - r-plogr
    - libgcc               # [not win]

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

about:
  home: https://github.com/rstats-db/RSQLite
  license: LGPL (>= 2)
  summary: Embeds the 'SQLite' database engine in R and provides an interface compliant with
    the 'DBI' package. The source for the 'SQLite' engine (version 3.8.8.2) is included.
  license_family: LGPL

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
