{% set version = "0.3-13" %}
{% set posix = 'm2-' if win else '' %}

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/pbdZMQ_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/pbdZMQ/pbdZMQ_{{ version }}.tar.gz
  sha256: 4139a88323642b734a83a8d73ea34550f8ef279389e794a5a3a5f3e8f579839a

build:
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
    - gnuconfig                    # [unix]
    - {{ compiler('c') }}          # [not win]
    - {{ stdlib("c") }}            # [not win]
    - {{ compiler('cxx') }}        # [not win]
    - {{ compiler('m2w64_c') }}    # [win]
    - {{ stdlib("m2w64_c") }}      # [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
    - zeromq
  run:
    - r-base

test:
  source_files:
    - tests/
  commands:
    - $R -e "library('pbdZMQ')"     # [not win]
    - $R -f tests/address.R         # [not win]
    - $R -f tests/ports.R           # [not win]
    - $R -f tests/send_recv.R       # [not win]
    - $R -f tests/send_recv_rzmq.R  # [not win]
    - "\"%R%\" -e \"library('pbdZMQ')\""   # [win]
    - "\"%R%\" -f tests/address.R"         # [win]
    - "\"%R%\" -f tests/ports.R"           # [win]
    - "\"%R%\" -f tests/send_recv.R"       # [win]
    - "\"%R%\" -f tests/send_recv_rzmq.R"  # [win]

about:
  home: http://r-pbd.org/
  dev_url: https://github.com/snoweye/pbdZMQ
  license: GPL-3.0-only
  summary: "'ZeroMQ' is a well-known library for high-performance asynchronous messaging in scalable, distributed applications.  This package provides high level R wrapper functions to easily utilize 'ZeroMQ'. We mainly focus on interactive client/server programming frameworks. For convenience, a minimal 'ZeroMQ' library
    (4.2.2) is shipped with 'pbdZMQ', which can be used if no system installation of 'ZeroMQ' is available.  A few wrapper functions compatible with 'rzmq' are also provided."
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

extra:
  recipe-maintainers:
    - conda-forge/r
    - ocefpaf
    - mingwandroid
