{% set name = "flac" %}
{% set version = "1.4.2" %}
{% set sha256 = "8e8e0406fb9e1d177bb4ba8cfed3ca3935d37144eac8f0219a03e8c1ed5cc18e" %}

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

source:
  url: https://github.com/xiph/{{ name }}/archive/{{ version }}.tar.gz
  sha256: {{ sha256 }}

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

requirements:
  build:
    - {{ compiler('c') }}
    - {{ compiler('cxx') }}
    - cmake
    - make  # [unix]
    - pandoc  # [not ppc64le]
  host:
    - gettext  # [unix]
    - libogg 1.3.*
  run:
    - libogg 1.3.*

test:
  commands:
    - test -f $PREFIX/bin/flac                        # [unix]
    - test -f $PREFIX/bin/metaflac                    # [unix]
    - test -f $PREFIX/lib/libFLAC${SHLIB_EXT}         # [unix]
    - test -f $PREFIX/lib/libFLAC++${SHLIB_EXT}       # [unix]
    - if not exist %LIBRARY_LIB%\\FLAC++.lib exit 1   # [win]
    - if not exist %LIBRARY_BIN%\\FLAC++.dll exit 1   # [win]
    - if not exist %LIBRARY_LIB%\\FLAC.lib exit 1     # [win]
    - if not exist %LIBRARY_BIN%\\FLAC.dll exit 1     # [win]
    - flac --version                                  # [build_platform == target_platform]

about:
  home: https://www.xiph.org/
  license: BSD-3-Clause
  license_family: BSD
  license_file: COPYING.Xiph
  summary: Flac audio format
  description: Free Lossless Audio Codec.
  doc_url: https://wiki.xiph.org/
  dev_url: https://gitlab.xiph.org/xiph/flac

extra:
  recipe-maintainers:
    - dschreij
    - martinRenou
    - matthiasdiener
