{% set version = "1.6.44" %}

package:
  name: libpng
  version: {{ version }}

source:
  url: http://download.sourceforge.net/libpng/libpng-{{ version }}.tar.gz
  sha256: 8c25a7792099a0089fa1cc76c94260d0bb3f1ec52b93671b572f8bb61577b732
  patches:
    - patches/0001-Include-pkg-config-files-in-the-Windows-packages-too.patch
    - patches/0002-Ensure-that-lm-is-not-included-in-Windows-pkg-config.patch

build:
  number: 0
  skip: true  # [win and vc<14]
  run_exports:
    # SO name changes at minor rev bumps.
    - {{ pin_subpackage('libpng', max_pin='x.x') }}

requirements:
  build:
    - make  # [unix]
    - cmake  # [win]
    - m2-patch  # [win]
    - ninja  # [win]
    - libtool  # [not win]
    - automake  # [not win]
    - libtool  # [unix]
    - {{ compiler('c') }}
    - {{ stdlib("c") }}
  host:
    - zlib

test:
  commands:
    - test -f ${PREFIX}/lib/libpng.a  # [not win]
    - test -f ${PREFIX}/lib/libpng${SHLIB_EXT}  # [not win]
    - libpng-config --version  # [not win]

about:
  home: http://www.libpng.org/pub/png/libpng.html
  license: zlib-acknowledgement
  license_file: LICENSE
  license_url: http://www.libpng.org/pub/png/src/libpng-LICENSE.txt
  summary: PNG reference library
  description: |
    libpng is the official PNG reference library. It supports almost all PNG
    features, is extensible, and has been extensively tested for over 20 years.
  doc_url: http://www.libpng.org/pub/png/libpng.html
  dev_url: https://sourceforge.net/p/libpng/code/ci/libpng16/tree/

extra:
  recipe-maintainers:
    - ocefpaf
    - msarahan
    - pkgw
