{% set version = "1.1.1" %}

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

source:
  fn: libtheora-{{ version }}.tar.bz2
  url: http://downloads.xiph.org/releases/theora/libtheora-{{ version }}.tar.bz2
  sha256: b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc

build:
    number: 2
    run_exports:
      # http://upstream.rosalinux.ru/versions/libtheora.html
      # No release in ~8 years. Keep default pinning
      - {{ pin_subpackage('libtheora') }}

requirements:
  build:
    - pkg-config
    - {{ compiler("c") }}
    - autoconf              # [unix]
    - automake              # [unix]
    - make                  # [unix]
    - libtool               # [unix]
    - cmake                 # [win]
  host:
    - libogg
    - pkg-config           # [unix]
    - libvorbis            # [unix]
    - libpng               # [unix]
    - zlib                 # [unix]

  run:
    - {{ pin_compatible('libogg') }}
    - libvorbis            # [unix]
test:
  commands:
    # Verify libraries.
    {% set libtheora_libs = [
        "theora",
        "theoradec",
        "theoraenc"
    ] %}
    {% for each_libtheora_lib in libtheora_libs %}
    - test -f ${PREFIX}/lib/lib{{ each_libtheora_lib }}.a                           # [unix]
    - test -f ${PREFIX}/lib/lib{{ each_libtheora_lib }}.dylib                       # [osx]
    - test -f ${PREFIX}/lib/lib{{ each_libtheora_lib }}.so                          # [linux]
    {% endfor %}


about:
  home: https://theora.org
  license: BSD 3-Clause
  # BSD like
  license_family: BSD
  # Additional licencing information in LICENSE as well
  license_file: COPYING
  summary: "Theora is a free and open video compression format from the Xiph.org Foundation."

extra:
  recipe-maintainers:
    - bgruening
    - dschreij
