[PATCH] Add doc (including info manual) for cmake

  • Done
  • quality assurance status badge
Details
2 participants
  • Maxim Cournoyer
  • Marius Bakke
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 25 Nov 2018 07:49
Our CMake package has no documentation
(name . bug-guix)(address . bug-guix@gnu.org)
8736rp649l.fsf@apteryx.i-did-not-set--mail-host-address--so-tickle-me
Hello,

Our CMake package lacks any documentation (manpage or other). Patch to
follow.

Maxim
M
M
Maxim Cournoyer wrote on 25 Nov 2018 07:54
(address . 33497@debbugs.gnu.org)
87y39h4pfk.fsf@gmail.com
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (7 lines)
> Hello,
>
> Our CMake package lacks any documentation (manpage or other). Patch to
> follow.
>
> Maxim

Here's the patch to be merged in core-updates (or core-updates-next).
From 07625983cd901c94e4ac25b157035c95e33a115e Mon Sep 17 00:00:00 2001
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Sun, 25 Nov 2018 01:39:54 -0500
Subject: [PATCH] gnu: cmake: Generate the documentation.


* gnu/packages/cmake.scm (gnu): Use the (gnu package python) and
(gnu packages texinfo) modules.
(cmake)[configure]: Add arguments to configure so that manual pages, info and
HTML documentation is generated.
[move-html-doc]: New phase.
[native-inputs]: Add the native inputs required for building the
documentation.
[outputs]: Add a "doc" output.
---
gnu/packages/cmake.scm | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)

Toggle diff (50 lines)
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm
index 5abf08755..36e887c51 100644
--- a/gnu/packages/cmake.scm
+++ b/gnu/packages/cmake.scm
@@ -38,7 +38,9 @@
#:use-module (gnu packages curl)
#:use-module (gnu packages file)
#:use-module (gnu packages libevent)
+ #:use-module (gnu packages python)
#:use-module (gnu packages ncurses)
+ #:use-module (gnu packages texinfo)
#:use-module (gnu packages xml))
(define-public cmake
@@ -136,7 +138,21 @@
"--mandir=share/man"
,(string-append
"--docdir=share/doc/cmake-"
- (version-major+minor version)))))))))
+ (version-major+minor version))
+ "--sphinx-man"
+ "--sphinx-html"
+ "--sphinx-info"))))
+ (add-after 'install 'move-html-doc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (doc (assoc-ref outputs "doc"))
+ (html (string-append "/share/doc/cmake-"
+ ,(version-major+minor version)
+ "/html")))
+ (copy-recursively (string-append out html)
+ (string-append doc html))
+ (delete-file-recursively (string-append out html))
+ #t))))))
(inputs
`(("bzip2" ,bzip2)
("curl" ,curl)
@@ -147,6 +163,10 @@
("ncurses" ,ncurses) ; required for ccmake
("rhash" ,rhash)
("zlib" ,zlib)))
+ (native-inputs
+ `(("python-sphinx" ,python-sphinx)
+ ("texinfo" ,texinfo)))
+ (outputs '("out" "doc"))
(native-search-paths
(list (search-path-specification
(variable "CMAKE_PREFIX_PATH")
--
2.19.0
S
S
SFL laptop wrote on 28 Jan 2019 01:46
control message for bug #33497
(address . control@debbugs.gnu.org)
87zhrlzk0j.fsf@kwak.i-did-not-set--mail-host-address--so-tickle-me
retitle 33497 [PATCH] Add doc (including info manual) for cmake
M
M
Marius Bakke wrote on 12 Feb 2019 21:17
Re: bug#33497: [PATCH] Re: bug#33497: Our CMake package has no documentation
878sykiwwq.fsf@fastmail.com
Hello!

Now would be the time to get this in 'core-updates'.

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (27 lines)
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> Hello,
>>
>> Our CMake package lacks any documentation (manpage or other). Patch to
>> follow.
>>
>> Maxim
>
> Here's the patch to be merged in core-updates (or core-updates-next).
>
> From 07625983cd901c94e4ac25b157035c95e33a115e Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
> Date: Sun, 25 Nov 2018 01:39:54 -0500
> Subject: [PATCH] gnu: cmake: Generate the documentation.
>
> This fixes https://bugs.gnu.org/33497.
>
> * gnu/packages/cmake.scm (gnu): Use the (gnu package python) and
> (gnu packages texinfo) modules.
> (cmake)[configure]: Add arguments to configure so that manual pages, info and
> HTML documentation is generated.
> [move-html-doc]: New phase.
> [native-inputs]: Add the native inputs required for building the
> documentation.
> [outputs]: Add a "doc" output.

I'm not very comfortable with pulling python-sphinx into the dependency
closure of CMake, because then we can't update it or its dependencies
outside of the 'core-updates' cycle. It could also cause circular
dependency issues down the road.

Would it make sense to build the documentation as a separate package?
In that case it can go on the master branch.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlxjKeUACgkQoqBt8qM6
VPoIyAf8Cvro/9lJfa9WLIww+gJI3kXIW6trgxoqPv4pWsJS1TnRf3F1uo/S0cul
aKiFgETk4ANALM4maVccsS71HfFuZpJjG5I/tQTM5CWbQCm7bNTbyM7Gz6Et+HPD
APUxPb7OK22bJobihCNQuqEzPOQugsmCcbRxAfQiuBtCOw/b/7Zfs576fq7F+0iJ
uixTisb0WEnZSmGeJsJma1wJ2Kpb2RDqmxKp/vKrehtiuz6qygqzaC5/WWtiC8PM
UBZ0BfxTb3b31HTryhfYEp+jGLwvoHD8Lv/AAjLwaXfUAttsO9GuYvQ7+AOuIvX0
2cXA9SLlkb7vcI47pLLIrUmwIX8wgQ==
=cQIx
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 12 Mar 2019 02:33
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 33497@debbugs.gnu.org)
87o96glvvm.fsf@gmail.com
Hello Marius!

Sorry for the delay.

Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (41 lines)
> Hello!
>
> Now would be the time to get this in 'core-updates'.
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>>
>>> Hello,
>>>
>>> Our CMake package lacks any documentation (manpage or other). Patch to
>>> follow.
>>>
>>> Maxim
>>
>> Here's the patch to be merged in core-updates (or core-updates-next).
>>
>> From 07625983cd901c94e4ac25b157035c95e33a115e Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>> Date: Sun, 25 Nov 2018 01:39:54 -0500
>> Subject: [PATCH] gnu: cmake: Generate the documentation.
>>
>> This fixes https://bugs.gnu.org/33497.
>>
>> * gnu/packages/cmake.scm (gnu): Use the (gnu package python) and
>> (gnu packages texinfo) modules.
>> (cmake)[configure]: Add arguments to configure so that manual pages, info and
>> HTML documentation is generated.
>> [move-html-doc]: New phase.
>> [native-inputs]: Add the native inputs required for building the
>> documentation.
>> [outputs]: Add a "doc" output.
>
> I'm not very comfortable with pulling python-sphinx into the dependency
> closure of CMake, because then we can't update it or its dependencies
> outside of the 'core-updates' cycle. It could also cause circular
> dependency issues down the road.
>
> Would it make sense to build the documentation as a separate package?
> In that case it can go on the master branch.

I don't like the idea of having a separate package for the documentation
of cmake because it goes against the expectations of Guix users (package
comes with its manpage, and extra doc can be installed as extra output
of the same package).

Maybe we could have a "cmake-minimal" package we'd keep hidden and use
by default as part of the cmake-build-system, which wouldn't include the
doc, and the regular, user facing cmake would be the one in this patch?

Maxim
M
M
Marius Bakke wrote on 17 Mar 2019 17:36
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 33497@debbugs.gnu.org)
874l81a26n.fsf@fastmail.com
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (56 lines)
> Hello Marius!
>
> Sorry for the delay.
>
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Hello!
>>
>> Now would be the time to get this in 'core-updates'.
>>
>> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>>
>>> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>>>
>>>> Hello,
>>>>
>>>> Our CMake package lacks any documentation (manpage or other). Patch to
>>>> follow.
>>>>
>>>> Maxim
>>>
>>> Here's the patch to be merged in core-updates (or core-updates-next).
>>>
>>> From 07625983cd901c94e4ac25b157035c95e33a115e Mon Sep 17 00:00:00 2001
>>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>>> Date: Sun, 25 Nov 2018 01:39:54 -0500
>>> Subject: [PATCH] gnu: cmake: Generate the documentation.
>>>
>>> This fixes https://bugs.gnu.org/33497.
>>>
>>> * gnu/packages/cmake.scm (gnu): Use the (gnu package python) and
>>> (gnu packages texinfo) modules.
>>> (cmake)[configure]: Add arguments to configure so that manual pages, info and
>>> HTML documentation is generated.
>>> [move-html-doc]: New phase.
>>> [native-inputs]: Add the native inputs required for building the
>>> documentation.
>>> [outputs]: Add a "doc" output.
>>
>> I'm not very comfortable with pulling python-sphinx into the dependency
>> closure of CMake, because then we can't update it or its dependencies
>> outside of the 'core-updates' cycle. It could also cause circular
>> dependency issues down the road.
>>
>> Would it make sense to build the documentation as a separate package?
>> In that case it can go on the master branch.
>
> I don't like the idea of having a separate package for the documentation
> of cmake because it goes against the expectations of Guix users (package
> comes with its manpage, and extra doc can be installed as extra output
> of the same package).
>
> Maybe we could have a "cmake-minimal" package we'd keep hidden and use
> by default as part of the cmake-build-system, which wouldn't include the
> doc, and the regular, user facing cmake would be the one in this patch?

This sounds reasonable to me. Can you send a patch? :-)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlyOd3AACgkQoqBt8qM6
VPpzJAf/U3fobW6njfZG6CHx0lpNJqXlVLXH3UW/dojf8tAlLLKIMo1zB2cRRm1M
kNarL9CljeQ4SXgVXwbnI9wepn4EDgTem//VNXWopyo88x5Q39B0aBtfxP5zkc01
SKcukakEiOv3zjd3+xrDmQ6vPQ2yR2jT1y2ymLGdjXLnLkvw9BeZ/9aDZxfhuJC6
ucmFqs41klJVfLJsxhIvB5wDSnvPRX3vhydPVbdc3hM8sgrRgSBt06mnAOF7tynz
rToeN/C6w/tfcZf5DlUK2vtBZLBdrXlEp26fn78q0oKqfZJz6YnlrtJTlbLB+KW2
qPGLVoBq72InUrkGJmnp/qDkoPcyXQ==
=rh9B
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 20 Mar 2019 17:06
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 33497@debbugs.gnu.org)
875zsd7coj.fsf@gmail.com
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (2 lines)
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

[...]

Toggle quote (19 lines)
>>> I'm not very comfortable with pulling python-sphinx into the dependency
>>> closure of CMake, because then we can't update it or its dependencies
>>> outside of the 'core-updates' cycle. It could also cause circular
>>> dependency issues down the road.
>>>
>>> Would it make sense to build the documentation as a separate package?
>>> In that case it can go on the master branch.
>>
>> I don't like the idea of having a separate package for the documentation
>> of cmake because it goes against the expectations of Guix users (package
>> comes with its manpage, and extra doc can be installed as extra output
>> of the same package).
>>
>> Maybe we could have a "cmake-minimal" package we'd keep hidden and use
>> by default as part of the cmake-build-system, which wouldn't include the
>> doc, and the regular, user facing cmake would be the one in this patch?
>
> This sounds reasonable to me. Can you send a patch? :-)

Here it comes, attached! Thanks to Ricardo on #guix for helping me
resolve a quoting issue :-).

To validate it works, I had to disable some failing test suites, using:
Toggle diff (64 lines)
diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm
index f47f7623b4..259ea23a67 100644
--- a/gnu/packages/libffi.scm
+++ b/gnu/packages/libffi.scm
@@ -106,26 +106,26 @@ conversions for values passed between the two languages.")
(guix build python-build-system))
#:phases
(modify-phases %standard-phases
- (replace 'check
- (lambda _
- (setenv "PYTHONPATH"
- (string-append
- (getenv "PYTHONPATH")
- ":" (getcwd) "/build/"
- (car (scandir "build" (cut string-prefix? "lib." <>)))))
+ ;; (replace 'check
+ ;; (lambda _
+ ;; (setenv "PYTHONPATH"
+ ;; (string-append
+ ;; (getenv "PYTHONPATH")
+ ;; ":" (getcwd) "/build/"
+ ;; (car (scandir "build" (cut string-prefix? "lib." <>)))))
- ;; XXX The "normal" approach of setting CC and friends does
- ;; not work here. Is this the correct way of doing things?
- (substitute* "testing/embedding/test_basic.py"
- (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
- (string-append "c = distutils.ccompiler.new_compiler();"
- "c.set_executables(compiler='gcc',"
- "compiler_so='gcc',linker_exe='gcc',"
- "linker_so='gcc -shared')")))
- (substitute* "testing/cffi0/test_ownlib.py"
- (("'cc testownlib") "'gcc testownlib"))
- (invoke "py.test" "-v" "c/" "testing/")
- #t))
+ ;; ;; XXX The "normal" approach of setting CC and friends does
+ ;; ;; not work here. Is this the correct way of doing things?
+ ;; (substitute* "testing/embedding/test_basic.py"
+ ;; (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
+ ;; (string-append "c = distutils.ccompiler.new_compiler();"
+ ;; "c.set_executables(compiler='gcc',"
+ ;; "compiler_so='gcc',linker_exe='gcc',"
+ ;; "linker_so='gcc -shared')")))
+ ;; (substitute* "testing/cffi0/test_ownlib.py"
+ ;; (("'cc testownlib") "'gcc testownlib"))
+ ;; (invoke "py.test" "-v" "c/" "testing/")
+ ;; #t))
(add-before 'check 'disable-failing-test
;; This is assumed to be a libffi issue:
;; https://bitbucket.org/cffi/cffi/issues/312/tests-failed-with-armv8
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 0a483fb1db..67de01573e 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -127,7 +127,8 @@
"tk")) ;tkinter; adds 50 MiB to the closure
(build-system gnu-build-system)
(arguments
- `(#:test-target "test"
+ `(#:tests? #f
+ #:test-target "test"
#:configure-flags
(list "--enable-shared" ;allow embedding
"--with-system-ffi" ;build ctypes
Thanks!

Maxim
M
M
Maxim Cournoyer wrote on 21 Mar 2019 03:08
Re: bug#33497: [PATCHv2] Re: bug#33497: Our CMake package has no documentation
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 33497@debbugs.gnu.org)
87va0d568n.fsf_-_@gmail.com
Here's an improved version, following some comments of Marius on #guix.
Maxim
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEJ9WGpPiQCFQyn/CfEmDkZILmNWIFAlyS8igACgkQEmDkZILm
NWIEYQ/+Jf2hwHsPwgPmpAxd09jqdNTrnG8dtlbEzdKA+ObJh6nxdkHObgSvCnjl
oV7Sq4DJ0YFMQ5QcSwCoL/v/auMGKEE6CtOdxZn9ighVbbW3bnynJBddM9LsZxLR
GfaiswavIJ0NDCLkdCWcdznvDmAHN4QjcmlDj7sV8yuFk6j7BffTuoEpp/tKlhoL
vBtXb3Z+yWzrWidtgEqq2cJXCmb5cdL9wLidqhwd1mjdRHR6dQCSg7NUBN3MhyhF
slDBojl6Cmxajkd8yuRmDJLfBDyRSza9ZLMyd/yMq384qFZaMuodNValu9jc7lzH
0L53MSyF9IHoPR3eCE/o1ibL/xZaa95+lD7EAr3reON94yITL/b0Ih/AI3JyhTKL
NtEbZgFGsnIQ73qdIMbCtIpn3Jt0HggrXDc2REadAQ7gywlLsjWiTwzuyNwGDoNx
Cj5/UNj3MstkJQlo1pl49geooG5IeuCTVvknzohyD5f7lefXMDfLuO0haPSrQ8vD
C47drQt9Oz+aK06PlDC/M3XPEHWc7xU5cXh8tvikIR1kq9hvoP10QPXe1uA64Wp/
mEFO5HzkhS2Dyn7Jwc4bL/00aBfWu0QfTDN1ZuWY9Fn6RVDqlNO5BWsq8ZWTX6RX
EUbCh1tTIPwr81lTanjxpQHzk/r5N4ZY+q3TF0gTUI+IhTkSrvA=
=9Yzm
-----END PGP SIGNATURE-----

M
M
Marius Bakke wrote on 21 Mar 2019 19:40
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 33497@debbugs.gnu.org)
87bm24840g.fsf@fastmail.com
Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

Toggle quote (28 lines)
> Here's an improved version, following some comments of Marius on #guix.
>
> From 2f33a7321e5e37d37f57c229c8079cb4ffd10834 Mon Sep 17 00:00:00 2001
> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
> Date: Wed, 20 Mar 2019 21:38:19 -0400
> Subject: [PATCH] cmake: Generate documentation.
>
> To prevent complicating the dependencies of a core tool, a new variant,
> CMAKE-MINIMAL is introduced and the CMake build system is configured to use it
> by default. The regular CMAKE package gains a manpage, info manual as well
> as HTML documentation.
>
> Fixes issue #33497 (https://bugs.gnu.org/33497).
>
> * gnu/packages/cmake.scm (gnu): Use modules (gnu packages python-xyz),
> (gnu packages texinfo) and (srfi srfi-1).
> (cmake-minimal): Rename the original cmake variable to this.
> [phases]{configure}: Extract the configure script arguments to...
> [configure-flags]: here.
> [properties]: Set the HIDDEN? property to #t.
> (cmake): New variable, which inherits from CMAKE-MINIMAL.
> [phases]{move-html-doc}: Add phase.
> [native-inputs]: Add PYTHON-SPHINX and TEXINFO.
> [outputs]: Add the "doc" output.
> [properties]: Clear the inherited HIDDEN? property.
> * guix/build-system/cmake.scm (default-cmake): Use CMAKE-MINIMAL instead of
> CMAKE.

Thanks! LGTM.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlyT2rAACgkQoqBt8qM6
VPp5+QgA0M9PEV2mbTkP0WM2tMWaaps0GlUBGV6HnkiveJWFvGSZPUqJwShk0XsS
AXPRWJei2cA44g74yHd2MA5zA3kEWdCq1j0IpYZhy8Xm9I2FvH3yc/tKz+0cwIuS
zQ2LYpA4tU3OkaKDvwAKGRnxhjGvVx78DE3cj56Ki8XNRzBNZ1yzjdeb7FbP1yS0
QIDUGCXLN/2D8hygf6HjYlQbp3xvOQlZMM25SJMrbFs7ezNiCH1ZRjyWdr9hXuDy
JtAYlNuiylOxGU3O3L5uaX8QbSQFVonKuZ3W20j/GjgNtmBRZ5ufUkqJDE1/R2+b
VRjSYWw37JsqTQj3vSRyp22QoYIsvQ==
=NIVQ
-----END PGP SIGNATURE-----

M
M
Maxim Cournoyer wrote on 22 Mar 2019 03:19
(name . Marius Bakke)(address . mbakke@fastmail.com)(address . 33497-done@debbugs.gnu.org)
8736nfps5q.fsf@gmail.com
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (32 lines)
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> Here's an improved version, following some comments of Marius on #guix.
>>
>> From 2f33a7321e5e37d37f57c229c8079cb4ffd10834 Mon Sep 17 00:00:00 2001
>> From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
>> Date: Wed, 20 Mar 2019 21:38:19 -0400
>> Subject: [PATCH] cmake: Generate documentation.
>>
>> To prevent complicating the dependencies of a core tool, a new variant,
>> CMAKE-MINIMAL is introduced and the CMake build system is configured to use it
>> by default. The regular CMAKE package gains a manpage, info manual as well
>> as HTML documentation.
>>
>> Fixes issue #33497 (https://bugs.gnu.org/33497).
>>
>> * gnu/packages/cmake.scm (gnu): Use modules (gnu packages python-xyz),
>> (gnu packages texinfo) and (srfi srfi-1).
>> (cmake-minimal): Rename the original cmake variable to this.
>> [phases]{configure}: Extract the configure script arguments to...
>> [configure-flags]: here.
>> [properties]: Set the HIDDEN? property to #t.
>> (cmake): New variable, which inherits from CMAKE-MINIMAL.
>> [phases]{move-html-doc}: Add phase.
>> [native-inputs]: Add PYTHON-SPHINX and TEXINFO.
>> [outputs]: Add the "doc" output.
>> [properties]: Clear the inherited HIDDEN? property.
>> * guix/build-system/cmake.scm (default-cmake): Use CMAKE-MINIMAL instead of
>> CMAKE.
>
> Thanks! LGTM.

Pushed to core-updates with commit 2f33a7321e. Thank you!

Maxim
Closed
?