summary refs log tree commit diff
path: root/gnu/packages
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2024-05-28 21:55:12 +0200
committerLudovic Courtès <ludo@gnu.org>2024-08-31 10:45:30 +0200
commit80be3a4a46c2a1fbd044d5b7a32f3e052531c271 (patch)
treef639c102bb72cd03eba1c1ab06f38e1da6335743 /gnu/packages
parentbf25c373ac856d0162ba88eee28f1f8c6295c5b4 (diff)
downloadguix-80be3a4a46c2a1fbd044d5b7a32f3e052531c271.tar.gz
gnu: texlive-axodraw2: Build binary separately.
* gnu/packages/tex.scm (texlive-axodraw2-bin): New variable.
(texlive-axodraw2): Use source from TEXLIVE-SOURCE and make it a regular TeX
Live package.
[arguments]: Remove it.
[inputs]: Remove OPENLIBM.
[propagated-inputs]: Add TEXLIVE-AXODRAW2-BIN.

Change-Id: I119617e48ef419e4e09887002a29a591eaa27e9e
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/tex.scm74
1 files changed, 48 insertions, 26 deletions
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 9de5cd224c..c6570786ec 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -4264,7 +4264,6 @@ other parts.")
      "This package provides binaries for @code{texlive-autosp}.")
     (license (package-license texlive-autosp))))
 
-
 (define-public texlive-axodraw2
   (package
     (name "texlive-axodraw2")
@@ -4280,31 +4279,7 @@ other parts.")
               "0x1cskdm3kmf08gdrvgasd1b3l0dri9mdmk13880dz4g2rdgbvi2")))
     (outputs '("out" "doc"))
     (build-system texlive-build-system)
-    (arguments
-     (list
-      #:tests? #true
-      #:phases
-      #~(modify-phases %standard-phases
-          (add-after 'unpack 'build-axohelp
-            (lambda* (#:key tests? #:allow-other-keys)
-              (with-directory-excursion "source/latex/axodraw2"
-                ;; Autoreconf.
-                (invoke "autoreconf" "-vfi")
-                ;; Configure.
-                (let ((sh (which "sh")))
-                  (setenv "CONFIG_SHELL" sh)
-                  (setenv "SHELL" sh)
-                  (invoke sh "configure" (string-append "--prefix=" #$output)))
-                ;; Build.
-                (invoke "make")
-                ;; Tests.
-                (when tests?
-                  (patch-shebang "axohelp.test") ;Bash script
-                  (invoke "make" "check"))
-                ;; Install.
-                (invoke "make" "install")))))))
-    (native-inputs (list autoconf automake pkg-config))
-    (inputs (list openlibm))
+    (propagated-inputs (list texlive-axodraw2-bin))
     (home-page "https://ctan.org/pkg/axodraw2")
     (synopsis "Feynman diagrams in a LaTeX document")
     (description
@@ -4322,6 +4297,53 @@ the pdf code inserted in the output file.  The processing involves a run of
 @command{pdflatex}.")
     (license license:gpl3+)))
 
+(define-public texlive-axodraw2-bin
+  (package
+    (inherit texlive-bin)
+    (name "texlive-axodraw2-bin")
+    (source
+     (origin
+       (inherit texlive-source)
+       (modules '((guix build utils)
+                  (ice-9 ftw)))
+       (snippet
+        #~(let ((delete-other-directories
+                 (lambda (root keep)
+                   (with-directory-excursion root
+                     (for-each
+                      delete-file-recursively
+                      (scandir
+                       "."
+                       (lambda (file)
+                         (and (not (member file (append keep '("." ".."))))
+                              (eq? 'directory (stat:type (stat file)))))))))))
+            (delete-other-directories "libs" '())
+            (delete-other-directories "utils" '("axodraw2"))
+            (delete-other-directories "texk" '())))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        #~(cons "--enable-axodraw2" (delete "--enable-web2c" #$flags)))
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (replace 'check
+              (lambda* (#:key tests? #:allow-other-keys)
+                (when tests?
+                  (with-directory-excursion "utils/axodraw2"
+                    (invoke "make" "check")))))
+            (replace 'install
+              (lambda _
+                (with-directory-excursion "utils/axodraw2"
+                  (invoke "make" "install"))))))))
+    (native-inputs '())
+    (inputs '())
+    (propagated-inputs '())
+    (home-page (package-home-page texlive-axodraw2))
+    (synopsis "Binary for @code{texlive-axodraw2}")
+    (description
+     "This package provides the binary for @code{texlive-axodraw2}.")
+    (license (package-license texlive-axodraw2))))
+
 (define-public texlive-b1encoding
   (package
     (name "texlive-b1encoding")