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 @@ #:use-module (gnu packages texinfo) #:use-module (gnu packages perl) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages base) #:use-module (gnu packages web) #:use-module (gnu packages web-browsers) @@ -51,6 +52,7 @@ #:use-module (guix git-download) #:use-module (guix build-system copy) #:use-module (guix build-system gnu) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (srfi srfi-26)) @@ -666,21 +668,24 @@ the in DocBook SGML DTDs.") (patches (search-patches "dblatex-inkscape-1.0.patch")))) (outputs '("out" "doc")) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list - ;; Using setuptools causes an invalid "package_base" path in - ;; out/bin/.dblatex-real due to a missing leading '/'. This is caused - ;; by dblatex's setup.py stripping the root path when creating the - ;; script. (dblatex's setup.py still uses distutils and thus has to - ;; create the script by itself. The feature for creating scripts is one - ;; of setuptools' features.) - ;; See this thread for details: - ;; https://lists.gnu.org/archive/html/guix-devel/2016-12/msg00030.html - #:use-setuptools? #f #:tests? #f ;no test suite #:phases #~(modify-phases %standard-phases + (add-after 'unpack 'use-modern-entry-points + (lambda _ + (substitute* "setup.py" + (("'build_scripts': BuildScripts,") + "") + (("scripts=\\['scripts/dblatex'\\],") + (format #f "entry_points={'console_scripts':[~s]}," + "dblatex = dbtexmf.dblatex.dblatex:main"))) + (substitute* "lib/dbtexmf/dblatex/dblatex.py" + (("main\\(base=\"\"\\)") + (format #f "main(base=~s)" + (string-append #$output "/share/dblatex")))))) (add-after 'install 'move-doc (lambda _ (let ((old (string-append #$output "/share/doc")) @@ -705,7 +710,7 @@ the in DocBook SGML DTDs.") (unsetenv "GUIX_TEXMF") (invoke/quiet (string-append #$output "/bin/dblatex") "--quiet" "tests/mathml/mmltest2.xml"))))))) - (native-inputs (list docbook-mathml-1.0)) + (native-inputs (list docbook-mathml-1.0 python-setuptools)) (inputs (list bash-minimal texlive-bin |
