[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/24: gnu: texlive-chktex: Fix runtime error.
From: |
guix-commits |
Subject: |
02/24: gnu: texlive-chktex: Fix runtime error. |
Date: |
Sat, 11 May 2024 10:53:16 -0400 (EDT) |
ngz pushed a commit to branch tex-team
in repository guix.
commit c5ddbabe5d23e517365e5216574fc3271769a081
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
AuthorDate: Wed May 8 16:41:02 2024 +0200
gnu: texlive-chktex: Fix runtime error.
This fixes <https://issues.guix.gnu.org/65366>.
* gnu/packages/tex.scm (texlive-source): New variable.
(texlive-chktex)[source]: Build binary from source.
[build-system]: Use GNU-BUILD-SYSTEM.
[arguments]<#:phases>: Make sure the `chktex' executable can locate a global
configuration file.
[native-inputs]: Add PKG-CONFIG and TEXLIVE-LIBKPATHSEA.
Change-Id: Icdf22635b304caa86757117a408da9fa1452cc10
---
gnu/packages/tex.scm | 79 +++++++++++++++++++++++++++++++++++++++++-----------
1 file changed, 62 insertions(+), 17 deletions(-)
diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm
index 91b0393641..295a4099c2 100644
--- a/gnu/packages/tex.scm
+++ b/gnu/packages/tex.scm
@@ -162,6 +162,17 @@
(define-deprecated/public old-name name
(deprecated-package (symbol->string 'old-name) name)))
+(define texlive-source
+ (let ((version "20230313"))
+ (origin
+ (method url-fetch)
+ (uri (string-append "ftp://tug.org/historic/systems/texlive/"
+ (string-take version 4) "/"
+ "texlive-" version "-source.tar.xz"))
+ (sha256
+ (base32
+ "1fbrkv7g9j6ipmwjx27l8l9l974rmply8bhf7c2iqc6h3q7aly1q")))))
+
(define-public texlive-libkpathsea
(package
(name "texlive-libkpathsea")
@@ -33369,24 +33380,58 @@ labels and advises the user to use a starred version
instead.")
(define-public texlive-chktex
(package
+ (inherit texlive-bin)
(name "texlive-chktex")
- (version (number->string %texlive-revision))
- (source (texlive-origin
- name version
- (list "chktex/"
- "doc/chktex/"
- "doc/man/man1/chktex.1"
- "doc/man/man1/chktex.man1.pdf"
- "doc/man/man1/chkweb.1"
- "doc/man/man1/chkweb.man1.pdf"
- "doc/man/man1/deweb.1"
- "doc/man/man1/deweb.man1.pdf"
- "scripts/chktex/")
- (base32
- "0qyrllxvcymmr1a4sq9c88fw5zchcx0n6yac69s61fg6xypk18bq")))
- (outputs '("out" "doc"))
- (build-system texlive-build-system)
- (arguments (list #:link-scripts #~(list "chkweb.sh" "deweb.pl")))
+ (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" '())
+ (delete-other-directories "texk" '("chktex"))))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments texlive-bin)
+ ((#:configure-flags flags)
+ #~(cons* "--disable-all-pkgs"
+ "--enable-chktex"
+ (delete "--disable-ckhtex" #$flags)))
+ ((#:phases _)
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'locate-global-configuration-file
+ ;; `chktex' needs to know where its global configuration file is.
+ ;; However, it cannot understand our convoluted TEXMFMAIN value.
+ ;; This phase forces configuration file name.
+ (lambda _
+ (substitute* "texk/chktex/chktex-src/OpSys.c"
+ (("kpse_var_value\\(\"TEXMFMAIN\"\\)")
+ (string-append "strdup(\"" #$output
"/share/texmf-dist\")")))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "texk/chktex"
+ (invoke "make" "check")))))
+ (replace 'install
+ (lambda _
+ (with-directory-excursion "texk/chktex"
+ (invoke "make" "install"))))
+ ;; Compilation forces a "/usr/bin/env perl" shebang. Change it.
+ (add-after 'install 'patch-shebang
+ (lambda _
+ (patch-shebang
+ (string-append #$output
+
"/share/texmf-dist/scripts/chktex/deweb.pl"))))))))
(inputs (list perl))
(home-page "https://ctan.org/pkg/chktex")
(synopsis "Check for errors in LaTeX documents")
- 22/24: gnu: texlive-autosp: Build executables., (continued)
- 22/24: gnu: texlive-autosp: Build executables., guix-commits, 2024/05/11
- 03/24: gnu: texlive-psutils: Build executable., guix-commits, 2024/05/11
- 05/24: gnu: texlive-bin: Remove unnecessary phases., guix-commits, 2024/05/11
- 13/24: gnu: texlive-bin: Skip building axodraw2., guix-commits, 2024/05/11
- 01/24: gnu: texlive-libkpathsea: Fix TEXMFCACHE location., guix-commits, 2024/05/11
- 08/24: gnu: texlive-libkpathsea: Set sane values in "texmf.cnf"., guix-commits, 2024/05/11
- 10/24: gnu: texlive-upmendex: Build executables., guix-commits, 2024/05/11
- 06/24: gnu: texlive-bin: Remove conditional tests on some architectures., guix-commits, 2024/05/11
- 14/24: gnu: texlive-cjkutils: Build executables., guix-commits, 2024/05/11
- 16/24: gnu: texlive-lcdftypetools: Build executables., guix-commits, 2024/05/11
- 02/24: gnu: texlive-chktex: Fix runtime error.,
guix-commits <=
- 12/24: gnu: texlive-bin: Do not build Xindy., guix-commits, 2024/05/11
- 15/24: gnu: texlive-lacheck: Build executable., guix-commits, 2024/05/11
- 18/24: gnu: texlive-dvipng: Build executables., guix-commits, 2024/05/11
- 21/24: gnu: texlive-dvi2tty: Build executables., guix-commits, 2024/05/11
- 23/24: gnu: texlive-velthuis: Build executable., guix-commits, 2024/05/11