diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2026-01-26 19:55:13 +0100 |
|---|---|---|
| committer | Andreas Enge <andreas@enge.fr> | 2026-02-07 12:28:44 +0100 |
| commit | dbc017347834914fdff965d24a21b145bbd63a5c (patch) | |
| tree | 1638feba27d1906382fd2c9a2ad7567eae3fbfd9 /gnu/packages/docbook.scm | |
| parent | f815f0796fcc1657d12a10835b67cb80942f6ec3 (diff) | |
gnu: dblatex: Switch to pyproject.
Rationale: This setup.py is clubberred by an old BuildScripts
configuration, which is not compatible with the most recent
setuptools. Patch it to use a modern API for entry points.
* gnu/packages/docbook.scm (dblatex):
[build-system]: Switch to pyproject-build-system.
[arguments]<#:phases>: Add phase 'use-modern-entry-points.
[native-inputs]: Add python-setuptools.
Change-Id: I816635cd9e96b04665231398b307695481def0e8
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Diffstat (limited to 'gnu/packages/docbook.scm')
| -rw-r--r-- | gnu/packages/docbook.scm | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm index 2ad90d380f8..260e4cf10d4 100644 --- a/gnu/packages/docbook.scm +++ b/gnu/packages/docbook.scm | |||
| @@ -37,6 +37,7 @@ | |||
| 37 | #:use-module (gnu packages texinfo) | 37 | #:use-module (gnu packages texinfo) |
| 38 | #:use-module (gnu packages perl) | 38 | #:use-module (gnu packages perl) |
| 39 | #:use-module (gnu packages python) | 39 | #:use-module (gnu packages python) |
| 40 | #:use-module (gnu packages python-build) | ||
| 40 | #:use-module (gnu packages base) | 41 | #:use-module (gnu packages base) |
| 41 | #:use-module (gnu packages web) | 42 | #:use-module (gnu packages web) |
| 42 | #:use-module (gnu packages web-browsers) | 43 | #:use-module (gnu packages web-browsers) |
| @@ -51,6 +52,7 @@ | |||
| 51 | #:use-module (guix git-download) | 52 | #:use-module (guix git-download) |
| 52 | #:use-module (guix build-system copy) | 53 | #:use-module (guix build-system copy) |
| 53 | #:use-module (guix build-system gnu) | 54 | #:use-module (guix build-system gnu) |
| 55 | #:use-module (guix build-system pyproject) | ||
| 54 | #:use-module (guix build-system python) | 56 | #:use-module (guix build-system python) |
| 55 | #:use-module (srfi srfi-26)) | 57 | #:use-module (srfi srfi-26)) |
| 56 | 58 | ||
| @@ -666,21 +668,24 @@ the in DocBook SGML DTDs.") | |||
| 666 | (patches | 668 | (patches |
| 667 | (search-patches "dblatex-inkscape-1.0.patch")))) | 669 | (search-patches "dblatex-inkscape-1.0.patch")))) |
| 668 | (outputs '("out" "doc")) | 670 | (outputs '("out" "doc")) |
| 669 | (build-system python-build-system) | 671 | (build-system pyproject-build-system) |
| 670 | (arguments | 672 | (arguments |
| 671 | (list | 673 | (list |
| 672 | ;; Using setuptools causes an invalid "package_base" path in | ||
| 673 | ;; out/bin/.dblatex-real due to a missing leading '/'. This is caused | ||
| 674 | ;; by dblatex's setup.py stripping the root path when creating the | ||
| 675 | ;; script. (dblatex's setup.py still uses distutils and thus has to | ||
| 676 | ;; create the script by itself. The feature for creating scripts is one | ||
| 677 | ;; of setuptools' features.) | ||
| 678 | ;; See this thread for details: | ||
| 679 | ;; https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00030.html | ||
| 680 | #:use-setuptools? #f | ||
| 681 | #:tests? #f ;no test suite | 674 | #:tests? #f ;no test suite |
| 682 | #:phases | 675 | #:phases |
| 683 | #~(modify-phases %standard-phases | 676 | #~(modify-phases %standard-phases |
| 677 | (add-after 'unpack 'use-modern-entry-points | ||
| 678 | (lambda _ | ||
| 679 | (substitute* "setup.py" | ||
| 680 | (("'build_scripts': BuildScripts,") | ||
| 681 | "") | ||
| 682 | (("scripts=\\['scripts/dblatex'\\],") | ||
| 683 | (format #f "entry_points={'console_scripts':[~s]}," | ||
| 684 | "dblatex = dbtexmf.dblatex.dblatex:main"))) | ||
| 685 | (substitute* "lib/dbtexmf/dblatex/dblatex.py" | ||
| 686 | (("main\\(base=\"\"\\)") | ||
| 687 | (format #f "main(base=~s)" | ||
| 688 | (string-append #$output "/share/dblatex")))))) | ||
| 684 | (add-after 'install 'move-doc | 689 | (add-after 'install 'move-doc |
| 685 | (lambda _ | 690 | (lambda _ |
| 686 | (let ((old (string-append #$output "/share/doc")) | 691 | (let ((old (string-append #$output "/share/doc")) |
| @@ -705,7 +710,7 @@ the in DocBook SGML DTDs.") | |||
| 705 | (unsetenv "GUIX_TEXMF") | 710 | (unsetenv "GUIX_TEXMF") |
| 706 | (invoke/quiet (string-append #$output "/bin/dblatex") | 711 | (invoke/quiet (string-append #$output "/bin/dblatex") |
| 707 | "--quiet" "tests/mathml/mmltest2.xml"))))))) | 712 | "--quiet" "tests/mathml/mmltest2.xml"))))))) |
| 708 | (native-inputs (list docbook-mathml-1.0)) | 713 | (native-inputs (list docbook-mathml-1.0 python-setuptools)) |
| 709 | (inputs | 714 | (inputs |
| 710 | (list bash-minimal | 715 | (list bash-minimal |
| 711 | texlive-bin | 716 | texlive-bin |
