pkgname=libnsgif
pkgver=1.0.0
pkgdesc="Decoding library for the GIF image file format, written in C"
homepage="https://www.netsurf-browser.org/projects/libnsgif/"
license=("MIT")
depends=(netsurf-buildsystem)
_patches=("libnsgif-1.0.0-make-test-failures-fatal.patch")
_patch_sums=("73a17081ac8a7c5242caffe20cae128a382910bbe053c5332a8cf156c3ad2931306adf332a65a8e772755009082e5d27cc0e35260d8a30538509fa35c1b05716")
sources=("${pkgname}-${pkgver}-src.tar.gz"
  "${_patches[@]}"
)
urls=("https://download.netsurf-browser.org/libs/releases/${sources[0]}"
  "${_patches[@]}"
)
sha512sums=("e87d5faaa4f586a098357a23bed58a8a7a79c94549b21c3338dd04bd5e074e93a7719d93d79515287b15514a2cf39aaa2abd88fd9aec8785a27594ee5cc2ddc0"
  "${_patch_sums[@]}"
)

src_prepare() {
  tar -xf ${distdir}/${sources[0]} --strip-components=1
  for _patch in ${_patches[@]}; do
    patch -p1 -i ${filedir}/${_patch}
  done
}

src_build() {
  make COMPONENT_TYPE=lib-shared INCLUDEDIR=include LIBDIR=lib \
    PREFIX=/usr
}

src_install() {
  make COMPONENT_TYPE=lib-shared DESTDIR="$pkgdir" INCLUDEDIR=include \
    LIBDIR=lib PREFIX=/usr install
}

# vim:ft=sh syn=sh et sw=2:
