# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 # TODO: USE=java isn't really doing anything here right now. It also # uses jre:11 which may be unnecessary. inherit java-pkg-opt-2 prefix unpacker xdg BASE_SRC_URI="https://download.documentfoundation.org/libreoffice/stable/${PV}/deb" DESCRIPTION="A full office productivity suite. Binary package" HOMEPAGE="https://www.libreoffice.org" SRC_URI_AMD64=" ${BASE_SRC_URI}/x86_64/LibreOffice_${PV}_Linux_x86-64_deb.tar.gz " SRC_URI=" amd64? ( ${SRC_URI_AMD64} ) " S="${WORKDIR}" LICENSE="LGPL-3" SLOT="0" KEYWORDS="-* ~amd64" IUSE="java offlinehelp python" # "en:en-US" for mapping from Gentoo "en" to upstream "en-US" etc. LANGUAGES_HELP=( am ar ast bg bn-IN bn bo bs ca-valencia ca cs da de dz el en-GB en:en-US en-ZA eo es et eu fi fr gl gu he hi hr hu id is it ja ka km ko lo lt lv mk nb ne nl nn om pl pt-BR pt ro ru si sid sk sl sq sv ta tg tr ug uk vi zh-CN zh-TW ) LANGUAGES=( ${LANGUAGES_HELP[@]} af as be br brx ckb cy dgo dsb fa fur fy ga gd gug hsb kab kk kmr-Latn kn kok ks lb mai ml mn mni mr my nr nso oc or pa:pa-IN rw sa:sa-IN sat sd sr-Latn sr ss st sw-TZ szl te th tn ts tt uz ve vec xh zu ) handle_lang() { local lang helppack langpack for lang in ${LANGUAGES_HELP[@]}; do SRC_URI+=" l10n_${lang%:*}? ( offlinehelp? ( ${BASE_SRC_URI}/x86_64/LibreOffice_${PV}_Linux_x86-64_deb_helppack_${lang#*:}.tar.gz ) )" done for lang in ${LANGUAGES[@]}; do if [[ ${lang%:*} != en ]]; then SRC_URI+=" l10n_${lang%:*}? ( ${BASE_SRC_URI}/x86_64/LibreOffice_${PV}_Linux_x86-64_deb_langpack_${lang#*:}.tar.gz )" fi IUSE+=" l10n_${lang%:*}" done } handle_lang RDEPEND=" acct-group/libreoffice acct-user/libreoffice app-accessibility/at-spi2-core:2 app-arch/unzip app-arch/zip app-crypt/mit-krb5 dev-libs/glib:2 dev-libs/gobject-introspection || ( "${T}"/50-${PN} || die SEARCH_DIRS_MASK="@GENTOO_PORTAGE_EPREFIX@/opt/libreoffice${PV%*.*}" EOF eprefixify "${T}"/50-${PN} } src_install() { dodir /usr /opt mv "${S}"/usr/local/* "${S}"/usr || die cp -aR "${S}"/opt/* "${ED}"/opt/ || die cp -aR "${S}"/usr/* "${ED}"/usr/ || die rmdir "${ED}"/usr/local || die # prevent revdep-rebuild from attempting to rebuild all the time insinto /etc/revdep-rebuild doins "${T}/50-${PN}" }