From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id kLklNpmL82SXxgAAG6o9tA:P1 (envelope-from ) for ; Sat, 02 Sep 2023 21:23:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kLklNpmL82SXxgAAG6o9tA (envelope-from ) for ; Sat, 02 Sep 2023 21:23:05 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 300DC55288 for ; Sat, 2 Sep 2023 21:23:05 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693682585; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=vRP3+GHXutLJSFgXGNG5MphK3isD2YdY5hYIJsClHJ8=; b=rxU26TAPFIu7Pzu+LuUQLVTqGmMVg8+fY0q1lNQYoxaJrc3scUdCwqnpF1RFO7sk4ylMzK WND6xOFzZCEeL6jJGCLoe78Df2oHfUT9c5GBnGaSHFk0ptQJoTswpU7k0z28KvcoQjP/3m GEF4Fr1WfOiFFahmsP0ZdfVx8Kk4EK7WG76PZ5hrsl0GXuWXRANEMm74AvGFLOnjvZH+Dv GPpBz1lbp4jWNbaCUyFPtZttrxQ9qVOysY+yQwAiDiWmnt/WTTbg2OThVgDXv1wkXlF/3I r3cbLErTEZ9cIzytSGD1tt7+aUxCb85TcZbKqo3TFbYz4XWYm9Di/L3NGmKvmA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693682585; a=rsa-sha256; cv=none; b=KSJh+TsZ/9uG8wHdBNOpfukNNnBiDBio0/FdYP/r30UolSr+ZFW3GQWjQUwPWv0jza1onv iX4qA06tqb1BdWW2pv6E4e6lYYE5B/KPsm0iknpc8RFHJj9S40M/FOiMfdXMJ86tD2z1iv g4uCJXBqzvQHJi5WFslPsBWX3gL1Ls+G1nKuo+4wCJEpPwwz0TQA/IGgZ50XCjciJ7+Lu+ dsFjG/q18BYufl7ahv1J/NcKlOfZN/D8JVLPsndk3WtuEZLybDV8HvCG6UP7Grr74i7rlo 1/jOBlqFIFW2hiCGgbVDu6eR+T25Jq2GGmZILfgmWlJiGlrHD3UpXLpJvjfbAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcWCs-0003Ov-JX; Sat, 02 Sep 2023 15:22:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qcWCq-0003Om-QO for bug-guix@gnu.org; Sat, 02 Sep 2023 15:22:52 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcWCq-00043Q-HE for bug-guix@gnu.org; Sat, 02 Sep 2023 15:22:52 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qcWCz-0005Qy-PW; Sat, 02 Sep 2023 15:23:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65366: [PATCH] gnu: texlive-chktex: Fix runtime error. References: <20230818102744.4tax4v3yrsp3cn2b@chloe-laptop.yellowsquid.uk> In-Reply-To: <20230818102744.4tax4v3yrsp3cn2b@chloe-laptop.yellowsquid.uk> Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, rekado@elephly.net, bug-guix@gnu.org Resent-Date: Sat, 02 Sep 2023 19:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65366 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 65366@debbugs.gnu.org Cc: Andreas Enge , Ricardo Wurmus X-Debbugs-Original-Xcc: Andreas Enge , Ricardo Wurmus Received: via spool by 65366-submit@debbugs.gnu.org id=B65366.169368252520823 (code B ref 65366); Sat, 02 Sep 2023 19:23:01 +0000 Received: (at 65366) by debbugs.gnu.org; 2 Sep 2023 19:22:05 +0000 Received: from localhost ([127.0.0.1]:38699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcWC4-0005Pm-Kh for submit@debbugs.gnu.org; Sat, 02 Sep 2023 15:22:05 -0400 Received: from relay5-d.mail.gandi.net ([2001:4b98:dc4:8::225]:44531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qcWC0-0005PF-24 for 65366@debbugs.gnu.org; Sat, 02 Sep 2023 15:22:03 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 6D1FC1C0003 for <65366@debbugs.gnu.org>; Sat, 2 Sep 2023 19:21:43 +0000 (UTC) From: Nicolas Goaziou Date: Sat, 2 Sep 2023 21:18:13 +0200 Message-ID: <716deb42f01f583e34c9b7257592a7e4021f109e.1693682293.git.mail@nicolasgoaziou.fr> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: admin@nicolasgoaziou.fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx2.migadu.com X-Spam-Score: -4.82 X-Migadu-Queue-Id: 300DC55288 X-Migadu-Spam-Score: -4.82 X-TUID: R1cQaqqXbzlf This fixes . * 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. --- The following patch should (partly) fix the issue with chktex. Because both `texlive-bin' and `texlive-chktex' provide the `chktex' executable, one just has to make sure the binary from `texlive-chktex' is used. The next step will be to remove it from `texlive-bin', but this need to go in a separate branch due to the sheer number of rebuilds this will entail. Also, the patch paves the way towards more executables being removed from `texlive-bin', by defining a common `texlive-source' macro. gnu/packages/tex.scm | 79 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 63 insertions(+), 16 deletions(-) diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 9ac9105342..af276cfbdc 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -162,6 +162,17 @@ (define-syntax-rule (define-deprecated-package old-name name) (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") @@ -33358,22 +33369,58 @@ (define-public texlive-chktex (package (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 + #~(begin + (with-directory-excursion "libs" + (for-each + delete-file-recursively + (scandir "." + (lambda (file) + (and (not (member file '("." ".."))) + (eq? 'directory (stat:type (stat file)))))))) + (with-directory-excursion "texk" + (let ((preserved-directories '("." ".." "chktex"))) + (for-each + delete-file-recursively + (scandir "." + (lambda (file) + (and (not (member file preserved-directories)) + (eq? 'directory + (stat:type (stat file))))))))))))) + (build-system gnu-build-system) + (arguments + (list + #:out-of-source? #true + #:configure-flags + #~(list "--disable-native-texlive-build" + "--disable-all-pkgs" + "--enable-chktex") + #: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\")"))))) + (add-after 'install 'post-install + (lambda _ + (with-directory-excursion "texk/chktex" + (invoke "make" "install")))) + ;; Compilation forces a "/usr/bin/env perl" shebang. Change it. + (add-after 'post-install 'patch-shebang + (lambda _ + (patch-shebang + (string-append #$output + "/share/texmf-dist/scripts/chktex/deweb.pl"))))))) + (native-inputs (list pkg-config texlive-libkpathsea)) (inputs (list perl)) (home-page "https://ctan.org/pkg/chktex") (synopsis "Check for errors in LaTeX documents") base-commit: f6cf746938d29ab3d0888a5e58cad97ce634766a -- 2.41.0