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

commit 03140ea30f1e5acc49664b8e595049f806e298a9
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
AuthorDate: Sat May 11 13:06:50 2024 +0200

    gnu: texlive-lacheck: Build executable.
    
    * gnu/packages/tex.scm (texlive-lacheck): Inherit from TEXLIVE-BIN.
    [source]: Build from a trimmed TEXLIVE-SOURCE.
    [arguments]: Build `lacheck' as a single package.
    
    * gnu/packages/tex.scm (texlive-bin): Do not build lacheck.
    
    Change-Id: I0a693ca80a932735a7a203dd64d7f51727947daa
---
 gnu/packages/tex.scm | 48 +++++++++++++++++++++++++++++++++++++++---------
 1 file changed, 39 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index e37c8dfb1a..6949fe2a47 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -704,6 +704,7 @@ and should be preferred to it whenever a package would 
otherwise depend on
                           "cjkutils"
                           "dvisvgm"
                           "kpathsea"
+                          "lacheck"
                           "psutils"
                           "upmendex"
                           "xindy"))))
@@ -38353,16 +38354,45 @@ generated code can be included in any LaTeX 
document.")
 
 (define-public texlive-lacheck
   (package
+    (inherit texlive-bin)
     (name "texlive-lacheck")
-    (version (number->string %texlive-revision))
-    (source (texlive-origin
-             name version
-             (list "doc/man/man1/lacheck.1"
-                   "doc/man/man1/lacheck.man1.pdf")
-             (base32
-              "1hhx65yd800bl3y2sq20lix60wd2b2j3k7n9s788mlsn8b0p7yq3")))
-    (outputs '("out" "doc"))
-    (build-system texlive-build-system)
+    (source
+     (origin
+       (inherit texlive-source)
+       (modules '((guix build utils)
+                  (ice-9 ftw)))
+       (snippet
+        #~(let ((delete-other-directories
+                 (lambda (root dirs)
+                   (with-directory-excursion root
+                     (for-each
+                      delete-file-recursively
+                      (scandir "."
+                               (lambda (file)
+                                 (and (not (member file (append '("." "..") 
dirs)))
+                                      (eq? 'directory (stat:type (stat 
file)))))))))))
+            (delete-other-directories "libs" '())
+            (delete-other-directories "utils" '("lacheck"))
+            (delete-other-directories "texk" '())))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        #~(cons* "--disable-all-pkgs"
+                 "--enable-lacheck"
+                 (delete "--disable-lacheck" #$flags)))
+       ((#:phases _)
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (with-directory-excursion "utils/lacheck"
+                    (invoke "make" "check")))))
+            (replace 'install
+              (lambda _
+                (with-directory-excursion "utils/lacheck"
+                  (invoke "make" "install"))))))))
+    (native-inputs '())
+    (inputs '())
     (home-page "https://ctan.org/pkg/lacheck";)
     (synopsis "LaTeX checker")
     (description

Reply via email to