[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
11/421: guix: import: texlive use full file names for generic directorie
From: |
guix-commits |
Subject: |
11/421: guix: import: texlive use full file names for generic directories. |
Date: |
Sun, 28 May 2023 01:29:19 -0400 (EDT) |
ngz pushed a commit to branch tex-team-next
in repository guix.
commit fe12907cdb1291fb340e9bd5ffa428c9ec5240be
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
AuthorDate: Wed May 17 09:46:17 2023 +0200
guix: import: texlive use full file names for generic directories.
Generic directories, such as "doc/info/" or "doc/man" are shared by multiple
packages. With this change, the texlive importer specifies the full file
name
of package-specific files there, making sure only them are downloaded.
* guix/import/texlive.scm (texlive-generic-locations): New variable.
(files->locations): Renamed from files->directories.
Provide full file names when necessary.
(tlpdb->package): Apply renaming.
---
guix/import/texlive.scm | 57 ++++++++++++++++++++++++++++++++++---------------
1 file changed, 40 insertions(+), 17 deletions(-)
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index 8618ccd802..31abf533c4 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -48,6 +48,20 @@
;;;
;;; Code:
+;; Generic locations are parts of the tree shared by multiple packages.
+;; Package definitions should single out files stored there, or all files in
+;; the directory from all involved packages would be downloaded.
+(define texlive-generic-locations
+ (list "doc/generic/hyph-utf8/"
+ "doc/info/"
+ "doc/man/"
+ "doc/web2c/"
+ "scripts/texlive/"
+ "scripts/texlive-extra/"
+ "tex/generic/config/"
+ "tex/generic/hyphen/"
+ "web2c/"))
+
(define string->license
(match-lambda
("artistic2" 'gpl3+)
@@ -70,9 +84,9 @@
("lpplgpl" `(list lppl gpl1+))
("lppl" 'lppl)
- ("lppl1" 'lppl1.0+) ; usually means "or later"
- ("lppl1.2" 'lppl1.2+) ; usually means "or later"
- ("lppl1.3" 'lppl1.3+) ; usually means "or later"
+ ("lppl1" 'lppl1.0+) ; usually means "or later"
+ ("lppl1.2" 'lppl1.2+) ; usually means "or later"
+ ("lppl1.3" 'lppl1.3+) ; usually means "or later"
("lppl1.3a" 'lppl1.3a)
("lppl1.3b" 'lppl1.3b)
("lppl1.3c" 'lppl1.3c)
@@ -234,25 +248,34 @@ of those files are returned that are unexpectedly
installed."
(lset-difference string=?
(map strip-directory-prefix existing) files))))
-(define (files->directories files)
+(define (files->locations files)
(define name->parts (cut string-split <> #\/))
- (map (cut string-join <> "/" 'suffix)
- (delete-duplicates (map (lambda (file)
- (drop-right (name->parts file) 1))
- (sort files string<))
- ;; Remove sub-directories, i.e. more specific
- ;; entries with the same prefix.
- (lambda (x y) (every equal? x y)))))
+ ;; Generic locations are shared by multiple packages. Provide the full file
+ ;; name to make so as to extract only the files related to the package being
+ ;; imported.
+ (let-values (((generic specific)
+ (partition (lambda (f)
+ (any (cut string-prefix? <> f)
+ texlive-generic-locations))
+ files)))
+ (append generic
+ (map (cut string-join <> "/" 'suffix)
+ (delete-duplicates (map (lambda (file)
+ (drop-right (name->parts file) 1))
+ (sort specific string<))
+ ;; Remove sub-directories, i.e. more
+ ;; specific entries with the same prefix.
+ (lambda (x y) (every equal? x y)))))))
(define (tlpdb->package name version package-database)
(and-let* ((data (assoc-ref package-database name))
- (dirs (files->directories
- (filter-map (lambda (dir)
+ (locs (files->locations
+ (filter-map (lambda (file)
;; Ignore any file not starting with the
;; expected prefix. Nothing good can come
;; from this.
- (and (string-prefix? "texmf-dist/" dir)
- (string-drop dir (string-length
"texmf-dist/"))))
+ (and (string-prefix? "texmf-dist/" file)
+ (string-drop file (string-length
"texmf-dist/"))))
(append (or (assoc-ref data 'docfiles) (list))
(or (assoc-ref data 'runfiles) (list))
(or (assoc-ref data 'srcfiles)
(list))))))
@@ -263,7 +286,7 @@ of those files are returned that are unexpectedly
installed."
(ref (svn-multi-reference
(url (string-append "svn://www.tug.org/texlive/tags/"
%texlive-tag "/Master/texmf-dist"))
- (locations dirs)
+ (locations locs)
(revision %texlive-revision)))
;; Ignore arch-dependent packages.
(filtered-depends
@@ -295,7 +318,7 @@ of those files are returned that are unexpectedly
installed."
(() '())
(inputs
`((propagated-inputs
- (list ,@(map-in-order
+ (list ,@(map
(lambda (tex-name)
(let ((name (guix-name tex-name)))
(string->symbol name)))
- 84/421: gnu: texlive-latex-frankenstein -> texlive-frankenstein., (continued)
- 84/421: gnu: texlive-latex-frankenstein -> texlive-frankenstein., guix-commits, 2023/05/28
- 85/421: gnu: texlive-latex-jknapltx -> texlive-jknapltx., guix-commits, 2023/05/28
- 90/421: gnu: texlive-latex-overpic -> texlive-overpic., guix-commits, 2023/05/28
- 96/421: gnu: texlive-latex-type1cm -> texlive-type1cm., guix-commits, 2023/05/28
- 102/421: gnu: Add texlive-luacode., guix-commits, 2023/05/28
- 119/421: gnu: texlive-latex-textpos -> texlive-textpos., guix-commits, 2023/05/28
- 124/421: gnu: texlive-generic-babel-german -> texlive-babel-german., guix-commits, 2023/05/28
- 03/421: gnu: texlive-latex-epstopdf-pkg: Rename to texlive-epstopdf-pkg., guix-commits, 2023/05/28
- 07/421: guix: texlive-build-system: Improvements on non-trivial packages., guix-commits, 2023/05/28
- 09/421: guix: import: Update texlive importer according to new build system., guix-commits, 2023/05/28
- 11/421: guix: import: texlive use full file names for generic directories.,
guix-commits <=
- 12/421: guix: import: Fix multiple licenses output in texlive importer., guix-commits, 2023/05/28
- 31/421: gnu: Add texlive-dehyph., guix-commits, 2023/05/28
- 38/421: gnu: Add texlive-multido., guix-commits, 2023/05/28
- 42/421: gnu: texlive-latex-backend -> texlive-backend., guix-commits, 2023/05/28
- 41/421: gnu: Add texlive-subfig., guix-commits, 2023/05/28
- 54/421: gnu: texlive-generic-listofitems -> texlive-listofitems., guix-commits, 2023/05/28
- 58/421: gnu: texlive-latex-framed -> texlive-framed., guix-commits, 2023/05/28
- 53/421: gnu: texlive-latex-seqsplit -> texlive-seqsplit., guix-commits, 2023/05/28
- 60/421: gnu: texlive-latex-galois -> texlive-galois., guix-commits, 2023/05/28
- 59/421: gnu: texlive-latex-g-brief -> texlive-g-brief., guix-commits, 2023/05/28