diff options
author | Florian Schmaus <flow@gentoo.org> | 2024-07-15 21:55:13 +0200 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2024-07-16 11:32:43 +0200 |
commit | 4c0966cbf858a4cfa2c38b767571b948f8dc11a5 (patch) | |
tree | 301443015e8a1037d67867528abda28ec5615fd5 | |
parent | texlive-common.eclass: sync with ::gentoo (diff) | |
download | tex-overlay-4c0966cbf858a4cfa2c38b767571b948f8dc11a5.tar.gz tex-overlay-4c0966cbf858a4cfa2c38b767571b948f8dc11a5.tar.bz2 tex-overlay-4c0966cbf858a4cfa2c38b767571b948f8dc11a5.zip |
texlive-common.eclass: Add TEXLIVE_SCRIPTS_W_FILE_EXT variable
Some scripts are supposed to be installed with file extensions [1, 2]. Add
support for declaring those scripts in a new elcass variable
TEXLIVE_SCRIPTS_W_FILE_EXT.
Also use pure-bash functions to retrieve the basename and strip the file
extensions. And use "declare -l" to lowercase the value of 'trg',
instead of 'tr' [3].
1: https://tug.org/pipermail/tldistro/2024q3/000485.html
2: https://github.com/TeX-Live/texlive-source/blob/c087bab35570b1d5cb0afd272611a7a4ec3c9e38/texk/texlive/linked_scripts/Makefile.am#L332-L333
3: https://github.com/TeX-Live/texlive-source/blob/c087bab35570b1d5cb0afd272611a7a4ec3c9e38/texk/texlive/linked_scripts/Makefile.am#L330
Bug: https://bugs.gentoo.org/934975
Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rw-r--r-- | eclass/texlive-common.eclass | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/eclass/texlive-common.eclass b/eclass/texlive-common.eclass index 072581d..36b90a3 100644 --- a/eclass/texlive-common.eclass +++ b/eclass/texlive-common.eclass @@ -42,6 +42,13 @@ _TEXLIVE_COMMON_ECLASS=1 # @CODE : "${CTAN_MIRROR_URL:="https://mirrors.ctan.org"}" +# @ECLASS_VARIABLE: TEXLIVE_SCRIPTS_W_FILE_EXT +# @DEFAULT_UNSET +# @DESCRIPTION: +# If set, contains a space separated list of script names that should be +# linked including their file extensions, i.e., without stripping +# potentially existing filename extensions from the link's name. + # @FUNCTION: texlive-common_handle_config_files # @DESCRIPTION: # Has to be called in src_install after having installed the files in ${D} @@ -160,8 +167,17 @@ etexlinks() { # Called by app-text/epspdf and texlive-module.eclass. dobin_texmf_scripts() { while [[ ${#} -gt 0 ]] ; do - local trg - trg=$(basename "${1}" | sed 's,\.[^/]*$,,' | tr '[:upper:]' '[:lower:]') + # -l: TexLive target links are always lowercase. + local -l trg + + # Get the basename of the script. + trg="${1##*/}" + + # Only strip the filename extensions if trg is not listed in TEXLIVE_SCRIPTS_W_FILE_EXT. + if ! has "${trg}" ${TEXLIVE_SCRIPTS_W_FILE_EXT}; then + trg="${trg%.*}" + fi + einfo "Installing ${1} as ${trg} bin wrapper" [[ -x ${ED}/usr/share/${1} ]] || die "Trying to install a non existing or non executable symlink to /usr/bin: ${1}" dosym "../share/${1}" "/usr/bin/${trg}" |