{% set name = "re2" %}
{% set version = "2021-06-01" %}
{% set dotversion = version.replace('-', '.') %}

package:
  name: {{ name|lower }}
  version: {{ dotversion }}

source:
  url: http://github.com/google/{{ name }}/archive/{{ version }}.tar.gz
  sha256: 26155e050b10b5969e986dab35654247a3b1b295e0532880b5a9c13c0a700ceb

build:
  number: 0
  detect_binary_files_with_prefix: true
  run_exports:
    - {{ pin_subpackage("re2", max_pin="x.x.x") }}

requirements:
  build:
    - cmake
    - make
    - ninja
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
  host:
  run:

test:
  commands:
    - test -f ${PREFIX}/lib/libre2.so  # [linux]
    - test -f ${PREFIX}/lib/libre2.dylib  # [osx]
    - test ! -f ${PREFIX}/lib/libre2.a  # [unix]
    - test -f ${PREFIX}/lib/pkgconfig/re2.pc  # [unix]
    - test -f ${PREFIX}/include/re2/re2.h  # [unix]
    - if not exist %PREFIX%\\Library\\include\\re2\\re2.h exit 1  # [win]
    - if not exist %PREFIX%\\Library\\lib\\re2.lib exit 1  # [win]
    - if exist %PREFIX%\\Library\\lib\\re2_static.lib exit 1  # [win]
    - if not exist %PREFIX%\\Library\\bin\\re2.dll exit 1  # [win]

about:
  home: https://github.com/google/re2/
  license: BSD-3-Clause
  license_file: LICENSE
  summary: |
    RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression
    engines like those used in PCRE, Perl, and Python. It is a C++ library.
  dev_url: https://github.com/google/re2/

extra:
  recipe-maintainers:
    - scopatz
    - isuruf
    - wesm
    - xhochy
    - kszucs
    - pitrou
