commit:     a57130b12c6012e9b8a4b0c72e55b1322ed927d5
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 27 13:48:07 2024 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Sat Apr 27 13:48:07 2024 +0000
URL:        https://gitweb.gentoo.org/proj/tex-patches.git/commit/?id=a57130b1

Add two tlmgr patches to fix include path and force user mode

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

 fix-perl-include-path-of-tlmgr.patch | 54 ++++++++++++++++++++++++++++++++++++
 force-tlmgr-into-user-mode.patch     | 38 +++++++++++++++++++++++++
 2 files changed, 92 insertions(+)

diff --git a/fix-perl-include-path-of-tlmgr.patch 
b/fix-perl-include-path-of-tlmgr.patch
new file mode 100644
index 0000000..4b82c1f
--- /dev/null
+++ b/fix-perl-include-path-of-tlmgr.patch
@@ -0,0 +1,54 @@
+From b8566bfdd6a4ed151ece66bf4267dc0f6838449f Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <[email protected]>
+Date: Sat, 27 Apr 2024 15:32:18 +0200
+Subject: [PATCH 2/2] Fix perl include path of tlmgr
+
+The texlive-core ebuilds install tlmgr's perl modules under
+
+/usr/share/tlpkg/TeXLive/
+
+however /usr/share/texmf-dist/scripts/texlive/tlmgr.pl fails to find
+them
+
+can't locate TeXLive/TLConfig.pm in @INC (you may need to install the
+TeXLive::TLConfig module) (@INC entries checked:
+/usr/share/texmf-dist/scripts/texlive/../../texmf-dist/scripts/texlive
+/usr/share/texmf-dist/scripts/texlive/../../tlpkg /etc/perl
+/usr/local/lib64/perl5/5.38/x86_64-linux-thread-multi
+/usr/local/lib64/perl5/5.38
+/usr/lib64/perl5/vendor_perl/5.38/x86_64-linux-thread-multi
+/usr/lib64/perl5/vendor_perl/5.38
+/usr/lib64/perl5/5.38/x86_64-linux-thread-multi /usr/lib64/perl5/5.38)
+at /usr/share/texmf-dist/scripts/texlive/tlmgr.pl line 92.
+
+the @INC above is wrong, it includes
+/usr/share/texmf-dist/tlpkg (/usr/share/texmf-dist/scripts/texlive/../../tlpkg)
+when it should be /usr/share/tlpkg.
+
+So lets fix the include path.
+
+Notably, debian also fixes this via patching tlmgr:
+https://github.com/debian-tex/texlive-nonbin/blob/e4e5b367d97b26c19998e71da40f203d2403f41b/texlive-base/debian/patches/debian-tlmgr-usermode#L7-L39
+
+Bug: https://bugs.gentoo.org/832139
+Bug: https://bugs.gentoo.org/263194
+---
+ texk/texlive/linked_scripts/texlive/tlmgr.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/texk/texlive/linked_scripts/texlive/tlmgr.pl 
b/texk/texlive/linked_scripts/texlive/tlmgr.pl
+index 47c9f5bfa4af..8d79fd376a11 100755
+--- a/texk/texlive/linked_scripts/texlive/tlmgr.pl
++++ b/texk/texlive/linked_scripts/texlive/tlmgr.pl
+@@ -59,7 +59,7 @@ BEGIN {
+     $Master = __FILE__;
+     $Master =~ s,/*[^/]*$,,;
+     $bindir = $Master;
+-    $Master = "$Master/../..";
++    $Master = "$Master/../../..";
+     # make subprograms (including kpsewhich) have the right path:
+     $ENV{"PATH"} = "$bindir:$ENV{PATH}";
+     $kpsewhichname = "kpsewhich";
+-- 
+2.43.2
+

diff --git a/force-tlmgr-into-user-mode.patch b/force-tlmgr-into-user-mode.patch
new file mode 100644
index 0000000..957ba75
--- /dev/null
+++ b/force-tlmgr-into-user-mode.patch
@@ -0,0 +1,38 @@
+From 9ea30257f3c31924e711f9d32b33017ae8870cf5 Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <[email protected]>
+Date: Sat, 27 Apr 2024 15:31:14 +0200
+Subject: [PATCH 1/2] Force tlmgr into user mode
+
+Similar to what debian does [1], we forcefully switch tlmgr into user
+mode.
+
+1: 
https://github.com/debian-tex/texlive-nonbin/blob/e4e5b367d97b26c19998e71da40f203d2403f41b/texlive-base/debian/patches/debian-tlmgr-usermode#L47-L53
+---
+ texk/texlive/linked_scripts/texlive/tlmgr.pl | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/texk/texlive/linked_scripts/texlive/tlmgr.pl 
b/texk/texlive/linked_scripts/texlive/tlmgr.pl
+index 6b7da02192d2..47c9f5bfa4af 100755
+--- a/texk/texlive/linked_scripts/texlive/tlmgr.pl
++++ b/texk/texlive/linked_scripts/texlive/tlmgr.pl
+@@ -616,6 +616,6 @@ for the full story.\n";
+     }
+     push @notvalidargs, $k if !$found;
+   }
+   if (@notvalidargs) {
+     my $msg = "The action $action does not support the following 
option(s):\n";
+     for my $c (@notvalidargs) {
+@@ -630,6 +631,10 @@ for the full story.\n";
+ 
+   # the main tree we will be working on
+   $::maintree = $Master;
++  if (!$opts{"usermode"} && $action ne "init-usertree") {
++    $opts{"usermode"} = 1;
++    print "Gentoo managed TeXLive, switching tlmgr to user mode.\n";
++  }
+   if ($opts{"usermode"}) {
+     # we could also try to detect that we don't have write permissions
+     # and switch to user mode automatically
+-- 
+2.43.2
+

Reply via email to