{% set version = "2.9.4" %}

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

source:
  url: https://git.gnome.org/browse/libxml2/snapshot/libxml2-{{ version }}.tar.gz
  sha256: 1d5257abac02aab323bf6ab26199ce0bb2a7b798bb7acea302e136438237268a
  patches:
    # Bug 767063 - Fix build of libxml2 2.9.4 (git master) on pre-C99 compilers.
    - pre-c99.patch  # [win and vc < 14]
    # https://bugzilla.gnome.org/show_bug.cgi?id=766834
    - fix-attribute-decoding-during-xml-schema-validation.patch

build:
  number: 6
  run_exports:
    # remove symbols at minor versions.
    #    https://abi-laboratory.pro/tracker/timeline/libxml2/
    - {{ pin_subpackage('libxml2', max_pin='x.x') }}

requirements:
  build:
    - {{ compiler('c') }}
    - autoconf    # [not win]
    - automake    # [not win]
    - libtool     # [not win]
    - pkg-config  # [not win]
  host:
    - icu         # [not win]
    - libiconv    # [not linux]
    - xz          # [not win]
    - zlib

test:
  files:
    - test.xml
  commands:
    - xmllint test.xml
    - conda inspect linkages -p $PREFIX libxml2  # [not win]
    - conda inspect objects -p $PREFIX libxml2  # [osx]

about:
  home: http://xmlsoft.org/
  license: MIT
  license_family: MIT
  license_file: Copyright
  summary: The XML C parser and toolkit of Gnome
  description: |
     Though libxml2 is written in C a variety of language
     bindings make it available in other environments.
  doc_url: http://xmlsoft.org/html/index.html
  doc_source_url: https://github.com/GNOME/libxml2/blob/master/doc/index.html
  dev_url: https://git.gnome.org/browse/libxml2/

extra:
  recipe-maintainers:
    - ocefpaf
    - jakirkham
    - mingwandroid
    - gillins
    - jschueller
    - msarahan
