From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id +DX1BCd3SGRneAAASxT56A (envelope-from ) for ; Wed, 26 Apr 2023 02:58:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id MFsWBCd3SGQpcQAAG6o9tA (envelope-from ) for ; Wed, 26 Apr 2023 02:58:15 +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 C106E47222 for ; Wed, 26 Apr 2023 02:58:14 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682470694; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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=/z9e/4fP8paXIt1xG4eJAHMhAQUrDmYAD014soZEm88=; b=esZSA7oeRftUOillypM4Hod9imnPbAzl4yY+fkkfkNpZueG4pfPOOkKqInvnb0RH+hrMOP NBS8/nA7zqF1lkVSOEIRGnACewWWezL0cMd475RhLAx2b0/CiY5hOcOPb5ynHD52SsgaVP goLuMbbxM0+1Vmm5Qxqw7cU4CQ7AJU8bxjUuR7di9OBQOAMprM26eVCI3G7hBrMtTpf2m3 XvbqgpyXHy9IFe9cD6eSQHL95LGMKCg3cELSrqtFBAfRVW5IuuISOPtEK0bygSgKHNStCZ F6IjcFWvl5DR8NDb/EmQf2i33lGS7D5lrY4GUaJGq0CsH2CKezLP8tMqb913Hw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682470694; a=rsa-sha256; cv=none; b=kdoNGa/RHhAJdMQDPmx8Fy756Ojoxd2zpPWohEYMmMEewAdnWJBHPFroi3KY/sYr63aPXM 1fYT/RTzld4BDi9aMNvb677X/F5KYG7ypvfkdZAB2Ce+fuE91QPFS82a2E1Hw1VXfZCjpS bXmEpPORR8Xho8fJ8XT5l0LxicqwvIQ/PBuYj+lgWVh4hqVG7tdaOKLqpCzTm/baIEZqjn eZGXOOBp4tv6cgN6pmGKlVPFKYiWbgALYFNYEpQ10b+BpsT2vw7+ZavkcEtGFgtPJA/jOV B9nBmbNiMwTs9ZIYkweQ0TPNWrQFRzwE0s1sudQwwtIuAvhLS+Qxb4Z9vbApnQ== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTTz-0006d4-Ui; Tue, 25 Apr 2023 20:58:07 -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 1prTTx-0006c5-Iz for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prTTv-00013a-Dp for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prTTv-0001dI-9L for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 4/8] gnu: docbook-xsl-1.79.1: Refactor package. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63081 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63081@debbugs.gnu.org Cc: andreas@enge.fr, Bruno Victal , maxim.cournoyer@gmail.com Received: via spool by 63081-submit@debbugs.gnu.org id=B63081.16824706656195 (code B ref 63081); Wed, 26 Apr 2023 00:58:03 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:45 +0000 Received: from localhost ([127.0.0.1]:53844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTd-0001br-AL for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:45 -0400 Received: from smtpmciv3.myservices.hosting ([185.26.107.239]:44490) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTb-0001bO-MR for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:44 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpmciv3.myservices.hosting (Postfix) with ESMTP id 9861B21F7C; Wed, 26 Apr 2023 02:57:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id A0B488009F; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-2.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ar6cZsFqmR7u; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) Received: from guix-nuc.home.arpa (unknown [10.192.1.83]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 1230F8009D; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:56 +0100 Message-Id: X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: UNKNOWN X-Migadu-Spam-Score: 0.45 X-Spam-Score: 0.45 X-Migadu-Queue-Id: C106E47222 X-Migadu-Scanner: in3.migadu.com X-TUID: FrGWWzY6Ams+ * gnu/packages/docbook.scm (docbook-xsl-1.79.1)[source]: Remove bundled binary files. [arguments]: Use #:install-plan. Patch catalog.xml using xmlcatalog. Add phase 'install-doc. [native-inputs]: Add libxml2. --- gnu/packages/docbook.scm | 94 ++++++++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 33 deletions(-) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index 2fe0c2dbc5..b3e53557e8 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -430,44 +430,72 @@ (define-public docbook-xsl-1.79.1 name "-ns-" version ".tar.bz2")) (sha256 (base32 - "170ggf5dgjar65kkn5n33kvjr3pdinpj66nnxfx8b2avw0k91jin")))) + "170ggf5dgjar65kkn5n33kvjr3pdinpj66nnxfx8b2avw0k91jin")) + (modules '((guix build utils))) + ;; Bundled binary files. + (snippet + #~(delete-file-recursively "tools")))) (build-system copy-build-system) (outputs '("out" "doc")) (arguments (list + #:install-plan + (let ((target (format #f "xml/xsl/~a-~a/" name version)) + (select-rx '("\\.xml$" "\\.xsl$" "\\.dtd$" "\\.ent$"))) + #~`(#$@(map + (lambda (directory) + ;; XXX: When filters are used, the source basename + ;; isn't kept under the target path, append it again. + (let ((target* (string-append target directory))) + (list directory target* #:include-regexp select-rx))) + (list "assembly" "common" "eclipse" "epub" "epub3" "fo" + "highlighting" "html" "htmlhelp" "javahelp" "lib" + "manpages" "params" "profiling" "roundtrip" + "template" "website" + "xhtml" "xhtml-1_1" "xhtml5")) + ("catalog.xml" #$target) + ("VERSION.xsl" #$target))) #:phases - #~(modify-phases %standard-phases - ;; XXX: The copy-build-system doesn't seem to allow installing to a - ;; different output. - (replace 'install - (lambda _ - (let ((xml (string-append #$output "/xml/xsl/" #$name "-" #$version)) - (doc (string-append #$output:doc - "/share/doc/" #$name "-" #$version)) - (select-rx (make-regexp - "(\\.xml$|\\.xsl$|\\.dtd$|\\.ent$)"))) - ;; Install catalog. - (install-file "catalog.xml" xml) - (install-file "VERSION.xsl" xml) - (substitute* (string-append xml "/catalog.xml") - (("rewritePrefix=\"./") - (string-append "rewritePrefix=\"file://" xml "/"))) - ;; Install style sheets. - (for-each (lambda (dir) - (for-each (lambda (f) - (install-file - f (string-append xml "/" (dirname f)))) - (find-files dir select-rx))) - '("assembly" "common" "eclipse" "epub" "epub3" "fo" - "highlighting" "html" "htmlhelp" "javahelp" "lib" - "manpages" "params" "profiling" "roundtrip" - "template" "website" - "xhtml" "xhtml-1_1" "xhtml5")) - ;; Install documentation. - (install-file "NEWS" doc) - (install-file "RELEASE-NOTES.html" doc) - (copy-recursively "slides" doc) - (copy-recursively "webhelp" doc))))))) + #~(let ((dest-path (format #f "~a/xml/xsl/~a-~a" + #$output #$name #$version))) + (modify-phases %standard-phases + (add-before 'install 'patch-catalog-xml + (lambda* (#:key inputs #:allow-other-keys) + (let ((xmlcatalog (search-input-file inputs + "/bin/xmlcatalog")) + (catalog-files (find-files "." "catalog\\.xml$")) + (store-uri (string-append "file://" dest-path "/"))) + (for-each + (lambda (catalog) + (for-each + (lambda (type) + ;; Patch /current/ references to point to /gnu/store/…. + (invoke xmlcatalog "--noout" + "--add" type + "http://docbook.sourceforge.net/release/xsl-ns/current/" + store-uri + catalog) + ;; Patch versioned references to point to /gnu/store/…. + (invoke xmlcatalog "--noout" + "--add" type + (format + #f "http://docbook.sourceforge.net/release/xsl-ns/~a/" + #$version) + store-uri + catalog)) + (list "rewriteSystem" "rewriteURI"))) + catalog-files)))) + ;; XXX: The copy-build-system doesn't seem to allow installing to a + ;; different output. + (add-after 'install 'install-doc + (lambda _ + (let ((doc (format #f "~a/share/doc/~a-~a" + #$output:doc #$name #$version))) + (install-file "NEWS" doc) + (install-file "RELEASE-NOTES.html" doc) + (copy-recursively "slides" doc) + (copy-recursively "webhelp" doc)))))))) + (native-inputs (list libxml2)) (home-page "https://docbook.org") (synopsis "DocBook XSL namespaced style sheets for document authoring") (description "This package provides the @emph{namespaced} XSL style sheets -- 2.39.2