summary refs log tree commit diff
path: root/guix
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2023-07-10 10:03:46 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2023-07-18 18:16:53 +0200
commit026ed35ddb896829c733f9cc032a7203abe5334c (patch)
tree9f75e57c2865d1473cf7ebc016c9f77bc8dcc4cf /guix
parent22c752fde110ac75d87051d680d6383cd0f95c4e (diff)
downloadguix-026ed35ddb896829c733f9cc032a7203abe5334c.tar.gz
guix: import: Handle texlua and TCL scripts.
* guix/import/texlive.scm (linked-scripts): Also generate scripts from files
with ".tlu" and ".tcl" extensions.
(tlpdb->package): Add appropriate inputs when providing a TCL script.
Diffstat (limited to 'guix')
-rw-r--r--guix/import/texlive.scm16
1 files changed, 9 insertions, 7 deletions
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index fe28b24715..cb9651419b 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -292,7 +292,8 @@ When TEXLIVE-ONLY is true, only TeX Live packages are returned."
 (define (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\", \".sh\" extensions, and files without extension."
+\".lua\", \".pl\", \".py\", \".sh\", \".tcl\", \".tlu\" extensions, and files
+without extension."
   (and-let* ((data (assoc-ref package-database name))
              ;; Check if binaries are associated to the package.
              (depend (assoc-ref data 'depend))
@@ -310,7 +311,7 @@ package NAME according to PACKAGE-DATABASE.  Consider as scripts files with
     (filter-map (lambda (script)
                   (and (any (lambda (ext)
                               (member (basename script ext) binaries))
-                            '(".lua" ".pl" ".py" ".sh"))
+                            '(".lua" ".pl" ".py" ".sh" ".tcl" ".tlu"))
                        (basename script)))
                 ;; Get the right (alphabetic) order.
                 (reverse scripts))))
@@ -466,13 +467,14 @@ of those files are returned that are unexpectedly installed."
                   '((native-inputs (list texlive-metafont))))
                 '())
           ;; Inputs.
-          ,@(match (filter-map (lambda (s)
-                                 (cond ((string-suffix? ".pl" s) 'perl)
-                                       ((string-suffix? ".py" s) 'python)
-                                       (else #f)))
+          ,@(match (append-map (lambda (s)
+                                 (cond ((string-suffix? ".pl" s) '(perl))
+                                       ((string-suffix? ".py" s) '(python))
+                                       ((string-suffix? ".tcl" s) '(tcl tk))
+                                       (else '())))
                                (or scripts '()))
               (() '())
-              (inputs `((inputs (list ,@inputs)))))
+              (inputs `((inputs (list ,@(delete-duplicates inputs eq?))))))
           ;; Propagated inputs.
           ,@(match (translate-depends depends)
               (() '())