# Template file for 'texlive2026-bin'
pkgname=texlive2026-bin
version=2026
revision=1
archs="x86_64* i686 aarch64 arm*"
depends="cairo pixman graphite gd poppler libsigsegv
 zziplib libpng libjpeg-turbo freetype icu harfbuzz wget perl
 ghostscript xz"
short_desc="TeX Live Binary distribution through tl-install"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="GPL-2.0-or-later"
homepage="https://tug.org/texlive/"
distfiles="https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${version}/install-tl-unx.tar.gz"
checksum=5cc0703d6fe49f00a2932c4e3bcee37a11cc0a969ae9fcbf9cad6f0d984d6363

# Package build options
build_options="infraonly basic small medium full"
build_options_default="infraonly"
desc_option_infraonly="Install TeXLive infrastructure only"
desc_option_basic="Install TeXLive using scheme-basic"
desc_option_small="Install TeXLive using scheme-small"
desc_option_medium="Install TeXLive using scheme-medium"
desc_option_full="Install TeXLive using scheme-full"

pre_install() {
	rm -rf tlpkg/installer/xz tlpkg/installer/wget tlpkg/installer/curl
}

do_install() {
	vmkdir opt/texlive${version}-installer
	vcopy "*" /opt/texlive${version}-installer
	vinstall ${FILESDIR}/void.profile 644 opt/texlive${version}-installer
	if [ "$build_option_infraonly" ]; then
		echo "selected_scheme scheme-infraonly"
	elif [ "$build_option_basic" ]; then
		echo "selected_scheme scheme-basic"
	elif [ "$build_option_small" ]; then
		echo "selected_scheme scheme-small"
	elif [ "$build_option_medium" = "medium" ];then
		echo "selected_scheme scheme-medium"
	elif [ "$build_option_full" ];then
		echo "selected_scheme scheme-full"
	fi >>${DESTDIR}/opt/texlive${version}-installer/void.profile
	vlicense ${DESTDIR}/opt/texlive${version}-installer/LICENSE.CTAN
	vlicense ${DESTDIR}/opt/texlive${version}-installer/LICENSE.TL
	vdoc "${FILESDIR}/README.voidlinux"
}
