{% set version = '0.1-8' %}

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

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

source:
  fn: jpeg_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/jpeg_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/jpeg/jpeg_{{ version }}.tar.gz
  sha256: d032befeb3a414cefdbf70ba29a6c01541c54387cc0a1a98a4022d86cbe60a16

build:
  number: 0
  skip: true  # [win32]

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

requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base

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

about:
  home: http://www.rforge.net/jpeg/
  license: GPL-2 | GPL-3
  summary: This package provides an easy and simple way to read, write and display bitmap images
    stored in the JPEG format. It can read and write both files and in-memory raw vectors.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
