{% set version = "0.5-13.2" %}

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

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

source:
  fn: gmp_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/gmp_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/gmp/gmp_{{ version }}.tar.gz
  sha256: ae6b7ef8cdb67df7888aaa2b27ee387e3f4e11193e247d67d8385aa2b294a6f5

build:
  merge_build_host: True  # [win]
  number: 2
  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
    - {{native}}gmp >=5.0.1,<7

  run:
    - r-base
    - {{native}}gmp >=5.0.1,<7

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

about:
  home: http://mulcyber.toulouse.inra.fr/projects/gmp
  license: GPL
  summary: Multiple Precision Arithmetic (big integers and rationals, prime number tests, matrix
    computation), "arithmetic without limitations" using the C library GMP (GNU Multiple
    Precision Arithmetic).
  license_family: GPL

extra:
  recipe-maintainers:
    - dpryan79
    - johanneskoester
    - bgruening
