From 2909294342ee9c9cdacfbc75ab852c54f34c7bb9 Mon Sep 17 00:00:00 2001 From: ng0 Date: Thu, 24 Aug 2017 09:43:56 +0000 Subject: [PATCH] doc: This should add the ability to explicitly only build the documentation. --- .../guix/packages/gnunet/packages/gnunet.scm | 48 +++++++++++++++++++ doc/Makefile.am | 15 ++++++ 2 files changed, 63 insertions(+) diff --git a/contrib/packages/guix/packages/gnunet/packages/gnunet.scm b/contrib/packages/guix/packages/gnunet/packages/gnunet.scm index 574714350..71d5a8b46 100644 --- a/contrib/packages/guix/packages/gnunet/packages/gnunet.scm +++ b/contrib/packages/guix/packages/gnunet/packages/gnunet.scm @@ -159,6 +159,54 @@ ;; ;; XXX: HOW??? ulimit -c unlimited ;; (zero? (system* "make" "check")))))))) +(define-public gnunet-doc + (package + (name "gnunet-doc") + (version (package-version gnunetg)) + (source (package-source gnunetg)) + (build-system gnu-build-system) + (native-inputs + `(("pkg-config" ,pkg-config) + ("autoconf" ,autoconf) + ("automake" ,automake) + ("gnu-gettext" ,gnu-gettext) + ("texinfo" ,texinfo) + ("libtool" ,libtool))) + (arguments + `(#:tests? #f ;Don't run tests + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'patch-bin-sh + (lambda _ + (substitute* "bootstrap" + (("contrib/pogen.sh") "sh contrib/pogen.sh")) + (for-each (lambda (f) (chmod f #o755)) + (find-files "po" "")) + #t)) + (add-after 'patch-bin-sh 'bootstrap + (lambda _ + (zero? (system* "sh" "bootstrap")))) + (replace 'build + (lambda _ + (chdir "doc") + (zero? (system* "make" "doc-all")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (doc (string-append out "/share/doc/gnunet"))) + (mkdir-p doc) + (install-file "gnunet.pdf" doc) + (install-file "gnunet.info" doc) + (copy-file-recursively "gnunet.html" + (string-append doc + "/html"))) + #t))))) + (synopsis "GNUnet documentation") + (description + "Gnunet-doc builds the documentation of GNUnet.") + (home-page "https://gnunet.org") + (license (package-license gnunet)))) + (define-public gnunetgpg (package (inherit gnunetg) diff --git a/doc/Makefile.am b/doc/Makefile.am index e130ccc0e..508326781 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -49,3 +49,18 @@ gnunet_TEXINFOS = \ EXTRA_DIST = \ $(gnunet_TEXINFOS) \ $(gnunet_doc_images) + +doc-pdf: + @makeinfo --pdf --quiet gnunet.texi + +doc-html: + @makeinfo --html gnunet.texi + +doc-info: + @makeinfo --no-split gnunet.texi + +# FIXME: rm *.html and *.pdf +doc-clean: + @rm *.aux *.log *.toc *.cp *.cps + +doc-all: doc-pdf doc-html doc-info -- 2.25.1