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

commit 61ec26636c923b94e21c3e5a15d2e0a76dbb052c
Author: Nicolas Goaziou <m...@nicolasgoaziou.fr>
AuthorDate: Sat May 11 15:55:39 2024 +0200

    gnu: texlive-autosp: Build executables.
    
    * gnu/packages/tex.scm (texlive-autosp): Inherit from TEXLIVE-BIN.
    [source]: Build from a trimmed TEXLIVE-SOURCE.
    [arguments]: Build `autosp' as a single package.
    
    * gnu/packages/tex.scm (texlive-bin): Do not build autosp.
    
    Change-Id: I5c7ba5886a0f90f7e521b1d5c9edcffc27cd5574
---
 gnu/packages/tex.scm | 62 ++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 50 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index cd2cd3ad7f..1555c5450b 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -700,6 +700,7 @@ and should be preferred to it whenever a package would 
otherwise depend on
                 ;; Disable tools built in other packages.
                 #$@(map (lambda (p) (string-append "--disable-" p))
                         '("afm2pl"
+                          "autosp"
                           "axodraw2"
                           "chktex"
                           "cjkutils"
@@ -4091,19 +4092,56 @@ computer-generated long formulae with many terms.")
 
 (define-public texlive-autosp
   (package
+    (inherit texlive-bin)
     (name "texlive-autosp")
-    (version (number->string %texlive-revision))
-    (source (texlive-origin
-             name version
-             (list "doc/generic/autosp/"
-                   "doc/man/man1/autosp.1"
-                   "doc/man/man1/autosp.man1.pdf"
-                   "doc/man/man1/tex2aspc.1"
-                   "doc/man/man1/tex2aspc.man1.pdf")
-             (base32
-              "16szmbffp9pwzv7zq3l4yvnsfk4m7w57wib7pqpgv1v5fzhlaahs")))
-    (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" '("autosp"))
+            (delete-other-directories "texk" '())))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        #~(cons* "--disable-all-pkgs"
+                 "--enable-autosp"
+                 (delete "--disable-autosp" #$flags)))
+       ((#:phases _)
+        #~(modify-phases %standard-phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (with-directory-excursion "utils/autosp"
+                    (invoke "make" "check")))))
+            (replace 'install
+              (lambda* (#:key inputs native-inputs #:allow-other-keys)
+                (with-directory-excursion "utils/autosp"
+                  (invoke "make" "install"))
+                (let ((source
+                       ((compose dirname dirname dirname)
+                        (search-input-file (or native-inputs inputs)
+                                           "doc/generic/autosp/README")))
+                      (doc (string-append #$output "/share/texmf-dist/doc")))
+                  (copy-recursively source doc))))))))
+    (native-inputs
+     (list (texlive-origin
+            name (package-version texlive-bin)
+            (list "doc/generic/autosp/")
+            (base32
+             "0s9lf24cb1105x1mzfxlgsyp4zixln1f9jbxdnkxxisg1q00b7l7"))))
+    (inputs '())
     (home-page "https://ctan.org/pkg/autosp";)
     (synopsis
      "Preprocessor generating note-spacing commands for MusiXTeX scores")

Reply via email to