{% set name = "pcre2" %}
{% set version = "10.34" %}

package:
  name: m2w64-{{ name }}
  version: 10.34

source:
  url: http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-{{ name }}-{{ version }}-1-any.pkg.tar.xz
  sha256: 5ce56d66ced9fac01023cc2656bc26ee3486b0c746cb3a6ca28de19207d36338

build:
  number: 0
  skip: true  # [not win]

requirements:
  run:
    - m2w64-bzip2
    - m2w64-gcc-libs
    - m2w64-wineditline
    - m2w64-zlib

test:
  commands:
    - if not exist %LIBRARY_PREFIX%\\mingw-w64\\include\\pcre2.h exit 1                   # [win]
    - if not exist %LIBRARY_PREFIX%\\mingw-w64\\include\\pcre2posix.h exit 1              # [win]
    - if not exist %LIBRARY_PREFIX%\\mingw-w64\\bin\\libpcre2-8-0.dll exit 1              # [win]
    - if not exist %LIBRARY_PREFIX%\\mingw-w64\\bin\\libpcre2-posix-2.dll exit 1          # [win]
    - if not exist %LIBRARY_PREFIX%\\mingw-w64\\lib\\libpcre2-8.a exit 1                  # [win]
    - if not exist %LIBRARY_PREFIX%\\mingw-w64\\lib\\libpcre2-posix.a exit 1              # [win]
    - if not exist %LIBRARY_PREFIX%\\mingw-w64\\lib\\pkgconfig\\libpcre2-posix.pc exit 1  # [win]
    - if not exist %LIBRARY_PREFIX%\\mingw-w64\\lib\\pkgconfig\\libpcre2-8.pc exit 1      # [win]

about:
  home: http://www.pcre.org/
  license: BSD-3-Clause
  license_family: BSD
  license_file: mingw64/share/licenses/{{ name }}/LICENCE
  summary: 'Regular expression pattern matching using Perl 5 syntax and semantics.'
  description: |
    The PCRE library is a set of functions that implement regular expression pattern matching
    using the same syntax and semantics as Perl 5. PCRE has its own native API, as well as a set of
    wrapper functions that correspond to the POSIX regular expression API. The PCRE library is
    free, even for building proprietary software.
  doc_url: http://www.pcre.org/current/doc/html/

extra:
  recipe-maintainers:
    - xhochy
