From 309ca0e77291f8a3589ecd7fcc7d417778928ca1 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 28 May 2024 00:05:17 +0200 Subject: gnu: Add texlive-psutils-bin. * gnu/packages/tex.scm (texlive-psutils-bin): New variable. (texlive-psutils)[arguments]<#:link-scripts>: Remove as those are now provided by TEXLIVE-PSUTILS-BIN. [inputs]: Remove PERL. [propagated-inputs]: Add TEXLIVE-PSUTILS-BIN. Change-Id: I9435ed4216237893e503487f94c42ad9cc8c268f --- gnu/packages/tex.scm | 68 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index b8a70a3f1e..1b7bfe5d22 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -42659,9 +42659,7 @@ (define-public texlive-psutils "0ba514lz3pc03ll0kb9apdx62mi2yiyd7bnargkp2bbf62dq79cc"))) (outputs '("out" "doc")) (build-system texlive-build-system) - (arguments - (list #:link-scripts #~(list "extractres.pl" "includeres.pl" "psjoin.pl"))) - (inputs (list perl)) + (propagated-inputs (list texlive-psutils-bin)) (home-page "https://ctan.org/pkg/psutils") (synopsis "PostScript utilities") (description @@ -42675,6 +42673,70 @@ (define-public texlive-psutils (license:fsf-free "https://tug.org/svn/texlive/trunk/Build/source/texk/psutils/psutils-src/LICENSE?revision=57915&view=markup"))))) +(define-public texlive-psutils-bin + (package + (inherit texlive-bin) + (name "texlive-psutils-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" '()) + (delete-other-directories "texk" '("psutils")))))) + (arguments + (substitute-keyword-arguments (package-arguments texlive-bin) + ((#:configure-flags flags) + #~(cons "--enable-psutils" (delete "--enable-web2c" #$flags))) + ((#:phases phases) + #~(modify-phases #$phases + (add-after 'unpack 'patch-psutils-tests + (lambda _ + ;; This test fails due to a rounding difference with libpaper + ;; 1.2: . + ;; + ;; Adjust the expected outcome to account for the minute + ;; difference. + (substitute* "texk/psutils/tests/playres.ps" + (("844\\.647799") "844.647797")) + ;; Test suite also fails because it expects to find + ;; "texmf.cnf" in "../kpathsea/" directory, but we removed it + ;; in a snippet. Point to the real "texmf.cnf". + (let ((kpathsea #$(this-package-input "texlive-libkpathsea"))) + (substitute* "texk/psutils/psutils.test" + (("(TEXMFCNF=).+?;" _ var) + (string-append var + kpathsea + "/share/texmf-dist/web2c;")))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (with-directory-excursion "texk/psutils" + (invoke "make" "check"))))) + (replace 'install + (lambda _ + (with-directory-excursion "texk/psutils" + (invoke "make" "install")))))))) + (native-inputs (list pkg-config)) + (inputs (list libpaper perl texlive-libkpathsea)) + (propagated-inputs '()) + (synopsis "Binaries for @code{texlive-psutils}") + (description + "This package provides the binaries for @code{texlive-psutils}.") + (license (package-license texlive-psutils)))) + (define-public texlive-ptolemaicastronomy (package (name "texlive-ptolemaicastronomy") -- cgit v1.2.3