{% set version = "1.6.37" %}

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

source:
  url: http://download.sourceforge.net/libpng/libpng-{{ version }}.tar.gz
  sha256: daeb2620d829575513e35fecc83f0d3791a620b9b93d800b763542ece9390fb4
  patches:
    - 0001-Include-pkg-config-files-in-the-Windows-packages-too.patch
    - libpng-arm-free.patch  # [aarch64]

build:
  number: 2
  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') }}
  host:
    - zlib
  run:
    - 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/libpng
  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
