diff mbox series

[bug#48443,v2,1/2] gnu: Add texlive-libkpathsea.

Message ID 20210713075608.12929-1-leo.prikler@student.tugraz.at
State Accepted
Headers show
Series [bug#48443,v2,1/2] gnu: Add texlive-libkpathsea. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Leo Prikler July 13, 2021, 7:56 a.m. UTC
* gnu/packages/tex.scm (texlive-libkpathsea): New variable.
---
 gnu/packages/tex.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 8d86264209..9256f56842 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -460,6 +460,38 @@  This package contains the binaries.")
    (license (license:fsf-free "https://www.tug.org/texlive/copying.html"))
    (home-page "https://www.tug.org/texlive/")))
 
+(define-public texlive-libkpathsea
+  (package/inherit texlive-bin
+    (name "texlive-libkpathsea")
+    (source
+     (origin
+       (inherit (package-source texlive-bin))
+       (snippet
+        `(begin
+           ,(origin-snippet (package-source texlive-bin))
+           (with-directory-excursion "texk"
+             (let ((preserved-directories '("." ".." "kpathsea")))
+               (for-each
+                delete-file-recursively
+                (scandir "."
+                         (lambda (file)
+                           (and (not (member file preserved-directories))
+                                (eq? 'directory (stat:type (stat file)))))))))))))
+    (arguments
+     (substitute-keyword-arguments (package-arguments texlive-bin)
+       ((#:configure-flags flags)
+        `(cons* "--disable-all-pkgs" "--enable-kpathsea"
+                "--enable-shared" ,flags))
+       ((#:phases phases)
+        `(modify-phases %standard-phases
+           (add-after 'install 'post-install
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (with-directory-excursion "texk/kpathsea"
+                 (invoke "make" "install"))))))))
+    (synopsis "Path searching library")
+    (description "kpathsea is a library, whose purpose is to return a filename
+from a list of user-specified directories similar to how shells look up
+executables.  It is maintained as a part of TeX Live.")))
 
 (define texlive-docstrip
   (package