After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776427 - Fix non-srcdir build of the documentation
Fix non-srcdir build of the documentation
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Documentation
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-12-23 05:05 UTC by gnome.vrb
Modified: 2018-05-02 17:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot: Example code missing in devhelp (85.27 KB, image/png)
2016-12-23 05:05 UTC, gnome.vrb
  Details
Fix non-srcdir build of the documentation (15.79 KB, patch)
2017-03-17 00:15 UTC, Tommy Liertzer
none Details | Review
Fix non-srcdir build of the documentation (15.78 KB, patch)
2017-03-17 17:44 UTC, Tommy Liertzer
none Details | Review

Description gnome.vrb 2016-12-23 05:05:20 UTC
Created attachment 342405 [details]
Screenshot: Example code missing in devhelp

Please refer attachment.
Comment 1 Tommy Liertzer 2017-03-17 00:15:50 UTC
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.
Comment 2 Simon McVittie 2017-03-17 11:36:07 UTC
aka https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672369
Comment 3 Simon McVittie 2017-03-17 11:45:26 UTC
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)
Comment 4 Tommy Liertzer 2017-03-17 17:44:24 UTC
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.
Comment 5 GNOME Infrastructure Team 2018-05-02 17:53:22 UTC
-- 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.