{% set version = "3.1.5" %}
{% set commit = "1535d223d5df0c8f6a2722796efb96c845c25405" %}

package:
  name: mpfr
  version: {{ version }}

source:
  fn: mpfr-{{ version }}.tar.bz2                                                    # [unix]
  url: http://ftp.gnu.org/gnu/mpfr/mpfr-{{ version }}.tar.gz                        # [unix]
  sha256: f4eb5070883aee3fd8b927751ea63ff95aebe24418cde852439ce74c3dd2513c          # [unix]
  fn: {{ commit }}.zip                                                              # [win]
  url: https://github.com/BrianGladman/mpfr/archive/{{ commit }}.zip                # [win]
  sha256: 050eb5f8c40e634d2681b5d84764b75bb103c35a7491e999d6a5b3a94b34f325          # [win]

build:
  number: 0
  features:
    - vc14            # [win]
  msvc_compiler: 14.0

requirements:
  build:
    - toolchain
    - m4              # [unix]
    - libtool         # [unix]
    - gmp             # [unix]
    - vc 14           # [win]
    - mpir            # [win]
  run:
    - gmp             # [unix]
    - mpir            # [win]
    - vc 14           # [win]

test:
  commands:
    - if not exist %LIBRARY_INC%\\mpfr.h exit 1                # [win]
    - if not exist %LIBRARY_LIB%\\mpfr.lib exit 1              # [win]
    - if not exist %LIBRARY_BIN%\\mpfr.dll exit 1              # [win]
    - if not exist %LIBRARY_LIB%\\mpfr_static.lib exit 1       # [win]
    - test -f ${PREFIX}/lib/libmpfr.a                          # [unix]
    - test -f ${PREFIX}/lib/libmpfr.dylib                      # [osx]
    - test -f ${PREFIX}/lib/libmpfr.so                         # [linux]

about:
  home: http://www.mpfr.org/
  license: LGPL 3
  license_file: {{ SRC_DIR }}/COPYING.LESSER
  summary: The MPFR library is a C library for multiple-precision floating-point computations with correct rounding.

extra:
  recipe-maintainers:
    - isuruf
    - jakirkham
