@@ -40,6 +40,8 @@ (define-module (gnu packages ghostscript)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages sphinx)
#:use-module (gnu packages tcl)
#:use-module (gnu packages xorg)
#:use-module ((guix licenses) #:prefix license:)
@@ -49,6 +51,7 @@ (define-module (gnu packages ghostscript)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system trivial)
#:use-module (srfi srfi-1))
(define-public lcms
@@ -417,6 +420,39 @@ (define-public ghostscript
;; inclusion in Postscript and PDF files.
(license:non-copyleft "file://LICENSE")))))
+;; Put the documentation in a separate package due to a circular dependency of
+;; ghostscript with python-sphinx.
+(define-public ghostscript-documentation
+ (package
+ (inherit ghostscript)
+ (name (string-append (package-name ghostscript) "-documentation"))
+ (native-inputs
+ (list
+ python
+ python-pymupdf
+ python-rst2pdf
+ python-sphinx
+ python-sphinx-copybutton
+ python-sphinx-rtd-theme))
+ (inputs '())
+ (arguments
+ (list
+ #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'bootstrap)
+ (delete 'configure)
+ (replace 'build
+ (lambda _
+ (chdir "doc")
+ (invoke "sphinx-build" "-b" "html" "src" "build")))
+ (replace 'install
+ (lambda _
+ (copy-recursively
+ "build" (string-append #$output "/share/doc/ghostscript/"
+ #$(package-version this-package))))))))
+ (license license:agpl3+)))
+
(define-public ghostscript/x
(package/inherit ghostscript
(name (string-append (package-name ghostscript) "-with-x"))