# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=giblib
pkgver=1.2.4
pkgrel=14
pkgdesc="Giblib is a library that feh uses as a wrapper to imlib2"
url="https://freshmeat.sourceforge.net/projects/giblib/"
arch="all"
license="MIT"
depends_dev="imlib2-dev freetype-dev zlib-dev libx11-dev libxext-dev"
makedepends="$depends_dev"
subpackages="$pkgname-doc $pkgname-dev"
source="https://downloads.sourceforge.net/project/slackbuildsdirectlinks/giblib/giblib-$pkgver.tar.gz"

prepare() {
	default_prepare
	update_config_sub

	sed -i "s|imlib2-config|pkg-config|g" configure
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" docsdir=/usr/share/doc/giblib install
	install -Dm644 COPYING $pkgdir/usr/share/licenses/$pkgname/COPYING
}

sha512sums="
4866df223e6d219a5c9a327874bcd67260c83fba8f99862222df41ef86fb31efa0172a777bf46c853ca380dc2a64bbd41bf4fd658fcb84a924cab4e0f525dcfd  giblib-1.2.4.tar.gz
"
