GNOME Bugzilla – Bug 776427
Fix non-srcdir build of the documentation
Last modified: 2018-05-02 17:53:22 UTC
Created attachment 342405 [details] Screenshot: Example code missing in devhelp Please refer attachment.
Created attachment 348137 [details] [review] Fix non-srcdir build of the documentation The source files in the getting started guide are not properly shown when compiling the documentation in a non-srcdir build. xsltproc's --path option unfortunately does not work for nested directory trees and up to now only source code snippets in the base `examples' directory were considered. In order to fix this issue, copy the relevant source code files to the documentation directory during the build.
aka https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672369
Review of attachment 348137 [details] [review]: ::: docs/reference/gtk/Makefile.am @@ +521,3 @@ + +setup-examples.stamp: $(addprefix $(top_srcdir)/,$(example_files)) + -$(GTK_DOC_V_EXAMPLES) \ Why is this ignoring failure (the - prefix)? Does this need to be skipped for in-tree builds? Either if test "x$(top_srcdir)" != "x$(top_builddir); then \ ... the rest of what you've done ...; \ fi or a configure-time conditional. @@ +522,3 @@ +setup-examples.stamp: $(addprefix $(top_srcdir)/,$(example_files)) + -$(GTK_DOC_V_EXAMPLES) \ + files=`echo $(example_files)`; \ Is there a reason why files="$(example_files)" wouldn't be sufficient? @@ +526,3 @@ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/xml/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ mkdir -p is not portable to all non-Linux systems, use $(MKDIR_P) (which makes the test -d unnecessary)
Created attachment 348197 [details] [review] Fix non-srcdir build of the documentation Thank you for the review, I have adapted the patch. Note, that the code should be run both in src and non-src builds, since we need the example files to be in the same location in both cases, i.e., where the xml files are located. Note, that the files are only copied in case that the documentation is enabled (--enable-gtk-doc), so a further configure-time conditional is not necessary.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/723.