]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: fix creation of html symlinks 5869/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 1 May 2017 04:17:20 +0000 (00:17 -0400)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 1 May 2017 04:19:39 +0000 (00:19 -0400)
This adds two somewhat independent rules:
1. to create symlinks to html pages in the build directory
2. to create symlinks in the installation directory

The second part needs to be coded separately, because telling meson to install
the symlinks created in step 1. results in a copy of the target, instead of a
symlink. So step 2. needs to ignore the result of 1. and create the symlink again.

Fixes #5863.

man/meson.build

index 9cdb560c4c13fd19009347cbf32419872417e216..abe6878022870affc4bbc8f958dfd9804446c574 100644 (file)
@@ -64,13 +64,27 @@ foreach tuple : manpages
                 p2 = custom_target(
                         html,
                         input : xml,
-                        output : [html] + htmlaliases,
+                        output : html,
                         command : xslt_cmd + [custom_html_xsl, '@INPUT@'],
                         depend_files : custom_entities_ent,
                         install : want_html,
                         install_dir : join_paths(docdir, 'html'))
                 html_pages += [p2]
 
+                foreach htmlalias : htmlaliases
+                        p3 = custom_target(
+                                htmlalias,
+                                input : p2,
+                                output : htmlalias,
+                                command : ['ln', '-fs', html, '@OUTPUT@'])
+                        if want_html
+                                dst = join_paths(docdir, 'html', htmlalias)
+                                cmd = 'ln -fs @0@ $DESTDIR@1@'.format(html, dst)
+                                meson.add_install_script('sh', '-c', cmd)
+                        endif
+                        html_pages += [p3]
+                endforeach
+
                 source_xml_files += files(tuple[0] + '.xml')
         else
                 message('Skipping @0@.@1@ because @2@ is false'.format(stem, section, condition))