guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

97/137: guix: import texlive: Reduce friction when updating.


From: guix-commits
Subject: 97/137: guix: import texlive: Reduce friction when updating.
Date: Mon, 24 Jun 2024 18:27:19 -0400 (EDT)

ngz pushed a commit to branch tex-team
in repository guix.

commit d5e4ca148eaf64fb501e3be5024ab156ea379137
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
AuthorDate: Fri Jun 21 20:13:44 2024 +0200

    guix: import texlive: Reduce friction when updating.
    
    * guix/import/texlive.scm (no-bin-propagation-packages): Add more false
    positives that do not need to propagate binaries.
    (list-linked-scripts): Recognize ".sco" extension.
    (list-upstream-inputs): Special case TEXLIVE-KPATHSEA, which should 
propagate
    TEXLIVE-LIBKPATHSEA, not TEXLIVE-KPATHSEA-BIN.
    (texlive->svn-multi-reference):
    (tlpdb->package): Special case URL for TEXLIVE-SCRIPTS.
    
    Change-Id: Ib0954b42a4664184ab006b4c6ec9bdacd48c1646
---
 guix/import/texlive.scm | 89 ++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 66 insertions(+), 23 deletions(-)

diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index 5aae1c3d49..eb6262e140 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -73,22 +73,53 @@
         "tex/generic/hyphen/"
         "web2c/"))
 
-;; The following packages should propagate their binaries according to the TeX
-;; Live database, but won't because said binaries are already provided by
-;; "texlive-bin".  As a consequence, the importer does not make them propagate
-;; their "-bin" counterpart.
+;; The following packages do not have any auxiliary "-bin" package to
+;; propagate, even if they do have a corresponding ".ARCH" entry in the TeX
+;; Live package database.  They fall into 3 categories:
+;;
+;; 1. Associated entries in NAME.ARCH are already provided by TEXLIVE-BIN.
+;;
+;; 2. Associated entries in NAME.ARCH are symlinks to binaries provided by
+;; TEXLIVE-BIN.
+;;
+;; 3. They fool the (naive) algorithm for "-bin" propagation and generate
+;; false positives.  This generally happens when the package creates multiple
+;; symlinks to a script it bundles.
 (define no-bin-propagation-packages
-  (list "cweb"
-        "latex-bin"
-        "luahbtex"
-        "luatex"
-        "metafont"
-        "pdftex"
-        "pdftosrc"
-        "synctex"
-        "tex"
-        "tie"
-        "web"))
+  (list
+   ;; Category 1.
+   "ctie"
+   "cweb"
+   "luahbtex"
+   "luatex"
+   "metafont"
+   "pdftex"
+   "pdftosrc"
+   "synctex"
+   "tex"
+   "tie"
+   "web"
+   ;; Category 2.
+   "amstex"
+   "csplain"
+   "eplain"
+   "jadetex"
+   "latex-bin"
+   "lollipop"
+   "mex"
+   "mltex"
+   "optex"
+   "platex"
+   "uplatex"
+   "texsis"
+   "xmltex"
+   ;; Category 3.
+   "biber"
+   "context"
+   "cluttex"
+   "esptopdf"
+   "pdfcrop"
+   "texdef"))
 
 ;; Guix introduces two specific packages based on TEXLIVE-BUILD-SYSTEM.  Add
 ;; an entry for them in the package database, so they can be imported, and
@@ -468,8 +499,8 @@ association list."
 (define (list-linked-scripts name package-database)
   "Return a list of script names to symlink from \"bin/\" directory for
 package NAME according to PACKAGE-DATABASE.  Consider as scripts files with
-\".lua\", \".pl\", \".py\", \".rb\", \".sh\", \".tcl\", \".texlua\", \".tlu\"
-extensions, and files without extension."
+\".lua\", \".pl\", \".py\", \".rb\", \".sh\", \".sno\", \".tcl\", \".texlua\",
+\".tlu\" extensions, and files without extension."
   (or (and-let* ((data (assoc-ref package-database name))
                  ;; List scripts candidates.  Bail out if there are none.
                  (runfiles (assoc-ref data 'runfiles))
@@ -480,8 +511,8 @@ extensions, and files without extension."
         (filter-map (lambda (script)
                       (and (any (lambda (ext)
                                   (member (basename script ext) binfiles))
-                                '(".lua" ".pl" ".py" ".rb" ".sh" ".tcl" 
".texlua"
-                                  ".tlu"))
+                                '(".lua" ".pl" ".py" ".rb" ".sh" ".sno" ".tcl"
+                                  ".texlua" ".tlu"))
                            (basename script)))
                     ;; Get the right (alphabetic) order.
                     (reverse scripts)))
@@ -550,7 +581,11 @@ of package with UPSTREAM-NAME in VERSION."
                    (if (and (> (length binfiles) (length scripts))
                             (not (member upstream-name
                                          no-bin-propagation-packages)))
-                       (list (string-append upstream-name "-bin"))
+                       ;; LIBKPATHSEA contains the executables for KPATHSEA.
+                       ;; There is no KPATHSEA-BIN.
+                       (list (if (equal? upstream-name "kpathsea")
+                                 "libkpathsea"
+                                 (string-append upstream-name "-bin")))
                        '()))
                   string<?))))))
 
@@ -585,11 +620,12 @@ at VERSION."
          (files (append (or (assoc-ref data 'docfiles) (list))
                         (or (assoc-ref data 'runfiles) (list))
                         (or (assoc-ref data 'srcfiles) (list))))
+         (texlive-scripts? (equal? upstream-name "scripts"))
          (locations
           ;; Drop "texmf-dist/" prefix from files.  Special case
           ;; TEXLIVE-SCRIPTS, where files are split across "tlpkg/" and
           ;; "texmf-dist/".
-          (if (equal? upstream-name "scripts")
+          (if texlive-scripts?
               files
               (files->locations
                ;; Ignore any file not starting with the expected prefix, such
@@ -600,7 +636,10 @@ at VERSION."
                        (string-drop file (string-length "texmf-dist/"))))
                 files)))))
     (svn-multi-reference
-     (url (texlive-packages-repository version))
+     (url (if texlive-scripts?
+              (string-append
+               %texlive-repository "tags/texlive-" version "/Master")
+              (texlive-packages-repository version)))
      (locations (sort locations string<))
      (revision (assoc-ref database 'database-revision)))))
 
@@ -628,7 +667,11 @@ at VERSION."
                  `(origin
                     (method svn-multi-fetch)
                     (uri (svn-multi-reference
-                          (url (texlive-packages-repository version))
+                          (url
+                           ,(if (equal? upstream-name "scripts")
+                                '(string-append %texlive-repository
+                                                "tags/texlive-" version 
"/Master/")
+                                '(texlive-packages-repository version)))
                           (revision ,(svn-multi-reference-revision reference))
                           (locations
                            (list ,@(svn-multi-reference-locations 
reference)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]