From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id gGcYKMSASGSVZgAASxT56A (envelope-from ) for ; Wed, 26 Apr 2023 03:39:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id UPIXKMSASGR66wAAauVa8A (envelope-from ) for ; Wed, 26 Apr 2023 03:39:16 +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 6995217B56 for ; Wed, 26 Apr 2023 03:39:16 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prTU0-0006dL-6f; Tue, 25 Apr 2023 20:58:08 -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 1prTTw-0006bk-OH for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:05 -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 1prTTu-00013T-Vh 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 1prTTu-0001dB-Rg for guix-patches@gnu.org; Tue, 25 Apr 2023 20:58:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63081] [PATCH 6/8] gnu: docbook: Refactor docbook-sgml packages. Resent-From: Bruno Victal Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 26 Apr 2023 00:58:02 +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.16824706656188 (code B ref 63081); Wed, 26 Apr 2023 00:58:02 +0000 Received: (at 63081) by debbugs.gnu.org; 26 Apr 2023 00:57:45 +0000 Received: from localhost ([127.0.0.1]:53842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTc-0001bY-NE for submit@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:45 -0400 Received: from smtpm4.myservices.hosting ([185.26.105.235]:46020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prTTY-0001b4-UC for 63081@debbugs.gnu.org; Tue, 25 Apr 2023 20:57:41 -0400 Received: from mail1.netim.hosting (unknown [185.26.106.173]) by smtpm4.myservices.hosting (Postfix) with ESMTP id D177B214A5; 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 88D76800A0; Wed, 26 Apr 2023 02:57:39 +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 pT9nmvDw1gv0; Wed, 26 Apr 2023 02:57:39 +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 E5CA88009D; Wed, 26 Apr 2023 02:57:38 +0200 (CEST) From: Bruno Victal Date: Wed, 26 Apr 2023 01:56:58 +0100 Message-Id: <26db108569ee144702131e5099081a6ece3978dc.1682470616.git.mirai@makinata.eu> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682473156; a=rsa-sha256; cv=none; b=dg0X7jNzUQNFAJRwX0O8LGJ33TVsbcE6TSI/mgUkzwmrEX1QDAIA4VF19YG7Q5Sjw7/HZY Whr36IwVpdo9jOgOFb9qhXQBJXVfLoMGxPLRiYW9b7gkUDI0w3mBFXGUQvrKd63ylX/Uxv 4umt2cVT21KGm3+Dwy/2Ec0+UibuWIVm2iNtxZ2brb+Uv1FI4z8SVdM19EUHwOGgOKEDlP wNQrW0arI32JJlNjnoofibP/n+TPE2vOLWGjYg3tstl+8vA3p8wk2y4ldYRUXvBE5M6J7/ R1kcIrpgWp7myqjlHe9Qcosx3QJ9Mo+SOvSlaF1G6bAg6Q+Gqh5gk8Wtz2oZJA== 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682473156; 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=U39MFaPTYsq+OjRYm+kcLgwJiwxy/rKMmwv2jKMhcdA=; b=H03QFnbz5w249Gr0IuPjhv+GdJwD5oU2T8ZbdsFL/n1LrUrBN5LdupTlRnrhc7ZA/Zl8kX 8DIAPq/nPNvGHL5ddr/an9ozeHzLD/7RGpAy+I2h4G3xDTtnbB6fbVi/fW0fuGPwHfDH0p 2S3HYhg66vKKvhr9IY+ehlmVHCa2/3xl+QAm/4eD02umltIs/mzNXVyZw6FylxAQ+VdsmV NwWNQBB+2bI+8X6bgNzyZt14Of+ohdjF2GQ9cnjHY5Ao+EU3Kk1PlGPDSavgx0rw8W1WZW GhG7IwCpJ0RHsjGKRRnxetM0PBtAKQtwdIUijWCT5pGTCYXs/8xokDMcwpEBAQ== X-Migadu-Spam-Score: 0.09 X-Spam-Score: 0.09 X-Migadu-Queue-Id: 6995217B56 X-Migadu-Scanner: scn0.migadu.com 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" X-TUID: Rn+ZqPGeCffo * gnu/packages/docbook.scm (docbook-sgml)[build-system]: Switch to copy-build-system. [arguments]: Replace #:builder with #:install-plan. Add phases 'fix-permission and 'patch-iso-entities. [sources]: Use url-fetch/zipbomb. (docbook-sgml-4.1, docbook-sgml-3.1)[sources]: Ditto. (iso-8879-entities)[source]: Ditto. [build-system]: Switch to copy-build-system. [native-inputs]: Restyle. --- gnu/packages/docbook.scm | 70 ++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 38 deletions(-) diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index d4441bacee..cc0a663f68 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm @@ -585,35 +585,39 @@ (define-public docbook-sgml-4.2 (name "docbook-sgml") (version "4.2") (source (origin - (method url-fetch) + (method url-fetch/zipbomb) (uri (string-append "https://www.oasis-open.org/docbook/sgml/4.2/docbook-" version ".zip")) (sha256 (base32 "1hrm4qmmzi285bkxkc74lxvjvw2gbl7ycbaxhv31h9rl9g4x5sv7")))) - (build-system trivial-build-system) + (build-system copy-build-system) (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let ((source (assoc-ref %build-inputs "source")) - (iso-entities-dir (string-append - (assoc-ref %build-inputs "iso-8879-entities"))) - (unzip (string-append (assoc-ref %build-inputs "unzip") - "/bin/unzip")) - (dtd (string-append (assoc-ref %outputs "out") - "/sgml/dtd/docbook"))) - ;; Extract the sources. - (mkdir-p dtd) - (chdir dtd) - (invoke unzip source) - ;; Reference the ISO 8879 character entities. - ;; e.g. "iso-lat1.gml" --> "/ISOlat1" - (substitute* "docbook.cat" - (("\"iso-(.*)\\.gml\"" _ name) - (string-append "\"" iso-entities-dir "/ISO" name "\""))))))) + (list + #:modules '((guix build copy-build-system) + (guix build utils) + (srfi srfi-26)) + #:install-plan + #~`(("./" "sgml/dtd/docbook" + #:exclude-regexp ("catalog\\.xml$" + "ChangeLog$" + "README$" + "\\.txt$"))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-permissions + (lambda _ + (for-each (cut chmod <> #o644) (find-files ".")))) + (add-before 'install 'patch-iso-entities + (lambda* (#:key inputs #:allow-other-keys) + ;; Reference the ISO 8879 character entities. + ;; e.g. "iso-lat1.gml" --> "/ISOlat1" + (let ((iso-entities-dir + (assoc-ref %build-inputs "iso-8879-entities"))) + (substitute* "docbook.cat" + (("\"iso-(.*)\\.gml\"" _ name) + (string-append "\"" iso-entities-dir "/ISO" name "\""))))))))) (native-inputs (list unzip)) (inputs @@ -628,7 +632,7 @@ (define-public docbook-sgml-4.1 (inherit docbook-sgml-4.2) (version "4.1") (source (origin - (method url-fetch) + (method url-fetch/zipbomb) (uri (string-append "https://www.oasis-open.org/docbook/sgml/" version "/docbk41.zip")) (sha256 @@ -642,7 +646,7 @@ (define-public docbook-sgml-3.1 (inherit docbook-sgml) (version "3.1") (source (origin - (method url-fetch) + (method url-fetch/zipbomb) (uri (string-append "https://www.oasis-open.org/docbook/sgml/" version "/docbk31.zip")) (sha256 @@ -655,23 +659,13 @@ (define iso-8879-entities (name "iso-8879-entities") (version "0.0") ;no proper version (source (origin - (method url-fetch) - (uri "http://www.oasis-open.org/cover/ISOEnts.zip") + (method url-fetch/zipbomb) + (uri "https://www.oasis-open.org/cover/ISOEnts.zip") (sha256 (base32 "1clrkaqnvc1ja4lj8blr0rdlphngkcda3snm7b9jzvcn76d3br6w")))) - (build-system trivial-build-system) - (arguments - '(#:modules ((guix build utils)) - #:builder - (begin - (use-modules (guix build utils)) - (let ((source (assoc-ref %build-inputs "source")) - (unzip (string-append (assoc-ref %build-inputs "unzip") - "/bin/unzip")) - (out (string-append (assoc-ref %outputs "out")))) - (invoke unzip source "-d" out))))) - (native-inputs `(("unzip" ,unzip))) + (build-system copy-build-system) + (native-inputs (list unzip)) (home-page "https://www.oasis-open.org/") (synopsis "ISO 8879 character entities") (description "ISO 8879 character entities that are typically used in -- 2.39.2