# Template file for 'libiconv'
pkgname=libiconv
version=1.18
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="GPL-3.0-or-later, LGPL-2.1-or-later"
homepage="https://www.gnu.org/software/libiconv/"
distfiles="${GNU_SITE}/libiconv/libiconv-${version}.tar.gz"
checksum=3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8

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"
	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"
	}
}
