{% set version = "14.8.0" %}

# NODE_MODULE_VERSION set in src/node_version.h
{% set NODE_MODULE_VERSION = 83 %}

package:
  name: nodejs
  version: {{ version }}

source:
  fn: node-v{{ version }}.tar.gz
  url: https://nodejs.org/dist/v{{ version }}/node-v{{ version }}.tar.gz  # [not win]
  sha256: 6552a640a8b1a34f4ad00b4147eed6432386b304dcb2f5d73a659258ed2a8cf2  # [not win]
  url: https://nodejs.org/dist/v{{ version }}/node-v{{ version }}-win-x64.zip  # [win]
  sha256: 848ca582bdf8b7fdc21a38d9f3887a45bdf6381b04549fc0f918852889157c9a  # [win]
  patches:
    - linux-librt.patch  # [not win]
    - cinttypes.patch  # [linux]
    - linux-install.patch  # [linux]

build:
  number: 0
  # Prefix replacement breaks in the binary embedded configurations.
  detect_binary_files_with_prefix: false
  ignore_run_exports:
    - libuv

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - python 3.7  # [not win]
    - git  # [linux]
    - ninja  # [not win]
    - pkg-config  # [not win]
  host:
    - icu >=65  # [not win]
    - libuv >=1.33  # [not win]
    - openssl  >=1.1.1d  # [not win]
    - zlib  # [not win]
  run:
    - icu  # [not win]
    - libuv  # [not win]
    - openssl  # [not win]
    - zlib  # [not win]
  run_constrained:   # [osx]
    - __osx >={{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }}  # [osx]

test:
  commands:
    - node -h
    - node -v
    - npm version
    - npm install -h
    - npm config get prefix -g
    - test $(echo "console.log(1 + 3)" | node) == 4  # [not win]
    - test -f $PREFIX/lib/libnode.{{ NODE_MODULE_VERSION }}.dylib  # [osx]
    - test -f $PREFIX/lib/libnode.so.{{ NODE_MODULE_VERSION }}  # [linux]

about:
  home: https://nodejs.org/
  license: MIT
  license_file: LICENSE
  summary: a platform for easily building fast, scalable network applications

extra:
  recipe-maintainers:
    - minrk
    - msarahan
    - pelson
    - blink1073
    - xhochy
