{% set version = "1.51.0" %}

package:
  name: libuv
  version: {{ version }}

source:
  url: https://github.com/libuv/libuv/archive/v{{ version }}.tar.gz
  sha256: 27e55cf7083913bfb6826ca78cde9de7647cded648d35f24163f2d31bb9f51cd
  patches:
    # linux.c:1638:21: error: 'CLOCK_BOOTTIME' undeclared
    - boottime.patch

build:
  number: 0
  run_exports:
    - {{ pin_subpackage('libuv', max_pin='x') }}

requirements:
  build:
    - {{ compiler('c') }}
    - {{ stdlib("c") }}
    - automake             # [unix]
    - autoconf             # [unix]
    - libtool              # [unix]
    - make                 # [unix]
    - sed                  # [osx]
    - cmake-no-system      # [win]
    - ninja                # [win]

test:
  commands:
    - test -f "$PREFIX/include/uv.h"    # [unix]
    - test -f "$PREFIX/lib/libuv.a"     # [unix]
    - test -f "$PREFIX/lib/libuv.so.1"  # [linux]
    - test -f "$PREFIX/lib/libuv.1.dylib"  # [osx]
    - test -f "$PREFIX/lib/libuv${SHLIB_EXT}"  # [not win]
    - test -f "$PREFIX/lib/pkgconfig/libuv.pc"  # [not win]
    - if not exist %LIBRARY_INC%\uv.h (exit 1)      # [win]
    - if not exist %LIBRARY_LIB%\uv.lib (exit 1)    # [win]
    - if not exist %LIBRARY_BIN%\uv.dll (exit 1)    # [win]
    - if not exist %LIBRARY_LIB%\pkgconfig/libuv.pc (exit 1)         # [win]

about:
  home: http://libuv.org/
  license: MIT
  license_family: MIT
  license_file: LICENSE
  summary: Cross-platform asynchronous I/O
  description: |
    libuv is a multi-platform support library with a focus on asynchronous I/O.
    It was primarily developed for use by Node.js, but it's also used by Luvit,
    Julia, pyuv, and others.
  doc_url: http://docs.libuv.org/
  dev_url: https://github.com/libuv/libuv

extra:
  recipe-maintainers:
    - jjerphan
    - frol
    - mariusvniekerk
