[tldistro] texmf_scripts installation

Florian Schmaus flow at gentoo.org
Tue Jul 2 11:13:50 CEST 2024


Hi everyone,

this is a follow up on a recent retex-k discussion [1] and subsequent 
Gentoo bug report [2].

The summary is probably that Gentoo passes -enable-linked-scripts=no to 
texlive-core, therefore Gentoo's TeX Live packages have to handle 
binscript symlinking (and binlinks) themselves.

As it was pointed out in the mailing list thread, only on windows, 
should the symlink to mktexlsr.pl be created. However, Gentoo currently 
links mktexlsr → mktexlsr.pl, when it should be mktexlsr → mktexlsr (if 
I understand correctly).

In Gentoo, we basically parse the contents of linked_scripts/ to extract 
all binscripts that should be linked [3] and then create the links when 
installing the corresponding Gentoo package via

dobin_texmf_scripts() {
	while [[ ${#} -gt 0 ]] ; do
		local trg
		trg=$(basename "${1}" | sed 's,\.[^/]*$,,' | tr '[:upper:]' '[:lower:]')
		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}"
		shift
	done
}
source: 
https://github.com/gentoo/gentoo/blob/8cf00e2e03768a9a7585d9ad4d7c48fc26c2d0d4/eclass/texlive-common.eclass#L161-L170

Much of this predates my involvement with TeX Live packaging in Gentoo. 
But this function seems to mostly resemble --- the special case for 
listings-ext.sh is missing --- what TeX Live does. From 
linked_scripts/Makefile.am:

	  for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
	    target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
## we can't use egrep or grep -E or ere patterns portably.
	    echo "$$s" | grep 'memoize-.*\.' >/dev/null \
	    || echo "$$s" | grep 'listings-ext.sh' >/dev/null \
	    || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
	    rm -f $$target; \
	    echo "creating link '$$target' -> '$$REL/texmf-dist/scripts/$$s'"; \
	    $(LN_S) $$REL/texmf-dist/scripts/$$s $$target || exit 1; \
           done && \
source: 
https://github.com/TeX-Live/texlive-source/blob/6f1cc5d69c54047f6830a00606e1a9ce65db49cd/texk/texlive/linked_scripts/Makefile.am#L329-L338

I do not see any special handing for mktexlsr.pl (and probably other 
existing scripts that should not be installed on Unix systems).

In fact, if I run the loop manually, I get

for s in texlive/mktexlsr texlive/mktexlsr.pl
      listings-ext/listings-ext.sh
      tlcockpit/tlcockpit.sh
      texlogsieve/texlogsieve; do 
 

          target=`basename $s | tr '[A-Z]' '[a-z]'`
          echo "$s" | grep listings-ext.sh >/dev/null
              || target=`echo $target | sed 's,\.[^/]*$,,'`
          echo "creating link '$target' -> '$REL/texmf-dist/scripts/$s'"
done
creating link 'mktexlsr' -> '/texmf-dist/scripts/texlive/mktexlsr'
creating link 'mktexlsr' -> '/texmf-dist/scripts/texlive/mktexlsr.pl'
creating link 'listings-ext.sh' -> 
'/texmf-dist/scripts/listings-ext/listings-ext.sh'
creating link 'tlcockpit' -> '/texmf-dist/scripts/tlcockpit/tlcockpit.sh'
creating link 'texlogsieve' -> '/texmf-dist/scripts/texlogsieve/texlogsieve'

So it looks like the it would install a final symlink from mktexlsr to 
mktexlsr.pl (i.e., what Gentoo currently does).

I must be missing something. I am still discovering some aspects of 
Gentoo's TeX Live packaging and TeX Live in general. Where did I go 
wrong? How can we determine which linked scripts Gentoo should symlink 
and which not?

Thanks

- Flow


1: https://tug.org/pipermail/tex-k/2024-June/004073.html
2: https://bugs.gentoo.org/934975
3: nobase_dist_texmf_scripts_SCRIPTS
    == texmf_shell_scripts + texmf_other_scripts


-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x8CAC2A9678548E35.asc
Type: application/pgp-keys
Size: 21237 bytes
Desc: OpenPGP public key
URL: <https://tug.org/pipermail/tldistro/attachments/20240702/ad17fb7d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 618 bytes
Desc: OpenPGP digital signature
URL: <https://tug.org/pipermail/tldistro/attachments/20240702/ad17fb7d/attachment.sig>


More information about the tldistro mailing list.