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

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

source:
  fn: zip_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/zip_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/zip/zip_{{ version }}.tar.gz
  sha256: 6fa9ec7b093b8c717c50f205d4335c31c43c2ecb51c0242c9a0337d8d84df965

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{native}}gcc-libs         # [win]

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

about:
  home: https://github.com/gaborcsardi/zip
  license: CC0
  summary: Cross-Platform 'zip' Compression Library. A replacement for the 'zip' function, that
    does not require any additional external tools on any platform.
  license_family: CC

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