{% set name = "dlib" %}
{% set version = "19.7" %}

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

source:
  url: https://github.com/davisking/{{ name }}/archive/v{{ version }}.tar.gz
  sha1: 6dfc0dfa1cd45baa39a9b03238b222cd59041194

  patches:
    - osx_jpeg.patch           # [osx]
    - lapack_sgetrf.patch      # [unix]
    - win_boost.patch          # [win]
    - win_jpeg_png.patch       # [win]
    - win_release_flags.patch  # [win]
    - win_thread_fix.patch     # [win]

build:
  number: 2
  skip: True  # [blas_impl == 'mkl' and win]
  requires_features:
    blas: {{ mkl }}

requirements:
  build:
    - cmake
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - pkg-config

  host:
    - python
    - numpy {{ numpy }}
    - py-boost {{ boost }}
    - libpng {{ libpng }}
    - mkl-devel {{ mkl }}  # [blas_impl == 'mkl']
    - jpeg {{ jpeg }}  # [not win]
    - sqlite {{ sqlite }}  # [not win]

  run:
    - python
    - {{ pin_compatible('numpy') }}
    - py-boost {{ boost }}

test:
  files:
    - face.jpg
    - face.png
    - images.xml

  requires:
    - tqdm
    - pillow

  imports:
    - dlib

  commands:
    - conda inspect linkages -p $PREFIX {{ name }}  # [not win]
    - conda inspect objects -p $PREFIX {{ name }}  # [osx]

about:
  home: http://dlib.net/
  license: Boost 1.0
  license_file: dlib/LICENSE.txt
  summary: Modern C++ toolkit containing machine learning algorithms with Python bindings

extra:
  recipe-maintainers:
    - tiago.pereira
    - anjos
    - amohammadi
