# Template file for 'libwebp'
pkgname=libwebp
version=1.6.0
revision=3
build_style=cmake
configure_args="-DWEBP_BUILD_EXTRAS=OFF -DWEBP_BUILD_VWEBP=OFF
 -DBUILD_SHARED_LIBS=ON -DCMAKE_SKIP_INSTALL_RPATH=ON"
hostmakedepends="pkg-config"
makedepends="giflib-devel libpng-devel libfreeglut-devel
 $(vopt_if tiff tiff-devel)"
short_desc="WebP image format"
maintainer="Orphaned <orphan@voidlinux.org>"
license="BSD-3-Clause"
homepage="https://developers.google.com/speed/webp/"
changelog="https://chromium.googlesource.com/webm/libwebp/+/refs/heads/main/NEWS"
distfiles="http://downloads.webmproject.org/releases/webp/libwebp-${version}.tar.gz"
checksum=e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564

# May split libwebp-tools package out, if we really want it enabled
build_options="tiff"

post_install() {
	vlicense COPYING LICENSE
}

libwebp-tools_package() {
	short_desc+=" - tools"
	pkg_install() {
		vmove usr/bin
		vmove usr/share/man
	}
}

libwebp-devel_package() {
	depends="libsharpyuv-devel>=${version}_${revision} ${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/pkgconfig
		vmove "usr/lib/*.so"
		vmove "usr/share/WebP"
	}
}

libsharpyuv_package() {
	short_desc="Library to expose libwebp's sharpyuv functionality"
	pkg_install() {
		vmove "usr/lib/libsharpyuv.so.*"
	}
}

libsharpyuv-devel_package() {
	short_desc="Library to expose libwebp's sharpyuv functionality - development files"
	depends="libsharpyuv>=${version}_${revision}"
	pkg_install() {
		vmove usr/include/webp/sharpyuv
		vmove usr/lib/pkgconfig/libsharpyuv.pc
		vmove usr/lib/libsharpyuv.so
	}
}
