GNOME Bugzilla – Bug 108240
Examples/book source files not installed by 'make install'
Last modified: 2004-12-22 21:47:04 UTC
The examples source files (in examples/book) are referenced in many different places in the gtkmm book (docs/tutorial). However, the corresponding .cc and .h files are not installed when doing a 'make install'. This means that in the installed documentation (usually located in share/doc/gtkmm-2.0), a bunch of links are broken. Even worst than that, the corresponding links in the tutorial would require the examples directory to be installed to share/doc/examples, which is of course not the best solution ! My opinion is that the book/* subdirs belongs to the docs/tutorial directory instead of examples. This would make it much easier to create installation rules for the corresponding .cc and .h files.
Does any other package install examples?
Yes, doxygen does it, at least on my RedHat 8.0 box. In /usr/share/doc/doxygen-2.*.*, there are two subdirs, examples and html. I think it might be interesting to have a look at the doxygen source code and see how Dimitri is doing it in its Makefile.am's.
I see, so you are not saying that the examples should not be somewhere in /usr/share/doc/, but that they should be inside /usr/share/doc/gtkmm-2.0/? Well, can't we just move the documentation down one folder so that the links still work?
Yes, I think the examples should be in /usr/share/doc/gtkmm- 2.0/examples or whatever the prefix (usually /usr). This means that the examples/book subdir should be moved to docs/tutorial and the links in the tutorial updated accordingly. The other solution is to keep the examples where they are in the distribution, install them in /usr/share/doc/gtkmm-2.0/examples and update the links in the tutorial. This is easier for CVS but it means that the example links will be broken if the user opens the docs/tutorial/html/index.html file FROM the source distribution instead of the installation directory. Anyway, in both cases, should the makefile rule that install the examples be called from docs/tutorial/Makefile, from examples/Makefile or from the individual examples/book/*/Makefile ? I can add a simple rule called from the individual Makefiles in all examples subdirs but : 1. Building the examples would be required before installing the source files (automake requires that) 2. Because examples/Makefile in not called when doing a make in the root directory, this means that 'make install' will have to be called in both the root and examples directories. Maybe there is an automake way of doing that but it's almost black magic (install-local rules, ...) All in all, it's a bit of a mess.
I was thinking of just having a docs/docs directory if that fixed it, with docs/docs/tutorial and docs/examples/. I know it's not perfect, but it's not too bad.
If you're talking about having /usr/share/doc/gtkmm-2.0/doc/doc, then this would solve the problem with a quick and dirty solution. If you agree on moving the examples/book directory on CVS, then it would be easier to have docs/examples and docs/tutorial and to change the gtkmm-tut-with-examples.xml file. there is actually a single line to change, namely <!ENTITY path_examples_base "../../examples/book/"> to <!ENTITY path_examples_base "../examples/book/"> No docs/docs and only the examples used by the tutorial will be installed. To summarize, what would be nice : 1. Move %root%/examples/books to %root%/docs/examples/book 2. Change the ENTITY in gtkmm-tut-with-examples.xml 3. Write a nice install rule for the examples/book source files so that we have /usr/share/doc/gtkmm-2.0/examples/book and /usr/share/doc/gtkmm-2.0/tutorial/html/index.html referencing the source files appropriately. You decide...
I think I'd prefer to keep the examples in the examples dir.
We could consider moving the examples for gtkmm 2.4, though we'd need some toplevel README.examples to make it clear where they are. People often don't see the examples even where they are now, right in front of them.
Ok, here is my patch for this examples installation problem (+ a few win32 related fixes). See the patched ChangeLog for details. Basically, what's being done is : 1. Now FAQ is installed along with the tutorial and reference 2. All those things are installed in /usr/share/doc/gtkmm-2.0/docs 3. The examples source files are installed in /usr/share/doc/gtkmm- 2.0/examples 4. The examples source files are installed when doing 'make install' in the examples directory. The examples binaries are created at the same time if it has not been done before. Of course, those binaries are not installed. This means that to install the all documentation, it is necessary to do a 'make install' in both the root directory and in the examples subdir. If one wants to avoid that, examples should be added back to SUBDIRS in the root Makefile.am. Not the perfect solution, but at least it works as expected.
Created attachment 15025 [details] [review] patch for the installation of examples source files
Thanks a lot. This doesn't look as easy as I thought. I wanted to build the examples anyway, so I have added it to the SUBDIRS. I think it's a good solution. Re. the extra win32 stuff - Do try to keep patches targetted. If I had time I would be stricter. Applied. Thanks again.
make distcheck now fails in the examples dir, with "no rule to make distclean". Any ideas?
While adding examples to SUBDIRS, you forgot to remove it from DIST_SUBDIRS !!! Also, when I tried to build gtkmm-2.2.1, I realized you had increase the atk requirement to 1.2.0. Turns out atk on win32 is still at 1.0.3 (I think it's a bad decision from Tor Lillqvist not to upgrade all gtk+ components at the same time, but we have to live with it !). no big deal (I just modified my atk-1.0.pc file) but I think we should have separate library requirements for win32 in the configure.in. What do you think ? Apart from that, I will soon put the gtkmm-2.2.1 installer online, as soon as I have decided to stick to Inno Setup as the installer builder or move to NSIS (as recommended by somebody who contacted me privately last week).
Reopening bug so someone fixes the DISTDIR thing. I don't know how we would have a different spec file for win32. I'd prefer that atk was fixed. Do you know why they are using the old one?
I don't know why atk was not upgraded (laziness ?). I have also sent 2 messages to the gimpwin-dev mailinglist complaining about missing symbols (like gtk_clipboard_get_type !!!) in the DLLs. I hope everything will be fixed in the next binary release of gtk+ on win32. In the meantime, I don't think it's a good idea to provide on our gtk+ DLLs (as mentioned yesterday on the mailing list).
Here is my patch for the distclean problem. Very short indeed.
Created attachment 15097 [details] [review] distclean problem patch
This should be comitted to both "branches". Thanks.
I've applied the patch to both gtkmm 2.4 and the gtkmm 2.2 module. It didn't apply cleanly to gtkmm 2.4 with 'patch -p0 < patchname' (no idea why), so I had to fix it manually. Strange. Murray, it seems you didn't patch the ChangeLog for 2.4? Also, gtkmm 2.4 doesn't seem to build so I couldn't really test it. It never produces configure, instead stops with atk/atkmm/Makefile.am:33: variable `win32_dlls_extra_libs' not defined gdk/gdkmm/Makefile.am:32: variable `win32_dlls_extra_libs' not defined gtk/gtkmm/Makefile.am:35: variable `win32_dlls_extra_libs' not defined pango/pangomm/Makefile.am:32: variable `win32_dlls_extra_libs' not defined
Thank you, Ole. > Strange. Murray, it seems you didn't patch the ChangeLog for 2.4 What didn't I put in the ChangeLog? Re. the gtkmm 2.4 build: Did you run autogen.sh again?
Ehrm, the following is in the gtkmm 2.2 ChangeLog: 2003-03-15 Murray Cumming <murrayc@usa.net> * Makefile.am: Added examples to SUBDIRS so that they are installed by default and because I would like to make sure they always build. This significantly adds to the build time. I somehow assumed this should be in 2.4, but I may be completely wrong. Feel free to ignore me. Regarding the build issue: yes, everytime I try, this happens: ole:~/cvs/gtkmm$ ./autogen.sh Found GNU make at /usr/bin/make... good. Adding libtools. Building macros. Building makefiles. atk/atkmm/Makefile.am:33: variable `win32_dlls_extra_libs' not defined gdk/gdkmm/Makefile.am:32: variable `win32_dlls_extra_libs' not defined gtk/gtkmm/Makefile.am:35: variable `win32_dlls_extra_libs' not defined pango/pangomm/Makefile.am:32: variable `win32_dlls_extra_libs' not defined ole:~/cvs/gtkmm$ (Cc'ing myself, I really should have done that with the other bugs too.)
I think this entry covers 2 combined gtkmm 2.2 entries, but thanks for being vigilant: 2003-03-18 Cedric Gustin <cgustin@ibelgique.com> * Makefile.am : removed examples from DIST_SUBDIRS 2003-03-18 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> * examples/Makefile.am_fragment: Added DESTDIR-support. This has been applied to glibmm 2.4 and gtkmm 2.4. The autogen works for me. Maybe it's a problem with your autotools or maybe it will show up for other people later. Thanks.
The autogen.sh problem happens with me too. I checked out cvs head(or whatever its called that you checkout with cvs -z3 co gtkmm). gtkmm]# ./autogen.sh which: no gnumake in (/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin) Found GNU make at /usr/bin/gmake... good. Adding libtools. Building macros. Building makefiles. atk/atkmm/Makefile.am:33: variable `win32_dlls_extra_libs' not defined gdk/gdkmm/Makefile.am:32: variable `win32_dlls_extra_libs' not defined gtk/gtkmm/Makefile.am:35: variable `win32_dlls_extra_libs' not defined pango/pangomm/Makefile.am:32: variable `win32_dlls_extra_libs' not defined May be somebody should create separate bug about this? hth
actually changing automake from 1.4-p6 to 1.7.2 fixed that problem