swami / libinstpatch

Instrument file software library.
Other
20 stars 6 forks source link

Get documentation building for GTK-Doc 1.32. #62

Closed dmo2118 closed 3 years ago

dmo2118 commented 3 years ago

Mostly, I switched things to use the CMake files that GTK-Doc installed on my system (Ubuntu 20.04), instead of what used to be bundled in the libinstpatch repo.

Important caveat: it doesn't quite work. When I build, I get this mess:

[  1%] Generating libinstpatch.signals
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
-- Checking for modules 'glib-2.0;gobject-2.0'
--   Found glib-2.0, version 2.64.3
--   Found gobject-2.0, version 2.64.3
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
-- Executing gtkdoc-scangobj with:
--    CFLAGS:  '-I/home/david/src/libinstpatch' '-I/usr/include/glib-2.0' '-I/usr/lib/x86_64-linux-gnu/glib-2.0/include'
--   LDFLAGS:  '-L/home/david/src/libinstpatch/build/docs/reference/../../libinstpatch' '-linstpatch-1.0' '-lgobject-2.0' '-lglib-2.0'
--    LDPATH: /home/david/src/libinstpatch/build/docs/reference/../../libinstpatch
[ 94%] Built target libinstpatch
[ 96%] Built target riff_dump
libinstpatch-scan.c: In function ‘main’:
libinstpatch-scan.c:267:3: warning: implicit declaration of function ‘ipatch_init’ [-Wimplicit-function-declaration]
  267 |   ipatch_init();
      |   ^~~~~~~~~~~
-- Scan succeeded.
make[2]: *** [docs/reference/CMakeFiles/doc-libinstpatch.dir/build.make:109: docs/reference/libinstpatch.signals] Error 1
make[2]: *** Deleting file 'docs/reference/libinstpatch.signals'
make[1]: *** [CMakeFiles/Makefile2:292: docs/reference/CMakeFiles/doc-libinstpatch.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

There's a sequence of failures here:

  1. In /usr/share/cmake/GtkDoc/GtkDocScanGObjWrapper.cmake, the call to pkg_check_modules emits those internal CMake variable not set errors. That might be a bug in either GTK-Doc or CMake.
  2. The script keeps working OK, but it ends with an exit status of 1.
  3. docs/reference/CMakeFiles/doc-libinstpatch.dir/build.make fails on line 109. make deletes docs/reference/libinstpatch.signals even though it was successfully created, so a second invocation of make gives the same error.
  4. The original invocation of make fails.

Workaround is to go to build.make, line 109 and stick a - at the beginning of the line, like so:

--- a/docs/reference/CMakeFiles/doc-libinstpatch.dir/build.make 2020-10-25 20:39:14.102824841 -0400
+++ b/docs/reference/CMakeFiles/doc-libinstpatch.dir/build.make 2020-10-25 20:59:59.679762882 -0400
@@ -106,7 +106,7 @@

 docs/reference/libinstpatch.signals: docs/reference/libinstpatch.types
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/home/david/src/libinstpatch/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Generating libinstpatch.signals"
-   cd /home/david/src/libinstpatch/build/docs/reference && /usr/bin/cmake -D GTKDOC_SCANGOBJ_EXE:STRING=/usr/bin/gtkdoc-scangobj -D "_scanobjopts:STRING=--type-init-func=ipatch_init()" -D doc_prefix:STRING=libinstpatch -D output_types:STRING=/home/david/src/libinstpatch/build/docs/reference/libinstpatch.types -D output_dir:STRING=/home/david/src/libinstpatch/build/docs/reference -D EXTRA_CFLAGS:STRING=-I/home/david/src/libinstpatch -D "EXTRA_LDFLAGS:STRING=-L/home/david/src/libinstpatch/build/docs/reference/../../libinstpatch;-linstpatch-1.0" -D EXTRA_LDPATH:STRING=/home/david/src/libinstpatch/build/docs/reference/../../libinstpatch -P /usr/share/cmake/GtkDoc/GtkDocScanGObjWrapper.cmake
+   -cd /home/david/src/libinstpatch/build/docs/reference && /usr/bin/cmake -D GTKDOC_SCANGOBJ_EXE:STRING=/usr/bin/gtkdoc-scangobj -D "_scanobjopts:STRING=--type-init-func=ipatch_init()" -D doc_prefix:STRING=libinstpatch -D output_types:STRING=/home/david/src/libinstpatch/build/docs/reference/libinstpatch.types -D output_dir:STRING=/home/david/src/libinstpatch/build/docs/reference -D EXTRA_CFLAGS:STRING=-I/home/david/src/libinstpatch -D "EXTRA_LDFLAGS:STRING=-L/home/david/src/libinstpatch/build/docs/reference/../../libinstpatch;-linstpatch-1.0" -D EXTRA_LDPATH:STRING=/home/david/src/libinstpatch/build/docs/reference/../../libinstpatch -P /usr/share/cmake/GtkDoc/GtkDocScanGObjWrapper.cmake

 docs/reference/dir.stamp:
    @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/home/david/src/libinstpatch/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Generating dir.stamp, ."

Also: I killed gtk-doc.make.

derselbst commented 3 years ago

Sorry, I forgot about this. I don't know about gtkdoc at all. But still, I'm taking this now. Thanks!