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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/odbc_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/odbc/odbc_{{ version }}.tar.gz
  sha256: f5120947fa00d544d78493fd2585382c037593e28eefc249828c76f3a65d2ee8

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.0.0
    - r-rcpp >=0.12.11
    - r-bit64
    - r-blob >=1.2.0
    - r-hms
    - r-rlang
    - unixodbc  # [unix]
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    # BH is the header-only part of Boost and thus a compile-time requirement only
    # - r-bh
    - r-dbi >=1.0.0
    - r-rcpp >=0.12.11
    - r-bit64
    - r-blob >=1.2.0
    - r-hms
    - r-rlang
    - unixodbc  # [unix]

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

about:
  home: https://github.com/r-dbi/odbc
  license: MIT
  summary: A DBI-compatible interface to ODBC databases.
  license_family: MIT
  license_file: LICENSE

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

# Package: odbc
# Title: Connect to ODBC Compatible Databases (using the DBI Interface)
# Version: 1.1.6
# Authors@R: c( person("Jim", "Hester", , "james.hester@rstudio.com", role = c("aut", "cre")), person("Hadley", "Wickham", , "hadley@rstudio.com", role = c("aut")), person("lexicalunit", role = c("cph"), comment = "nanodbc library"), person("Google Inc.", role = c("cph"), comment = "cctz library"), person("RStudio", role = c("cph", "fnd")) )
# Description: A DBI-compatible interface to ODBC databases.
# License: MIT + file LICENSE
# URL: https://github.com/r-dbi/odbc
# BugReports: https://github.com/r-dbi/odbc/issues
# SystemRequirements: C++11, GNU make, An ODBC3 driver manager and drivers.
# RoxygenNote: 6.0.1
# LazyData: true
# ByteCompile: true
# Depends: R (>= 3.2.0)
# Imports: DBI (>= 1.0.0), methods, Rcpp (>= 0.12.11), blob (>= 1.1.0), bit64, hms
# Suggests: tibble, DBItest, testthat, covr, magrittr
# LinkingTo: Rcpp, BH
# Collate: 'odbc.R' 'Driver.R' 'Connection.R' 'DataTypes.R' 'RcppExports.R' 'Result.R' 'Table.R' 'Viewer.R' 'db.R' 'hidden.R' 'utils.R' 'zzz.R'
# NeedsCompilation: yes
# Packaged: 2018-06-08 20:54:50 UTC; jhester
# Author: Jim Hester [aut, cre], Hadley Wickham [aut], lexicalunit [cph] (nanodbc library), Google Inc. [cph] (cctz library), RStudio [cph, fnd]
# Maintainer: Jim Hester <james.hester@rstudio.com>
# Repository: CRAN
# Date/Publication: 2018-06-09 20:02:13 UTC
