summaryrefslogtreecommitdiff
path: root/gnu/packages/python-xyz.scm
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-03-09 14:16:54 -0500
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-03-09 15:23:36 -0500
commitebd2093b32942756fa376833786e0cc70fc9765f (patch)
treecb47e7dd5cb29d4a3f7f3e74de47e0a7f96a3dd5 /gnu/packages/python-xyz.scm
parent09aa025b44c099e669bcda3c38344b270fd7982b (diff)
downloadguix-patches-ebd2093b32942756fa376833786e0cc70fc9765f.tar
guix-patches-ebd2093b32942756fa376833786e0cc70fc9765f.tar.gz
gnu: python-robotframework: Fully build the documentation.
* gnu/packages/patches/python-robotframework-ug2html.patch: New patch. * gnu/local.mk: Register it. * gnu/packages/python-xyz.scm (python-robotframework): Apply patch. [modules]: New argument. [phases]{build-and-install-doc}: Modify to build the full HTML documentation, including the user guide. [native-inputs]: Add python-pygments.
Diffstat (limited to 'gnu/packages/python-xyz.scm')
-rw-r--r--gnu/packages/python-xyz.scm63
1 files changed, 38 insertions, 25 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 860ea35959..1387f1f260 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4689,37 +4689,50 @@ ecosystem, but can naturally be used also by other projects.")
(sha256
(base32 "0j71awmfkwk7prz82kr1zbcl3nrih3396sshrygnqlrdjmgivd3p"))
(patches (search-patches
- "python-robotframework-source-date-epoch.patch"))))
+ "python-robotframework-source-date-epoch.patch"
+ "python-robotframework-ug2html.patch"))))
(build-system python-build-system)
(arguments
- `(#:phases (modify-phases %standard-phases
- (add-before 'build 'build-and-install-doc
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((doc-output (assoc-ref outputs "doc"))
- (doc (string-append doc-output "/share/"
- ,name "-" ,version "/")))
- (invoke "invoke" "library-docs" "all")
- (mkdir-p doc)
- (copy-recursively "doc/libraries"
- (string-append doc "/libraries")))))
- (replace 'check
- (lambda* (#:key native-inputs inputs tests?
- #:allow-other-keys)
- (when tests?
- ;; Some tests require timezone data. Otherwise, they
- ;; look up /etc/localtime, which doesn't exist, and
- ;; fail with:
- ;;
- ;; OverflowError: mktime argument out of range
- (setenv "TZDIR"
- (search-input-directory
- (or native-inputs inputs) "share/zoneinfo"))
- (setenv "TZ" "Europe/Paris")
- (invoke "python" "utest/run.py")))))))
+ `(#:modules ((guix build python-build-system)
+ (guix build utils)
+ (ice-9 ftw)
+ (ice-9 match)
+ (srfi srfi-26))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'build-and-install-doc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((doc (string-append (assoc-ref outputs "doc")
+ "/share/doc/robotframework")))
+ (invoke "invoke" "library-docs" "all")
+ (invoke "doc/userguide/ug2html.py" "dist") ;user guide
+ (mkdir-p doc)
+ (with-directory-excursion "dist"
+ (define user-guide-dir
+ (match (scandir "." (cut string-prefix?
+ "robotframework-userguide-" <>))
+ ((dir) dir)
+ (_ (error "could not find the user guide directory"))))
+ (copy-recursively user-guide-dir doc)))))
+ (replace 'check
+ (lambda* (#:key native-inputs inputs tests?
+ #:allow-other-keys)
+ (when tests?
+ ;; Some tests require timezone data. Otherwise, they
+ ;; look up /etc/localtime, which doesn't exist, and
+ ;; fail with:
+ ;;
+ ;; OverflowError: mktime argument out of range
+ (setenv "TZDIR"
+ (search-input-directory
+ (or native-inputs inputs) "share/zoneinfo"))
+ (setenv "TZ" "Europe/Paris")
+ (invoke "python" "utest/run.py")))))))
(native-inputs
`(("python-docutils" ,python-docutils)
("python-jsonschema" ,python-jsonschema)
("python-invoke" ,python-invoke)
+ ("python-pygments" ,python-pygments)
("python-rellu" ,python-rellu)
("python:tk" ,python "tk") ;used when building the HTML doc
("tzdata" ,tzdata-for-tests)))