# Template file for 'libiconv'
pkgname=libiconv
version=1.19
revision=1
build_style=gnu-configure
configure_args="--enable-extra-encodings"
hostmakedepends="gettext"
short_desc="Portable implementation of GNU iconv"
maintainer="Orphaned <orphan@voidlinux.org>"
license="LGPL-2.1-or-later"
homepage="https://www.gnu.org/software/libiconv/"
changelog="https://gitweb.git.savannah.gnu.org/gitweb/?p=libiconv.git;a=blob_plain;f=NEWS;hb=HEAD"
distfiles="${GNU_SITE}/libiconv/libiconv-${version}.tar.gz"
checksum=88dd96a8c0464eca144fc791ae60cd31cd8ee78321e67397e25fc095c4a19aa6

post_install() {
	# Avoid conflicts with libc iconv implementation
	mkdir ${DESTDIR}/usr/include/libiconv
	mv ${DESTDIR}/usr/include/*.h ${DESTDIR}/usr/include/libiconv
	mv ${DESTDIR}/usr/bin/{,gnu-}iconv

	# Remove conflicting man pages and html docs
	rm -rf ${DESTDIR}/usr/share/man
	rm -rf ${DESTDIR}/usr/share/doc
}

libiconv-utils_package() {
	short_desc+=" - utilities"
	license="GPL-3.0-or-later"
	pkg_install() {
		vmove usr/bin
		vmove usr/share/locale
	}
}

libiconv-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove "usr/lib/*.a"
		vmove "usr/lib/*.so"
	}
}
