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

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

source:
  fn: git2r_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/git2r_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/git2r/git2r_{{ version }}.tar.gz
  sha256: 0480e4c47394ad1724c80982eff3be5ce34168046939340bf22cc1df6b6baf87

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

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
    - libssh2
    - openssl
    - zlib

  run:
    - r-base
    - libssh2
    - openssl
    - zlib

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

about:
  home: https://github.com/ropensci/git2r
  license: GPL-2
  summary: Interface to the 'libgit2' library, which is a pure C implementation of the 'Git'
    core methods. Provides access to 'Git' repositories to extract data and running
    some basic 'Git' commands.
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]

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