description="Libraries used by other programs for reading and writing PNG files."
url="http://www.libpng.org/pub/png/libpng.html"

packager="Grat-OS Team"

name=libpng
version=1.6.44
release=2

source=(https://downloads.sourceforge.net/sourceforge/$name/$name-$version.tar.xz)

build() {
  cd $name-$version

  LIBS=-lpthread \
  ./configure --prefix=/usr \
              --mandir=/usr/share/man \
              --infodir=/usr/share/info \
              --disable-static

  make
  make DESTDIR=$PKG install

  # Animated PNG support
  cd contrib/pngminus
  make PNGLIB_SHARED="-L$PKG/usr/lib -lpng" CGLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" png2pnm pnm2png
  install -m0755 png2pnm pnm2png "$PKG/usr/bin/"

}
