{% set version = "1.2.0" %}
{% set major,minor,patch = version.split('.') %}

package:
  name: libwebp-base
  version: {{ version }}

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

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

requirements:
  build:
    - libtool  # [unix]
    - {{ compiler('c') }}
    - make  # [not win]
  run_constrained:
    # 1.1 is when libwebp-base was split from libwebp
    - libwebp {{ version }}

test:
  commands:
    - test -f $PREFIX/lib/libwebp.a               # [not win]
    - test -f $PREFIX/lib/libwebp{{ SHLIB_EXT }}  # [not win]
    - test -f $PREFIX/lib/libwebpmux{{ SHLIB_EXT }}  # [not win]
    - test -f $PREFIX/include/webp/decode.h       # [not win]
    - test -f $PREFIX/include/webp/encode.h       # [not win]
    - test -f $PREFIX/include/webp/types.h        # [not win]
    - if not exist %LIBRARY_LIB%\\libwebp.lib exit 1  # [win]
    - if not exist %LIBRARY_LIB%\\libwebpdemux.lib exit 1  # [win]
    - if not exist %LIBRARY_LIB%\\libwebpmux.lib exit 1  # [win]
    - if not exist %LIBRARY_LIB%\\libwebpdecoder.lib exit 1  # [win]
    - if not exist %LIBRARY_BIN%\\libwebp.dll exit 1  # [win]
    - if not exist %LIBRARY_BIN%\\libwebpdemux.dll exit 1  # [win]
    - if not exist %LIBRARY_BIN%\\libwebpmux.dll exit 1  # [win]
    - if not exist %LIBRARY_BIN%\\libwebpdecoder.dll exit 1  # [win]
    - if not exist %LIBRARY_BIN%\\cwebp.exe exit 1  # [win]
    - if not exist %LIBRARY_BIN%\\dwebp.exe exit 1  # [win]
    - if not exist %LIBRARY_INC%\\webp\\decode.h exit 1  # [win]
    - if not exist %LIBRARY_INC%\\webp\\encode.h exit 1  # [win]
    - if not exist %LIBRARY_INC%\\webp\\types.h exit 1  # [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
