{% set version = "1.74.0" %}
{% set filename = "boost_%s.tar.bz2" % version.replace(".", "_") %}

package:
  name: boost-cpp
  version: {{ version }}

source:
  url: https://boostorg.jfrog.io/artifactory/main/release/{{ version }}/source/{{ filename }}
  sha256: 83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1
  patches:
    # https://github.com/boostorg/build/pull/642
    - 456be0b7ecca065fbccf380c2f51e0985e608ba0.patch  # [osx and arm64]

build:
  number: 4

requirements:
  build:
    - {{ compiler('cxx') }}

  host:
    - icu               # [unix]
    - xz                # [unix]
    - bzip2
    - zstd

  run:
    - icu               # [unix]
    - xz                # [unix]
    - bzip2
    - zstd

  run_constrained:
    - libboost <0

test:
  commands:
    # Verify Python headers are removed.
    - "! test -f $PREFIX/include/boost/python.hpp"                      # [unix]
    - "! test -d $PREFIX/include/boost/python"                          # [unix]
    - if exist %PREFIX%\\Library\\include\\boost\\python.hpp exit 1     # [win]
    - if exist %PREFIX%\\Library\\include\\boost\\python exit 1         # [win]

    # Verify static-only libraries.
    - test -f $PREFIX/lib/libboost_exception.a                   # [unix]
    - test -f $PREFIX/lib/libboost_test_exec_monitor.a           # [unix]

    # Verify libraries.
    {% set boost_libs = [
            "atomic",
            "chrono",
            "container",
            "context",
            "contract",
            "coroutine",
            "date_time",
            "filesystem",
            "graph",
            "iostreams",
            "locale",
            "log",
            "log_setup",
            "math_c99",
            "math_c99f",
            "math_c99l",
            "math_tr1",
            "math_tr1f",
            "math_tr1l",
            "prg_exec_monitor",
            "program_options",
            "random",
            "regex",
            "serialization",
            "system",
            "thread",
            "timer",
            "type_erasure",
            "unit_test_framework",
            "wave",
            "wserialization"
    ] %}
    {% for each_boost_lib in boost_libs %}
    - test ! -f $PREFIX/lib/libboost_{{ each_boost_lib }}.a                                                 # [unix]
    - test -f $PREFIX/lib/libboost_{{ each_boost_lib }}.dylib                                             # [osx]
    - test -f $PREFIX/lib/libboost_{{ each_boost_lib }}.so                                                # [linux]
    - if not exist %PREFIX%\\Library\\bin\\boost_{{ each_boost_lib }}.dll exit 1                          # [win]
    - if not exist %PREFIX%\\Library\\lib\\boost_{{ each_boost_lib }}.lib exit 1                          # [win]
    - if exist %PREFIX%\\Library\\lib\\libboost_{{ each_boost_lib }}.lib exit 1                       # [win]
    {% endfor %}

about:
  home: http://www.boost.org/
  license: BSL-1.0
  license_file: LICENSE_1_0.txt
  summary: Free peer-reviewed portable C++ source libraries.

extra:
  recipe-maintainers:
    - ccordoba12
    - jakirkham
    - msarahan
    - ocefpaf
    - jschueller
    - isuruf
    - xhochy
    - beckermr
