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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/RMariaDB_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/RMariaDB/RMariaDB_{{ version }}.tar.gz
  sha256: b6cb6a6c66c7f249378f210f005beaa790b4a44dc2043cc0d46ab7d46374220e

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 }}sed               # [win]
    - {{ posix }}grep              # [win]
    - {{ posix }}autoconf
    - {{ posix }}automake          # [not win]
    - {{ posix }}automake-wrapper  # [win]
    - {{ posix }}pkg-config
    - {{ posix }}make
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-bh
    - r-dbi >=1.1.0
    - r-rcpp >=0.12.4
    - r-bit64
    - r-hms >=0.5.0
    - r-lubridate
    - r-plogr
    - mysql-connector-c
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-bh
    - r-dbi >=1.1.0
    - r-rcpp >=0.12.4
    - r-bit64
    - r-hms >=0.5.0
    - r-lubridate
    - r-plogr
    - mysql-connector-c

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

about:
  home: https://github.com/r-dbi/RMariaDB, https://downloads.mariadb.org/connector-c/
  license: GPL-3.0-only
  summary: Implements a 'DBI'-compliant interface to 'MariaDB' (<https://mariadb.org/>) and 'MySQL' (<https://www.mysql.com/>) databases.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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