[pacman-dev] [PATCH 1/2] meson: fix website target
A number of pages don't actually exist as html inside the source tree, and need to be generated even though they are manpages. This caused the website.tar.gz target to only work inside a dirty tree initially created by autotools. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- doc/meson.build | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index 7c9631cb..4d796492 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -14,6 +14,13 @@ manpages = [ { 'name': 'BUILDINFO.5' }, ] +sitepages = [ + { 'name': 'submitting-patches' }, + { 'name': 'translation-help' }, + { 'name': 'HACKING', 'source': join_paths(meson.current_source_dir(), '../HACKING') }, + { 'name': 'index' }, +] + asciidoc_conf = join_paths(meson.current_source_dir(), 'asciidoc.conf') asciidoc_opts = [ @@ -58,6 +65,12 @@ foreach page : manpages install : true, install_dir : mandirn, ) +endforeach + +foreach page: manpages + sitepages + manpage = page['name'] + htmlpage = '@0@.html'.format(manpage) + input = page.get('source', '@0@.asciidoc'.format(manpage)) html = custom_target( htmlpage, @@ -85,6 +98,8 @@ foreach page : manpages html_files += [htmlpage] endforeach + + run_target('html', command : ['/bin/true'], depends : html_targets) @@ -96,10 +111,6 @@ custom_target( '-C', meson.current_build_dir(), ] + html_files + [ '-C', meson.current_source_dir(), - 'submitting-patches.html', - 'translation-help.html', - 'HACKING.html', - 'index.html', 'asciidoc-override.css', '-C', '/etc/asciidoc/stylesheets/', 'asciidoc.css', -- 2.20.1
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- doc/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/meson.build b/doc/meson.build index 4d796492..5a1a1dc5 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -104,7 +104,7 @@ run_target('html', command : ['/bin/true'], depends : html_targets) -custom_target( +website_tar_gz = custom_target( 'website.tar.gz', command : [ 'bsdtar', 'czf', '@OUTPUT@', @@ -124,6 +124,10 @@ custom_target( depends : html_targets, ) +run_target('website', + command : ['/bin/true'], + depends : website_tar_gz) + meson.add_install_script(MESON_MAKE_SYMLINK, 'repo-add.8', join_paths(MANDIR, 'man8/repo-remove.8')) -- 2.20.1
On Sat, Jan 12, 2019 at 09:15:01PM -0500, Eli Schwartz wrote:
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
This is really just an alias, right? To match what autotools does? Does anyone actually care about this? Might it be better to just rename the existing target to 'website' instead?
doc/meson.build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/doc/meson.build b/doc/meson.build index 4d796492..5a1a1dc5 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -104,7 +104,7 @@ run_target('html', command : ['/bin/true'], depends : html_targets)
-custom_target( +website_tar_gz = custom_target( 'website.tar.gz', command : [ 'bsdtar', 'czf', '@OUTPUT@', @@ -124,6 +124,10 @@ custom_target( depends : html_targets, )
+run_target('website', + command : ['/bin/true'], + depends : website_tar_gz) +
meson.add_install_script(MESON_MAKE_SYMLINK, 'repo-add.8', join_paths(MANDIR, 'man8/repo-remove.8')) -- 2.20.1
On 13/1/19 11:17 pm, Dave Reisner wrote:
On Sat, Jan 12, 2019 at 09:15:01PM -0500, Eli Schwartz wrote:
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
This is really just an alias, right? To match what autotools does? Does anyone actually care about this? Might it be better to just rename the existing target to 'website' instead?
That seems the least redundant approach. A
On 1/13/19 10:18 PM, Allan McRae wrote:
On 13/1/19 11:17 pm, Dave Reisner wrote:
On Sat, Jan 12, 2019 at 09:15:01PM -0500, Eli Schwartz wrote:
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
This is really just an alias, right? To match what autotools does? Does anyone actually care about this? Might it be better to just rename the existing target to 'website' instead?
That seems the least redundant approach.
The existing target is specifically a file target, it's a command to create output. It only exists as: ninja doc/website.tar.gz The website target is a toplevel pseudo-target, you can run it directly from the build tree and it will depend on the tarball being up to date rather than always rerunning bsdtar. I don't like the idea of turning the whole thing into one always-rebuilding pseudo-target. -- Eli Schwartz Bug Wrangler and Trusted User
On Sun, Jan 13, 2019 at 10:38:30PM -0500, Eli Schwartz wrote:
On 1/13/19 10:18 PM, Allan McRae wrote:
On 13/1/19 11:17 pm, Dave Reisner wrote:
On Sat, Jan 12, 2019 at 09:15:01PM -0500, Eli Schwartz wrote:
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
This is really just an alias, right? To match what autotools does? Does anyone actually care about this? Might it be better to just rename the existing target to 'website' instead?
That seems the least redundant approach.
The existing target is specifically a file target, it's a command to create output. It only exists as:
ninja doc/website.tar.gz
The website target is a toplevel pseudo-target, you can run it directly from the build tree and it will depend on the tarball being up to date rather than always rerunning bsdtar. I don't like the idea of turning the whole thing into one always-rebuilding pseudo-target.
Why bother with this at all, then? Autotools offers website and website.tar.gz, but both are in doc/. This target also is called probably once per release. Aliasing it to some shorter (and sub-par) seems not so useful... I think we should just skip this...
On Sat, Jan 12, 2019 at 09:15:00PM -0500, Eli Schwartz wrote:
A number of pages don't actually exist as html inside the source tree, and need to be generated even though they are manpages.
This caused the website.tar.gz target to only work inside a dirty tree initially created by autotools.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- doc/meson.build | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/doc/meson.build b/doc/meson.build index 7c9631cb..4d796492 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -14,6 +14,13 @@ manpages = [ { 'name': 'BUILDINFO.5' }, ]
+sitepages = [ + { 'name': 'submitting-patches' }, + { 'name': 'translation-help' }, + { 'name': 'HACKING', 'source': join_paths(meson.current_source_dir(), '../HACKING') },
This would be nicer as join_paths(meson.source_root(), 'HACKING')
+ { 'name': 'index' }, +] + asciidoc_conf = join_paths(meson.current_source_dir(), 'asciidoc.conf')
asciidoc_opts = [ @@ -58,6 +65,12 @@ foreach page : manpages install : true, install_dir : mandirn, ) +endforeach + +foreach page: manpages + sitepages + manpage = page['name'] + htmlpage = '@0@.html'.format(manpage) + input = page.get('source', '@0@.asciidoc'.format(manpage))
html = custom_target( htmlpage, @@ -85,6 +98,8 @@ foreach page : manpages html_files += [htmlpage] endforeach
+ +
One too many newlines?
run_target('html', command : ['/bin/true'], depends : html_targets) @@ -96,10 +111,6 @@ custom_target( '-C', meson.current_build_dir(), ] + html_files + [ '-C', meson.current_source_dir(), - 'submitting-patches.html', - 'translation-help.html', - 'HACKING.html', - 'index.html', 'asciidoc-override.css', '-C', '/etc/asciidoc/stylesheets/', 'asciidoc.css', -- 2.20.1
On 1/13/19 8:15 AM, Dave Reisner wrote:
On Sat, Jan 12, 2019 at 09:15:00PM -0500, Eli Schwartz wrote:
A number of pages don't actually exist as html inside the source tree, and need to be generated even though they are manpages.
This caused the website.tar.gz target to only work inside a dirty tree initially created by autotools.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- doc/meson.build | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/doc/meson.build b/doc/meson.build index 7c9631cb..4d796492 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -14,6 +14,13 @@ manpages = [ { 'name': 'BUILDINFO.5' }, ]
+sitepages = [ + { 'name': 'submitting-patches' }, + { 'name': 'translation-help' }, + { 'name': 'HACKING', 'source': join_paths(meson.current_source_dir(), '../HACKING') },
This would be nicer as join_paths(meson.source_root(), 'HACKING')
Apparently that is bad or something because of the possibility that in a subproject it would refer to the parent project. Actually though it looks like just using { 'source': '../HACKING' } works fine... meson is totally able to handle a filepath with relative paths here.
+ { 'name': 'index' }, +] + asciidoc_conf = join_paths(meson.current_source_dir(), 'asciidoc.conf')
asciidoc_opts = [ @@ -58,6 +65,12 @@ foreach page : manpages install : true, install_dir : mandirn, ) +endforeach + +foreach page: manpages + sitepages + manpage = page['name'] + htmlpage = '@0@.html'.format(manpage) + input = page.get('source', '@0@.asciidoc'.format(manpage))
html = custom_target( htmlpage, @@ -85,6 +98,8 @@ foreach page : manpages html_files += [htmlpage] endforeach
+ +
One too many newlines?
TBH, two too many newlines. -- Eli Schwartz Bug Wrangler and Trusted User
A number of pages don't actually exist as html inside the source tree, and need to be generated even though they are manpages. This caused the website.tar.gz target to only work inside a dirty tree initially created by autotools. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> --- v2: remove redundant whitespace, simplify HACKING.html source since it is a file target anyway. doc/meson.build | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index 7c9631cb..b7514ef7 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -14,6 +14,13 @@ manpages = [ { 'name': 'BUILDINFO.5' }, ] +sitepages = [ + { 'name': 'submitting-patches' }, + { 'name': 'translation-help' }, + { 'name': 'HACKING', 'source': '../HACKING' }, + { 'name': 'index' }, +] + asciidoc_conf = join_paths(meson.current_source_dir(), 'asciidoc.conf') asciidoc_opts = [ @@ -58,6 +65,12 @@ foreach page : manpages install : true, install_dir : mandirn, ) +endforeach + +foreach page: manpages + sitepages + manpage = page['name'] + htmlpage = '@0@.html'.format(manpage) + input = page.get('source', '@0@.asciidoc'.format(manpage)) html = custom_target( htmlpage, @@ -96,10 +109,6 @@ custom_target( '-C', meson.current_build_dir(), ] + html_files + [ '-C', meson.current_source_dir(), - 'submitting-patches.html', - 'translation-help.html', - 'HACKING.html', - 'index.html', 'asciidoc-override.css', '-C', '/etc/asciidoc/stylesheets/', 'asciidoc.css', -- 2.20.1
On 14/1/19 1:55 pm, Eli Schwartz wrote:
A number of pages don't actually exist as html inside the source tree, and need to be generated even though they are manpages.
This caused the website.tar.gz target to only work inside a dirty tree initially created by autotools.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
v2: remove redundant whitespace, simplify HACKING.html source since it is a file target anyway.
Thanks, A
participants (3)
-
Allan McRae
-
Dave Reisner
-
Eli Schwartz