public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Florian Schmaus" <flow@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tex-overlay:main commit in: eclass/
Date: Fri, 17 Nov 2023 09:44:18 +0000 (UTC)	[thread overview]
Message-ID: <1700214222.13ea75aeff018cb119264c9a5935ba91f7ce495a.flow@gentoo> (raw)

commit:     13ea75aeff018cb119264c9a5935ba91f7ce495a
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 17 09:40:04 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Fri Nov 17 09:43:42 2023 +0000
URL:        https://gitweb.gentoo.org/proj/tex-overlay.git/commit/?id=13ea75ae

texlive-{common,module}.eclass: reduce diff and cleanup

In preperation for the review of the eclass changes on the gentoo-dev
mailing list, cleanup the code and reduce the diff to the current
eclasses.

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 eclass/texlive-common.eclass | 60 ++++++++++++++++++++++----------------------
 eclass/texlive-module.eclass | 11 +++++---
 2 files changed, 37 insertions(+), 34 deletions(-)

diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass
index 9d6e959..7cab06f 100644
--- a/eclass/texlive-common.eclass
+++ b/eclass/texlive-common.eclass
@@ -18,7 +18,7 @@ case ${EAPI} in
 	7)
 		inherit eapi8-dosym
 		dosym(){ dosym8 "$@"; }
-		;; # BUG
+		;;
 	8) ;;
 	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
@@ -26,37 +26,39 @@ esac
 if [[ -z ${_TEXLIVE_COMMON_ECLASS} ]]; then
 _TEXLIVE_COMMON_ECLASS=1
 
-# BUG
-TEXMF_PATH=/usr/share/texmf-dist
-# TEXMF_DIST_PATH=/usr/share/texmf-dist
-# TEXMF_VAR_PATH=/var/lib/texmf
-
-TEXDIR=
-TEXMFDIST=
-TEXMFSYSVAR=
-TEXMFSYSCONFIG=
-TEXMFLOCAL=
-TEXMFVAR=
-
 # @FUNCTION: texlive-common_handle_config_files
 # @DESCRIPTION:
 # Has to be called in src_install after having installed the files in ${D}
-# This function will move the relevant files to /etc/texmf and symlink them from their original location.
-# This is to allow easy update of texlive's configuration
-# VIA app-text/texlive-core eclass/texlive-module.eclass
+# This function will move the relevant files to /etc/texmf and symlink them
+# from their original location. This is to allow easy update of texlive's
+# configuration.
+# Called by app-text/texlive-core and texlive-module.eclass.
 texlive-common_handle_config_files() {
+	local texmf_path
+	# Starting with TeX Live 2023, we install in texmf-dist, where a
+	# distribution provided TeX Live installation is supposed to be,
+	# instead of texmf.
+	if ver_test -ge 2023; then
+		texmf_path=/usr/share/texmf-dist
+	else
+		texmf_path=/usr/share/texmf
+	fi
+
 	# Handle config files properly
-	[[ -d ${ED}${TEXMF_PATH} ]] || return
-	cd "${ED}${TEXMF_PATH}" || die
+	[[ -d ${ED}${texmf_path} ]] || return
+	cd "${ED}${texmf_path}" || die
 
 	while read -r f; do
 		if [[ ${f#*config} != "${f}" || ${f#doc} != "${f}" || ${f#source} != "${f}" || ${f#tex} != "${f}" ]] ; then
 			continue
 		fi
-		dodir "/etc/texmf/$(dirname "${f}").d"
-		einfo "Moving (and symlinking) ${EPREFIX}${TEXMF_PATH}/${f} to ${EPREFIX}/etc/texmf/$(dirname "${f}").d"
-		mv "${ED}/${TEXMF_PATH}/${f}" "${ED}/etc/texmf/$(dirname "${f}").d" || die "mv ${f} failed."
-		dosym -r "/etc/texmf/$(dirname "${f}").d/$(basename "${f}")" "${TEXMF_PATH}/${f}"
+		local rel_dir
+		rel_dir="$(dirname "${f}")"
+
+		dodir "/etc/texmf/${rel_dir}.d"
+		einfo "Moving (and symlinking) ${EPREFIX}${texmf_path}/${f} to ${EPREFIX}/etc/texmf/${rel_dir}.d"
+		mv "${ED}/${texmf_path}/${f}" "${ED}/etc/texmf/${rel_dir}.d" || die "mv ${f} failed."
+		dosym -r "/etc/texmf/${rel_dir}).d/$(basename "${f}")" "${texmf_path}/${f}"
 	done < <(find . -name '*.cnf' -type f -o -name '*.cfg' -type f | sed -e "s:\./::g")
 }
 
@@ -64,7 +66,7 @@ texlive-common_handle_config_files() {
 # @DESCRIPTION:
 # Return if a file is present in the texmf tree
 # Call it from the directory containing texmf and texmf-dist
-# VIA app-text/texlive-core
+# Called by app-text/texlive-core.
 texlive-common_is_file_present_in_texmf() {
 	local mark="${T}/${1}.found"
 	if [[ -d texmf ]]; then
@@ -88,7 +90,7 @@ texlive-common_is_file_present_in_texmf() {
 # ( Arguments are switched because texlinks main function sends them switched )
 # This function should not be called from an ebuild, prefer etexlinks that will
 # also do the fmtutil file parsing.
-# VIA eclass/texlive-common.eclass eclass/texlive-module.eclass
+# Called by texlive-common.eclass and texlive-module.eclass.
 texlive-common_do_symlinks() {
 	while [[ ${#} != 0 ]]; do
 		case ${1} in
@@ -125,7 +127,7 @@ texlive-common_do_symlinks() {
 # the same dir as the source)
 # Also, as this eclass must not depend on a tex distribution to be installed we
 # cannot use texlinks from here.
-# VIA eclass/texlive-module.eclass
+# Called by texlive-module.eclass.
 etexlinks() {
 	# Install symlinks from formats to engines
 	texlive-common_do_symlinks $(sed '/^[      ]*#/d; /^[      ]*$/d' "$1" | awk '{print $1, $2}')
@@ -136,7 +138,7 @@ etexlinks() {
 # @DESCRIPTION:
 # Symlinks a script from the texmf tree to /usr/bin. Requires permissions to be
 # correctly set for the file that it will point to.
-# VIA app-text/epspdf eclass/texlive-module.eclass
+# Called by app-text/epspdf and texlive-module.eclass.
 dobin_texmf_scripts() {
 	while [[ ${#} -gt 0 ]] ; do
 		local trg
@@ -153,7 +155,8 @@ dobin_texmf_scripts() {
 # Runs texmf-update if it is available and prints a warning otherwise. This
 # function helps in factorizing some code.  Useful in ebuilds' pkg_postinst and
 # pkg_postrm phases.
-# VIA app-text/dvipsk app-text/texlive-core dev-libs/kpathsea eclass/texlive-module.eclass
+# Called by app-text/dvipsk, app-text/texlive-core, dev-libs/kpathsea, and
+# texlive-module.eclass.
 etexmf-update() {
 	if has_version 'app-text/texlive-core' ; then
 		if [[ -z ${ROOT} && -x "${EPREFIX}"/usr/sbin/texmf-update ]] ; then
@@ -171,7 +174,6 @@ etexmf-update() {
 # Runs fmtutil-sys if it is available and prints a warning otherwise. This
 # function helps in factorizing some code. Used in ebuilds' pkg_postinst to
 # force a rebuild of TeX formats.
-# VIA
 efmtutil-sys() {
 	if has_version 'app-text/texlive-core' ; then
 		if [[ -z ${ROOT} && -x "${EPREFIX}"/usr/bin/fmtutil-sys ]] ; then
@@ -225,5 +227,3 @@ texlive-common_append_to_src_uri() {
 }
 
 fi
-
-unset TEXDIR TEXMFDIST TEXMFSYSVAR TEXMFSYSCONFIG TEXMFLOCAL TEXMFVAR

diff --git a/eclass/texlive-module.eclass b/eclass/texlive-module.eclass
index 0ecab81..2a1d7bb 100644
--- a/eclass/texlive-module.eclass
+++ b/eclass/texlive-module.eclass
@@ -155,7 +155,8 @@ texlive-module_src_unpack() {
 # @DESCRIPTION:
 # Creates/appends to a format.${PN}.cnf file for fmtutil.
 # It parses the AddFormat directive of tlpobj files to create it.
-# This will make fmtutil generate the formats when asked and allow the remaining src_compile phase to build the formats.
+# This will make fmtutil generate the formats when asked and allow the remaining
+# src_compile phase to build the formats.
 
 texlive-module_add_format() {
 	local name engine mode patterns options
@@ -405,7 +406,7 @@ texlive-module_src_install() {
 	if [[ -n ${TEXLIVE_MODULE_BINLINKS} ]] ; then
 		dodir "/usr/bin"
 		for i in ${TEXLIVE_MODULE_BINLINKS} ; do
-			[[ -f ${ED}/usr/bin/${i%:*} ]] || die "Trying to install an invalid BINLINK. This should not happen. Please file a bug."
+			[[ -f ${ED}/usr/bin/${i%:*} ]] || die "Trying to install an invalid BINLINK ${i%:*}. This should not happen. Please file a bug."
 			dosym "${i%:*}" "/usr/bin/${i#*:}"
 		done
 	fi
@@ -416,7 +417,8 @@ texlive-module_src_install() {
 # @FUNCTION: texlive-module_pkg_postinst
 # @DESCRIPTION:
 # exported function:
-# Run texmf-update to ensure the tex installation is consistent with the installed texmf trees.
+# Run texmf-update to ensure the tex installation is consistent with the
+# installed texmf trees.
 
 texlive-module_pkg_postinst() {
 	etexmf-update
@@ -426,7 +428,8 @@ texlive-module_pkg_postinst() {
 # @FUNCTION: texlive-module_pkg_postrm
 # @DESCRIPTION:
 # exported function:
-# Run texmf-update to ensure the tex installation is consistent with the installed texmf trees.
+# Run texmf-update to ensure the tex installation is consistent with the
+# installed texmf trees.
 
 texlive-module_pkg_postrm() {
 	etexmf-update


             reply	other threads:[~2023-11-17  9:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-17  9:44 Florian Schmaus [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-13 10:03 [gentoo-commits] proj/tex-overlay:main commit in: eclass/ Florian Schmaus
2024-12-13 10:03 Florian Schmaus
2024-12-11  8:49 Florian Schmaus
2024-11-22 17:13 Florian Schmaus
2024-11-22 17:13 Florian Schmaus
2024-07-26  7:47 Florian Schmaus
2024-05-14  8:21 Florian Schmaus
2024-05-13  8:36 Florian Schmaus
2024-05-02 17:45 Florian Schmaus
2024-04-30 17:45 Florian Schmaus
2024-04-30 15:10 Florian Schmaus
2024-04-30 10:05 Florian Schmaus
2024-04-30  8:53 Florian Schmaus
2024-04-30  8:16 Florian Schmaus
2024-04-04 13:05 Florian Schmaus
2024-04-04 13:02 Florian Schmaus
2024-04-04 13:02 Florian Schmaus
2024-04-04  8:39 Florian Schmaus
2024-04-04  8:39 Florian Schmaus
2024-04-03 16:20 Florian Schmaus
2024-04-02 13:58 Florian Schmaus
2024-04-02 13:58 Florian Schmaus
2024-04-02  9:43 Florian Schmaus
2024-02-29 21:12 Florian Schmaus
2024-02-29 17:46 Florian Schmaus
2024-02-12 15:02 Florian Schmaus
2024-02-11 11:28 Florian Schmaus
2024-01-31 15:11 Florian Schmaus
2024-01-18 14:21 Florian Schmaus
2024-01-16 11:42 Florian Schmaus
2024-01-16 11:37 Florian Schmaus
2023-12-29 10:31 Florian Schmaus
2023-11-17  9:44 Florian Schmaus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1700214222.13ea75aeff018cb119264c9a5935ba91f7ce495a.flow@gentoo \
    --to=flow@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox