# Template file for 'libtranscript'
pkgname=libtranscript
version=0.3.4
revision=1
build_style=configure
configure_args="--prefix=/usr LIBTOOL=./hack/libtool"
hostmakedepends="pkg-config gettext autoconf automake libtool"
makedepends="gettext-devel"
short_desc="Character-set conversion library"
maintainer="Andrew Benson <abenson+void@gmail.com>"
license="GPL-3.0-or-later"
homepage="https://os.ghalkes.nl/libtranscript.html"
distfiles="https://os.ghalkes.nl/dist/libtranscript-${version}.tar.bz2"
checksum=daaa09038f6f3b785b86d152014b3893910f9b9e4e430c015e41b05b34c37ea7

pre_configure() {
	# project uses libtool without autoconf, which is not really viable
	# since autoconf is supposed to configure libtool.
	mkdir -p hack
	cat <<-EOF >hack/configure.ac
	AC_INIT
	LT_INIT
	AC_CONFIG_MACRO_DIRS([m4])
	AC_LANG([C])
	AC_LANG([C++])
	LT_LANG([C])
	LT_LANG([C++])
	AC_OUTPUT
	EOF
	(cd hack;  autoreconf -fi; libtoolize -i; ./configure --host=$XBPS_CROSS_TRIPLET --build=$XBPS_TRIPLET --with-libtool-sysroot=$XBPS_CROSS_BASE)
}

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