{% set version = "0.2-4" %}

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

source:
  fn: pbdZMQ_{{ version }}.tar.gz
  url:
    - http://cran.r-project.org/src/contrib/pbdZMQ_{{ version }}.tar.gz
    - http://cran.r-project.org/src/contrib/Archive/pbdZMQ/pbdZMQ_{{ version }}.tar.gz
  sha256: bfacac88b0d4156c70cf63fc4cb9969a950693996901a4fa3dcd59949ec065f6

build:
  number: 0
  skip: True  # [win32]
  script: R CMD INSTALL --build .
  rpaths:
    - lib/R/lib/
    - lib/

# unlike r-rzmq, this package pre-bakes a whole set of Windows
# Makefiles, and so it doesn't depend on our shared
# m2-mingw-w64-zeromq package. This is beyond horrible.
requirements:  # [not win32]
  build:  # [not win32]
    - r-base  # [not win32]
    - r-r6  # [not win32]
    - posix  # [win64]
    - pkg-config  # [not win]
    - m2w64-toolchain  # [win64]
    - gcc  # [not win]
    - zeromq 4.1.*  # [not win]
  run:  # [not win32]
    - r-base  # [not win32]
    - r-r6  # [not win32]
    - zeromq 4.1.*  # [not win]

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

about:
  home: http://r-pbd.org/
  license: GPL-3.0
  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.1.0 rc1)
    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."

extra:
  recipe-maintainers:
    - ocefpaf
