{% set version = '0.7' %}

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

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

source:
  fn: flock_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/flock_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/flock/flock_{{ version }}.tar.gz
  sha256: 47ebdeaeeb63ec93c800782bafa7f2846f73bb905adb6a3b5c44b248ce1de9fd

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-rcpp

  run:
    - r-base
    - r-rcpp

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

about:
  home: https://CRAN.R-project.org/package=flock
  license: Apache-2-0
  summary: Implements synchronization between R processes (spawned by using the "parallel" package
    for instance) using file locks. Supports both exclusive and shared locking.
  license_family: APACHE

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