{% set version = "3.98" %}
{% set version_us = version.replace(".", "_") %}

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

source:
  url: https://ftp.mozilla.org/pub/security/nss/releases/NSS_{{ version_us }}_RTM/src/nss-{{ version }}.tar.gz
  sha256: f549cc33d35c0601674bfacf7c6ad683c187595eb4125b423238d3e9aa4209ce
  patches:
    # Adds auto-generated nss.pc and nss-config script, and allows building without nspr in the source tree 
    - nss-3.55-standalone-1.patch
    - remove_hw_accel_osxarm64.patch  # [osx and arm64]

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

requirements:
  build:
    - sysroot_linux-64 2.17  # [linux64]
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - autoconf
    - cmake
    - pkg-config
    - make
  host:
    - nspr
    - libsqlite
    - zlib

test:
  commands:
    - test -f ${PREFIX}/lib/libnspr4${SHLIB_EXT}         # [unix]
    - test -f ${PREFIX}/lib/libplds4${SHLIB_EXT}         # [unix]
    - test -f ${PREFIX}/lib/libplc4${SHLIB_EXT}          # [unix]
    - test -f ${PREFIX}/lib/libsoftokn3${SHLIB_EXT}      # [unix]
    - test -f ${PREFIX}/lib/libsoftokn3.chk              # [unix]
    - test -f ${PREFIX}/lib/libnss3${SHLIB_EXT}          # [unix]
    - test -f ${PREFIX}/lib/libsmime3${SHLIB_EXT}        # [unix]
    - test -f ${PREFIX}/lib/libssl3${SHLIB_EXT}          # [unix]
    - test -f ${PREFIX}/lib/libnssckbi${SHLIB_EXT}       # [unix]

about:
  home: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
  license: MPL-2.0
  license_file: nss/COPYING
  summary: A set of libraries designed to support cross-platform development of security-enabled client and server applications.
  description: |
    Network Security Services (NSS) is a set of libraries designed to support
    cross-platform development of security-enabled client and server
    applications. Applications built with NSS can support SSL v3, TLS,
    PKCS #5, PKCS #7, PKCS #11, PKCS #12, S/MIME, X.509 v3 certificates,
    and other security standards.
  doc_url: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
  dev_url: https://hg.mozilla.org/projects/nss

extra:
  recipe-maintainers:
    - hmaarrfk
    - marcelotrevisani
    - jakirkham
