{% set version = "1.2.0" %}

package:
  name: libwebp
  version: {{ version }}

source:
  url: http://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-{{ version }}.tar.gz
  sha256: 2fc8bbde9f97f2ab403c0224fb9ca62b2e6852cbc519e91ceaa7c153ffd88a0c

build:
  number: 0
  run_exports:
    # https://abi-laboratory.pro/?view=timeline&l=libwebp
    - {{ pin_compatible('libwebp-base') }}

requirements:
  build:
    - gnuconfig  # [unix]
    - {{ compiler('c') }}  # [not win]
    - make                 # [not win]
  host:
    - giflib   # [not win]
    - jpeg     # [not win]
    - libpng   # [not win]
    - libtiff  # [not win]
    - libwebp-base {{ version }}
  run:
    - giflib   # [not win]
    - jpeg     # [not win]
    - libpng   # [not win]
    - libtiff  # [not win]
    - libwebp-base {{ version }}

test:
  source_files:
    - examples/test.webp
  commands:
    - test -f $PREFIX/bin/cwebp  # [not win]
    - test -f $PREFIX/bin/dwebp  # [not win]
    - dwebp examples/test.webp  # [not win]
    - if not exist %LIBRARY_BIN%\\cwebp.exe exit 1  # [win]
    - if not exist %LIBRARY_BIN%\\dwebp.exe exit 1  # [win]
    - dwebp examples\\test.webp  # [win]

about:
  home: https://developers.google.com/speed/webp
  license: BSD-3-Clause
  license_file: COPYING
  summary: WebP image library
  description: |
    WebP is a method of lossy and lossless compression that can be used on a large variety of photographic,
    translucent and graphical images found on the web. The degree of lossy compression is adjustable so a
    user can choose the trade-off between file size and image quality.
    libwebp-base provides the headers and shared libraries. For cwebp and dwep,
    binaries install libwebp.
  doc_url: https://developers.google.com/speed/webp/docs/using
  dev_url: https://chromium.googlesource.com/webm/libwebp

extra:
  recipe-maintainers:
    - carterbox
    - dschreij
    - ocefpaf
