--- texk/texlive/linked_scripts/Makefile.in.orig	2025-02-13 18:12:58
+++ texk/texlive/linked_scripts/Makefile.in	2025-02-13 18:27:10
@@ -272,7 +272,7 @@
 # dangling symlinks produced by `make install'.
 # The instances in texmf* are the masters (except when it is CTAN).
 #
-texmf_scriptsdir = $(datarootdir)/texmf-dist/scripts
+texmf_scriptsdir = @@TEXMFDIST@@/scripts
 texmf_shell_scripts = \
 	adhocfilelist/adhocfilelist.sh \
 	bibexport/bibexport.sh \
@@ -798,11 +798,6 @@
 # except for memoize* and listings-ext.sh, which are documented to be
 # used with extension. Downcase for the sake of TeXcount.pl -> texcount.
 # Unfortunately this logic is duplicated in uninstall-hook.
-@WIN32_FALSE@	@REL=`$(relpath) '$(DESTDIR)' '$(bindir)' '$(datarootdir)'`; \
-@WIN32_FALSE@	if test -z "$$REL"; then \
-@WIN32_FALSE@	  echo 'unable to compute relative path for linked scripts' >&2; \
-@WIN32_FALSE@	  exit 1; \
-@WIN32_FALSE@	fi; \
 @WIN32_FALSE@	cd $(DESTDIR)$(bindir) && \
 @WIN32_FALSE@	  for s in $(nobase_dist_texmf_scripts_SCRIPTS); do \
 @WIN32_FALSE@	    target=`basename $$s | tr '[A-Z]' '[a-z]'`; \
@@ -810,8 +805,8 @@
 @WIN32_FALSE@	    || echo "$$s" | grep 'listings-ext.sh' >/dev/null \
 @WIN32_FALSE@	    || target=`echo $$target | sed 's,\.[^/]*$$,,'`; \
 @WIN32_FALSE@	    rm -f $$target; \
-@WIN32_FALSE@	    echo "creating link '$$target' -> '$$REL/texmf-dist/scripts/$$s'";\
-@WIN32_FALSE@	    $(LN_S) $$REL/texmf-dist/scripts/$$s $$target || exit 1; \
+@WIN32_FALSE@	    echo "creating link '$$target' -> '@@TEXMFDIST@@/scripts/$$s'";\
+@WIN32_FALSE@	    $(LN_S) @@TEXMFDIST@@/scripts/$$s $$target || exit 1; \
 @WIN32_FALSE@	    echo texmf-dist/scripts/$$s $$target >>$(linkfile); \
 @WIN32_FALSE@	  done && \
 @WIN32_FALSE@	  for s in $(bin_links); do \
@@ -822,12 +817,12 @@
 @WIN32_FALSE@	    $(LN_S) $$file $$link || exit 1; \
 @WIN32_FALSE@	    echo $$file $$link >>$(linkfile); \
 @WIN32_FALSE@	  done && \
-@WIN32_FALSE@	  if test -d "$$REL/texmf-dist/doc/man" \
+@WIN32_FALSE@	  if test -d "@@TEXMFDIST@@/doc/man" \
 @WIN32_FALSE@	     && test -z "$(TL_INSTALL_OMIT_MAN_LINK)" \
 @WIN32_FALSE@	     && (test -h man || test ! -e man); then \
-@WIN32_FALSE@	    echo "creating link 'man' -> '$$REL/texmf-dist/doc/man'"; \
+@WIN32_FALSE@	    echo "creating link 'man' -> '@@TEXMFDIST@@/doc/man'"; \
 @WIN32_FALSE@	    rm -f man; \
-@WIN32_FALSE@	    (ln -s "$$REL/texmf-dist/doc/man" man || :); \
+@WIN32_FALSE@	    (ln -s "@@TEXMFDIST@@/doc/man" man || :); \
 @WIN32_FALSE@	  else :; fi
 # If we got to the end, update the $(linkfile) in srcdir if needed.
 @WIN32_FALSE@	cmp -s $(srcdir)/`basename $(linkfile)` $(linkfile) \
