{% set name = "nspr" %}
{% set version = "4.37" %}

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

source:
  url: https://ftp.mozilla.org/pub/{{ name }}/releases/v{{ version }}/src/{{ name }}-{{ version }}.tar.gz
  sha256: 5f9344ed0e31855bd38f88b33c9d9ab94f70ce547ef3213e488d1520f61840fa

build:
  number: 0
  skip: true  # [win]
  run_exports:
    - {{ pin_subpackage('nspr', max_pin='x') }}

requirements:
  build:
    - gnuconfig
    - {{ stdlib('c') }}
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - make
    - autoconf
    - sed

test:
  files:
    - tests/execute_tests.sh
  source_files:
    - nspr/lib/tests
  commands:
    - test -f ${PREFIX}/lib/libnspr4${SHLIB_EXT}
    - test -f ${PREFIX}/lib/libplc4${SHLIB_EXT}
    - test -f ${PREFIX}/lib/libplds4${SHLIB_EXT}
    - test -d ${PREFIX}/include/nspr
    - test -f ${PREFIX}/bin/nspr-config
    - nspr-config --version
    - nspr-config --cflags
    - nspr-config --libs
    - ./tests/execute_tests.sh

about:
  home: https://firefox-source-docs.mozilla.org/nspr/index.html
  license: MPL-2.0
  license_family: OTHER
  license_file: nspr/LICENSE
  summary: A platform-neutral API for system level and libc-like functions.
  description: |
    NetScape Portable Runtime (NSPR) provides platform independence for
    non-GUI operating system facilities. These facilities include threads,
    thread synchronization, normal file and network I/O, interval timing and
    calendar time, basic memory management (malloc and free) and shared
    library linking.
  doc_url: https://firefox-source-docs.mozilla.org/nspr/index.html
  dev_url: https://hg.mozilla.org/projects/nspr

extra:
  recipe-maintainers:
    - marcelotrevisani
    - jakirkham
