{% set name = "ogg" %}
{% set version = "1.3.4" %}

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

source:
  url: http://downloads.xiph.org/releases/{{ name }}/lib{{ name }}-{{ version }}.tar.gz
  sha256: fe5670640bd49e828d64d2879c31cb4dde9758681bb664f9bdbf159a01b0c76e
  patches:
    - c8fca6b4a02d695b1ceea39b330d4406001c03ed.patch

build:
  number: 1
  run_exports:
    - {{ pin_subpackage('libogg', max_pin='x.x') }}

requirements:
  build:
    - gnuconfig  # [unix]
    - {{ compiler('c') }}
    - cmake      # [win]
    - make       # [unix]
    - pkgconfig  # [unix]

test:
  commands:
    - test ! -f $PREFIX/lib/libogg.a  # [unix]
    - test -f $PREFIX/lib/libogg${SHLIB_EXT}  # [unix]
    - test -f $PREFIX/include/ogg/ogg.h  # [unix]
    - test -f $PREFIX/include/ogg/config_types.h  # [unix]
    - test -f $PREFIX/include/ogg/os_types.h  # [unix]
    - if not exist %LIBRARY_LIB%\\ogg.lib exit 1  # [win]
    - if not exist %LIBRARY_BIN%\\ogg.dll exit 1  # [win]
    - if not exist %LIBRARY_INC%\\ogg\\config_types.h exit 1  # [win]
    - if not exist %LIBRARY_INC%\\ogg\\ogg.h exit 1  # [win]
    - if not exist %LIBRARY_INC%\\ogg\\os_types.h exit 1  # [win]

about:
  home: https://www.xiph.org/
  license: BSD-3-Clause
  license_file: COPYING
  summary: OGG media container
  description: |
    OGG media container. This is the native format and the recommended container
    for Xiph codecs.
  doc_url: https://wiki.xiph.org/

extra:
  recipe-maintainers:
    - dschreij
    - wolfv
