diff options
| author | Bruno Victal <mirai@makinata.eu> | 2023-04-26 01:56:58 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-08-31 10:42:04 +0200 |
| commit | 69eea259df7d03977c4c010cc91372a70f07879a (patch) | |
| tree | a6bf09ea9807726440a31f4e59cc993327745132 /gnu/packages/docbook.scm | |
| parent | 8f7b7f285be7748e729be4ae615430afa3bd8676 (diff) | |
gnu: docbook: Refactor docbook-sgml packages.
* 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.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/packages/docbook.scm')
| -rw-r--r-- | gnu/packages/docbook.scm | 70 |
1 files changed, 32 insertions, 38 deletions
diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index 49e53a1d14e..eb4d40e8882 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm | |||
| @@ -500,35 +500,39 @@ for DocBook.") | |||
| 500 | (name "docbook-sgml") | 500 | (name "docbook-sgml") |
| 501 | (version "4.2") | 501 | (version "4.2") |
| 502 | (source (origin | 502 | (source (origin |
| 503 | (method url-fetch) | 503 | (method url-fetch/zipbomb) |
| 504 | (uri (string-append | 504 | (uri (string-append |
| 505 | "https://www.oasis-open.org/docbook/sgml/4.2/docbook-" | 505 | "https://www.oasis-open.org/docbook/sgml/4.2/docbook-" |
| 506 | version ".zip")) | 506 | version ".zip")) |
| 507 | (sha256 | 507 | (sha256 |
| 508 | (base32 | 508 | (base32 |
| 509 | "1hrm4qmmzi285bkxkc74lxvjvw2gbl7ycbaxhv31h9rl9g4x5sv7")))) | 509 | "1hrm4qmmzi285bkxkc74lxvjvw2gbl7ycbaxhv31h9rl9g4x5sv7")))) |
| 510 | (build-system trivial-build-system) | 510 | (build-system copy-build-system) |
| 511 | (arguments | 511 | (arguments |
| 512 | '(#:modules ((guix build utils)) | 512 | (list |
| 513 | #:builder | 513 | #:modules '((guix build copy-build-system) |
| 514 | (begin | 514 | (guix build utils) |
| 515 | (use-modules (guix build utils)) | 515 | (srfi srfi-26)) |
| 516 | (let ((source (assoc-ref %build-inputs "source")) | 516 | #:install-plan |
| 517 | (iso-entities-dir (string-append | 517 | #~`(("./" "sgml/dtd/docbook" |
| 518 | (assoc-ref %build-inputs "iso-8879-entities"))) | 518 | #:exclude-regexp ("catalog\\.xml$" |
| 519 | (unzip (string-append (assoc-ref %build-inputs "unzip") | 519 | "ChangeLog$" |
| 520 | "/bin/unzip")) | 520 | "README$" |
| 521 | (dtd (string-append (assoc-ref %outputs "out") | 521 | "\\.txt$"))) |
| 522 | "/sgml/dtd/docbook"))) | 522 | #:phases |
| 523 | ;; Extract the sources. | 523 | #~(modify-phases %standard-phases |
| 524 | (mkdir-p dtd) | 524 | (add-after 'unpack 'fix-permissions |
| 525 | (chdir dtd) | 525 | (lambda _ |
| 526 | (invoke unzip source) | 526 | (for-each (cut chmod <> #o644) (find-files ".")))) |
| 527 | ;; Reference the ISO 8879 character entities. | 527 | (add-before 'install 'patch-iso-entities |
| 528 | ;; e.g. "iso-lat1.gml" --> "<iso-entities-dir>/ISOlat1" | 528 | (lambda* (#:key inputs #:allow-other-keys) |
| 529 | (substitute* "docbook.cat" | 529 | ;; Reference the ISO 8879 character entities. |
| 530 | (("\"iso-(.*)\\.gml\"" _ name) | 530 | ;; e.g. "iso-lat1.gml" --> "<iso-entities-dir>/ISOlat1" |
| 531 | (string-append "\"" iso-entities-dir "/ISO" name "\""))))))) | 531 | (let ((iso-entities-dir |
| 532 | (assoc-ref %build-inputs "iso-8879-entities"))) | ||
| 533 | (substitute* "docbook.cat" | ||
| 534 | (("\"iso-(.*)\\.gml\"" _ name) | ||
| 535 | (string-append "\"" iso-entities-dir "/ISO" name "\""))))))))) | ||
| 532 | (native-inputs | 536 | (native-inputs |
| 533 | (list unzip)) | 537 | (list unzip)) |
| 534 | (inputs | 538 | (inputs |
| @@ -543,7 +547,7 @@ for DocBook.") | |||
| 543 | (inherit docbook-sgml-4.2) | 547 | (inherit docbook-sgml-4.2) |
| 544 | (version "4.1") | 548 | (version "4.1") |
| 545 | (source (origin | 549 | (source (origin |
| 546 | (method url-fetch) | 550 | (method url-fetch/zipbomb) |
| 547 | (uri (string-append "https://www.oasis-open.org/docbook/sgml/" | 551 | (uri (string-append "https://www.oasis-open.org/docbook/sgml/" |
| 548 | version "/docbk41.zip")) | 552 | version "/docbk41.zip")) |
| 549 | (sha256 | 553 | (sha256 |
| @@ -557,7 +561,7 @@ for DocBook.") | |||
| 557 | (inherit docbook-sgml) | 561 | (inherit docbook-sgml) |
| 558 | (version "3.1") | 562 | (version "3.1") |
| 559 | (source (origin | 563 | (source (origin |
| 560 | (method url-fetch) | 564 | (method url-fetch/zipbomb) |
| 561 | (uri (string-append "https://www.oasis-open.org/docbook/sgml/" | 565 | (uri (string-append "https://www.oasis-open.org/docbook/sgml/" |
| 562 | version "/docbk31.zip")) | 566 | version "/docbk31.zip")) |
| 563 | (sha256 | 567 | (sha256 |
| @@ -570,23 +574,13 @@ for DocBook.") | |||
| 570 | (name "iso-8879-entities") | 574 | (name "iso-8879-entities") |
| 571 | (version "0.0") ;no proper version | 575 | (version "0.0") ;no proper version |
| 572 | (source (origin | 576 | (source (origin |
| 573 | (method url-fetch) | 577 | (method url-fetch/zipbomb) |
| 574 | (uri "http://www.oasis-open.org/cover/ISOEnts.zip") | 578 | (uri "https://www.oasis-open.org/cover/ISOEnts.zip") |
| 575 | (sha256 | 579 | (sha256 |
| 576 | (base32 | 580 | (base32 |
| 577 | "1clrkaqnvc1ja4lj8blr0rdlphngkcda3snm7b9jzvcn76d3br6w")))) | 581 | "1clrkaqnvc1ja4lj8blr0rdlphngkcda3snm7b9jzvcn76d3br6w")))) |
| 578 | (build-system trivial-build-system) | 582 | (build-system copy-build-system) |
| 579 | (arguments | 583 | (native-inputs (list unzip)) |
| 580 | '(#:modules ((guix build utils)) | ||
| 581 | #:builder | ||
| 582 | (begin | ||
| 583 | (use-modules (guix build utils)) | ||
| 584 | (let ((source (assoc-ref %build-inputs "source")) | ||
| 585 | (unzip (string-append (assoc-ref %build-inputs "unzip") | ||
| 586 | "/bin/unzip")) | ||
| 587 | (out (string-append (assoc-ref %outputs "out")))) | ||
| 588 | (invoke unzip source "-d" out))))) | ||
| 589 | (native-inputs `(("unzip" ,unzip))) | ||
| 590 | (home-page "https://www.oasis-open.org/") | 584 | (home-page "https://www.oasis-open.org/") |
| 591 | (synopsis "ISO 8879 character entities") | 585 | (synopsis "ISO 8879 character entities") |
| 592 | (description "ISO 8879 character entities that are typically used in | 586 | (description "ISO 8879 character entities that are typically used in |
