This is a repost so I can test my procmail script / automatic testing framework. The patch series is identical to v1. Rich.
Richard W.M. Jones
2017-Jul-07 10:53 UTC
[Libguestfs] [PATCH v2 1/3] gobject: Use TEST_FUNCTIONS framework in tests.
--- gobject/run-live-tests | 8 ++++---- gobject/run-tests | 11 +++++------ gobject/run-tests-retvalues | 7 +++---- tests/test-functions.sh | 16 ++++++++++++++++ 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/gobject/run-live-tests b/gobject/run-live-tests index 2d93de2ca..5bedb2309 100755 --- a/gobject/run-live-tests +++ b/gobject/run-live-tests @@ -18,9 +18,9 @@ set -e -if [ -z "$GJS" ]; then - echo "GObject bind tests skipped: gjs is missing" - exit 77 -fi +$TEST_FUNCTIONS +skip_if_skipped +skip_unless_environment_variable_set GJS +skip_unless_phony_guest fedora.img $GJS $srcdir/tests-misc.js diff --git a/gobject/run-tests b/gobject/run-tests index 7393e7339..28e38d955 100755 --- a/gobject/run-tests +++ b/gobject/run-tests @@ -18,13 +18,12 @@ set -e -if [ -z "$GJS" ]; then - echo "GObject bind tests skipped: gjs is missing" - exit 77 -fi +$TEST_FUNCTIONS +skip_if_skipped +skip_unless_environment_variable_set GJS -echo "GObject bind tests skipped: Int64, OInt64 and OStringList are all broken" -exit 77 +# This test is disabled until we fix 64 bit support. +skip_because "Int64, OInt64 and OStringList are all broken" rm -f bindtests.tmp diff --git a/gobject/run-tests-retvalues b/gobject/run-tests-retvalues index e20321ea2..569040de4 100755 --- a/gobject/run-tests-retvalues +++ b/gobject/run-tests-retvalues @@ -18,9 +18,8 @@ set -e -if [ -z "$GJS" ]; then - echo "GObject bind tests skipped: gjs is missing" - exit 77 -fi +$TEST_FUNCTIONS +skip_if_skipped +skip_unless_environment_variable_set GJS $GJS $srcdir/bindtests-retvalues.js 2>/dev/null diff --git a/tests/test-functions.sh b/tests/test-functions.sh index e5e824681..44ccd37b9 100755 --- a/tests/test-functions.sh +++ b/tests/test-functions.sh @@ -211,6 +211,15 @@ skip_unless_libvirt_minimum_version () fi } +# Skip unless the environment variable named is set to a non-empty value. +skip_unless_environment_variable_set () +{ + if [ -z "${!1}" ]; then + echo "$(basename $0): test skipped because \$$1 is not set" + exit 77 + fi +} + # Run an external command and skip if the command fails. This can be # used to test if a command exists. Normally you should use # `cmd --help' or `cmd --version' or similar. @@ -222,6 +231,13 @@ skip_unless () fi } +# Use this if a test is broken. "$1" should contain the reason. +skip_because () +{ + echo "$(basename $0): test skipped because: $1" + exit 77 +} + # Skip if the user is trying to run a test as root. # Tests shouldn't be run as root, but a few are especially dangerous. skip_if_root () -- 2.13.2
Richard W.M. Jones
2017-Jul-07 10:53 UTC
[Libguestfs] [PATCH v2 2/3] gobject: Remove gtk-doc (RHBZ#1465665).
The gobject bindings are adequately covered in the usual manual pages: guestfs(3). There is no need for separate generation of gtk-doc. Also generating gtk documentation is the slowest part of the build, and the tooling around gtk-doc is broken (https://bugzilla.redhat.com/show_bug.cgi?id=1465665). Note this removes the configure ‘--enable-gtk-doc’ option. Using this option now gives a warning, but is otherwise ignored: configure: WARNING: unrecognized options: --enable-gtk-doc --- Makefile.am | 2 +- configure.ac | 2 - generator/GObject.ml | 18 --- generator/GObject.mli | 1 - generator/main.ml | 2 - gobject/Makefile.am | 3 - gobject/docs/.gitignore | 26 ---- gobject/docs/Makefile.am | 115 ---------------- gobject/docs/gtk-doc.make | 280 -------------------------------------- gobject/docs/guestfs-docs.sgml.in | 34 ----- m4/gtk-doc.m4 | 67 --------- m4/guestfs_gobject.m4 | 7 - 12 files changed, 1 insertion(+), 556 deletions(-) diff --git a/Makefile.am b/Makefile.am index fb77c9e9d..2dc704500 100644 --- a/Makefile.am +++ b/Makefile.am @@ -332,7 +332,7 @@ po/POTFILES: configure.ac rm -f $@ $@-t cd $(srcdir); \ find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \ - grep -v -E '^(examples|gnulib|gobject/docs|perl/(blib|examples)|po-docs|tests|test-data)/' | \ + grep -v -E '^(examples|gnulib|perl/(blib|examples)|po-docs|tests|test-data)/' | \ grep -v -E '/((guestfs|rc)_protocol\.c)$$' | \ grep -v -E '^python/utils\.c$$' | \ grep -v -E '^perl/lib/Sys/Guestfs\.c$$' | \ diff --git a/configure.ac b/configure.ac index 293e0d3ec..dd2a4d7f4 100644 --- a/configure.ac +++ b/configure.ac @@ -224,8 +224,6 @@ AC_CONFIG_FILES([Makefile gnulib/tests/Makefile gobject/libguestfs-gobject-1.0.pc gobject/Makefile - gobject/docs/Makefile - gobject/docs/guestfs-docs.sgml golang/Makefile golang/examples/Makefile haskell/Makefile diff --git a/generator/GObject.ml b/generator/GObject.ml index bb95b170c..b2d67d926 100644 --- a/generator/GObject.ml +++ b/generator/GObject.ml @@ -185,24 +185,6 @@ let generate_gobject_header () (function f -> pr "#include <guestfs-gobject/%s.h>\n" f) filenames -let generate_gobject_doc_title () - pr -"<?xml version=\"1.0\"?> -<!DOCTYPE refentry PUBLIC \"-//OASIS//DTD DocBook XML V4.3//EN\" - \"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd\" -[ - <!ENTITY %% local.common.attrib \"xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'\"> -]> -<chapter> - <title>Libguestfs GObject Bindings</title> -"; - - List.iter ( - function n -> pr " <xi:include href=\"xml/%s.xml\"/>\n" n - ) filenames; - - pr "</chapter>\n" - let generate_gobject_struct_header filename typ cols () header_start filename; diff --git a/generator/GObject.mli b/generator/GObject.mli index b4d0ea696..a23a4b6ad 100644 --- a/generator/GObject.mli +++ b/generator/GObject.mli @@ -16,7 +16,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *) -val generate_gobject_doc_title : unit -> unit val generate_gobject_header : unit -> unit val generate_gobject_makefile : unit -> unit val generate_gobject_optargs_header : string -> string -> Types.action -> unit -> unit diff --git a/generator/main.ml b/generator/main.ml index d4316c085..cfea3f55a 100644 --- a/generator/main.ml +++ b/generator/main.ml @@ -283,8 +283,6 @@ Run it from the top source directory using the command GObject.generate_gobject_makefile; output_to "gobject/include/guestfs-gobject.h" GObject.generate_gobject_header; - output_to "gobject/docs/guestfs-title.sgml" - GObject.generate_gobject_doc_title; List.iter ( fun { s_name = typ; s_cols = cols } -> let short = sprintf "struct-%s" typ in diff --git a/gobject/Makefile.am b/gobject/Makefile.am index 1c7750cb1..677d7a3d2 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -15,8 +15,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -SUBDIRS = . docs - include $(top_srcdir)/subdir-rules.mk include $(srcdir)/Makefile.inc @@ -33,7 +31,6 @@ EXTRA_DIST = \ TODO.txt \ .gitignore \ bindtests-retvalues.js \ - docs/.gitignore \ tests-misc.js \ run-tests \ run-tests-retvalues \ diff --git a/gobject/docs/.gitignore b/gobject/docs/.gitignore deleted file mode 100644 index e91957f54..000000000 --- a/gobject/docs/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -/guestfs.args -/guestfs-decl-list.txt -/guestfs-decl.txt -/guestfs-docs.sgml -/guestfs.hierarchy -/guestfs.interfaces -/guestfs-overrides.txt -/guestfs.prerequisites -/guestfs-sections.txt -/guestfs.signals -/guestfs-title.sgml -/guestfs.types -/guestfs-undeclared.txt -/guestfs-undocumented.txt -/guestfs-unused.txt -/html/ -/html-build.stamp -/html.stamp -/scan-build.stamp -/setup-build.stamp -/sgml-build.stamp -/sgml.stamp -/tmpl/ -/tmpl-build.stamp -/tmpl.stamp -/xml/ diff --git a/gobject/docs/Makefile.am b/gobject/docs/Makefile.am deleted file mode 100644 index c7569288f..000000000 --- a/gobject/docs/Makefile.am +++ /dev/null @@ -1,115 +0,0 @@ -# libguestfs -# Copyright (C) 2012-2017 Red Hat Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -include $(top_srcdir)/subdir-rules.mk - -generator_built = guestfs-title.sgml - -# The name of the module, e.g. 'glib'. -DOC_MODULE=guestfs - -# Uncomment for versioned docs and specify the version of the module, e.g. '2'. -#DOC_MODULE_VERSION=2 - -# The top-level SGML file. You can change this if you want to. -DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml - -# Directories containing the source code. -# gtk-doc will search all .c and .h files beneath these paths -# for inline comments documenting functions and macros. -# e.g. DOC_SOURCE_DIR=$(top_srcdir)/gtk $(top_srcdir)/gdk -DOC_SOURCE_DIR=$(srcdir)/../src $(srcdir)/../include - -# Extra options to pass to gtkdoc-scangobj. Not normally needed. -SCANGOBJ_OPTIONS- -# Extra options to supply to gtkdoc-scan. -# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS=--rebuild-sections --rebuild-types - -# Extra options to supply to gtkdoc-mkdb. -# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml -MKDB_OPTIONS=--xml-mode --output-format=xml - -# Extra options to supply to gtkdoc-mktmpl -# e.g. MKTMPL_OPTIONS=--only-section-tmpl -MKTMPL_OPTIONS- -# Extra options to supply to gtkdoc-mkhtml -MKHTML_OPTIONS- -# Extra options to supply to gtkdoc-fixref. Not normally needed. -# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html -FIXXREF_OPTIONS- -# Used for dependencies. The docs will be rebuilt if any of these change. -# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h -# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c -HFILE_GLOB=$(srcdir)/../include/guestfs-gobject/*.h -CFILE_GLOB=$(srcdir)/../src/*.c - -# Extra header to include when scanning, which are not under DOC_SOURCE_DIR -# e.g. EXTRA_HFILES=$(top_srcdir}/contrib/extra.h -EXTRA_HFILES- -# Header files or dirs to ignore when scanning. Use base file/dir names -# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code -IGNORE_HFILES- -# Images to copy into HTML directory. -# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png -HTML_IMAGES- -# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE). -# e.g. content_files=running.sgml building.sgml changes-2.0.sgml -content_files- -# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded -# These files must be listed here *and* in content_files -# e.g. expand_content_files=running.sgml -expand_content_files- -# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library. -# Only needed if you are using gtkdoc-scangobj to dynamically query widget -# signals and properties. -# e.g. GTKDOC_CFLAGS=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) -# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) -GTKDOC_CFLAGS=$(GOBJECT_CFLAGS) $(GIO_CFLAGS) -GTKDOC_LIBS=$(GOBJECT_LIBS) $(GIO_LIBS) $(builddir)/../libguestfs-gobject-1.0.la - -# This includes the standard gtk-doc make rules, copied by gtkdocize. -include $(srcdir)/gtk-doc.make - -# Other files to distribute -# e.g. EXTRA_DIST += version.xml.in -EXTRA_DIST += $(generator_built) - -# Files not to distribute -# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types -# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt -#DISTCLEANFILES +- -# Comment this out if you want 'make check' to test doc status -# and run some sanity checks -if ENABLE_GTK_DOC -TESTS_ENVIRONMENT = cd $(srcdir) && \ - DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \ - SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir) -#TESTS = $(GTKDOC_CHECK) -endif - --include $(top_srcdir)/git.mk diff --git a/gobject/docs/gtk-doc.make b/gobject/docs/gtk-doc.make deleted file mode 100644 index 69cdb4c88..000000000 --- a/gobject/docs/gtk-doc.make +++ /dev/null @@ -1,280 +0,0 @@ -# -*- mode: makefile -*- - -#################################### -# Everything below here is generic # -#################################### - -if GTK_DOC_USE_LIBTOOL -GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -GTKDOC_RUN = $(LIBTOOL) --mode=execute -else -GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -GTKDOC_RUN -endif - -# We set GPATH here; this gives us semantics for GNU make -# which are more like other make's VPATH, when it comes to -# whether a source that is a target of one rule is then -# searched for in VPATH/GPATH. -# -GPATH = $(srcdir) - -TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) - -SETUP_FILES = \ - $(content_files) \ - $(DOC_MAIN_SGML_FILE) \ - $(DOC_MODULE)-sections.txt \ - $(DOC_MODULE)-overrides.txt - -EXTRA_DIST = \ - $(HTML_IMAGES) \ - $(SETUP_FILES) - -DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ - html-build.stamp pdf-build.stamp \ - tmpl.stamp sgml.stamp html.stamp pdf.stamp - -SCANOBJ_FILES = \ - $(DOC_MODULE).args \ - $(DOC_MODULE).hierarchy \ - $(DOC_MODULE).interfaces \ - $(DOC_MODULE).prerequisites \ - $(DOC_MODULE).signals - -REPORT_FILES = \ - $(DOC_MODULE)-undocumented.txt \ - $(DOC_MODULE)-undeclared.txt \ - $(DOC_MODULE)-unused.txt - -CLEANFILES += $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) - -if ENABLE_GTK_DOC -if GTK_DOC_BUILD_HTML -HTML_BUILD_STAMP=html-build.stamp -else -HTML_BUILD_STAMP-endif -if GTK_DOC_BUILD_PDF -PDF_BUILD_STAMP=pdf-build.stamp -else -PDF_BUILD_STAMP-endif - -all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) -else -all-local: -endif - -docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) - -$(REPORT_FILES): sgml-build.stamp - -#### setup #### - -setup-build.stamp: - -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - echo ' DOC Preparing build'; \ - files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \ - if test "x$$files" != "x" ; then \ - for file in $$files ; do \ - test -f $(abs_srcdir)/$$file && \ - cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \ - done; \ - fi; \ - test -d $(abs_srcdir)/tmpl && \ - { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \ - chmod -R u+w $(abs_builddir)/tmpl; } \ - fi - @touch setup-build.stamp - -#### scan #### - -scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) - @echo ' DOC Scanning header files' - @_source_dir='' ; \ - for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) - @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ - echo " DOC Introspecting gobjects"; \ - scanobj_options=""; \ - gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$(?)" = "0"; then \ - if test "x$(V)" = "x1"; then \ - scanobj_options="--verbose"; \ - fi; \ - fi; \ - CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ - gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ - else \ - for i in $(SCANOBJ_FILES) ; do \ - test -f $$i || touch $$i ; \ - done \ - fi - @touch scan-build.stamp - -$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp - @true - -#### templates #### - -tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt - @echo ' DOC Rebuilding template files' - @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) - @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - if test -w $(abs_srcdir) ; then \ - cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \ - fi \ - fi - @touch tmpl-build.stamp - -tmpl.stamp: tmpl-build.stamp - @true - -$(srcdir)/tmpl/*.sgml: - @true - -#### xml #### - -sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) - @echo ' DOC Building XML' - @-chmod -R u+w $(srcdir) - @_source_dir='' ; \ - for i in $(DOC_SOURCE_DIR) ; do \ - _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) - @touch sgml-build.stamp - -sgml.stamp: sgml-build.stamp - @true - -#### html #### - -html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) - @echo ' DOC Building HTML' - @rm -rf html - @mkdir html - @mkhtml_options=""; \ - gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$(?)" = "0"; then \ - if test "x$(V)" = "x1"; then \ - mkhtml_options="$$mkhtml_options --verbose"; \ - fi; \ - fi; \ - gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ - if test "$(?)" = "0"; then \ - mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ - fi; \ - cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) - -@test "x$(HTML_IMAGES)" = "x" || \ - for file in $(HTML_IMAGES) ; do \ - if test -f $(abs_srcdir)/$$file ; then \ - cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ - fi; \ - if test -f $(abs_builddir)/$$file ; then \ - cp $(abs_builddir)/$$file $(abs_builddir)/html; \ - fi; \ - done; - @echo ' DOC Fixing cross-references' - @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) - @touch html-build.stamp - -#### pdf #### - -pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) - @echo ' DOC Building PDF' - @rm -f $(DOC_MODULE).pdf - @mkpdf_options=""; \ - gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ - if test "$(?)" = "0"; then \ - if test "x$(V)" = "x1"; then \ - mkpdf_options="$$mkpdf_options --verbose"; \ - fi; \ - fi; \ - if test "x$(HTML_IMAGES)" != "x"; then \ - for img in $(HTML_IMAGES); do \ - part=`dirname $$img`; \ - echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ - if test $$? != 0; then \ - mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ - fi; \ - done; \ - fi; \ - gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) - @touch pdf-build.stamp - -############## - -clean-local: - @rm -f *~ *.bak - @rm -rf .libs - -distclean-local: - @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ - $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt - @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ - rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \ - rm -rf tmpl; \ - fi - -maintainer-clean-local: - @rm -rf xml html - -install-data-local: - @installfiles=`echo $(builddir)/html/*`; \ - if test "$$installfiles" = '$(builddir)/html/*'; \ - then echo 1>&2 'Nothing to install' ; \ - else \ - if test -n "$(DOC_MODULE_VERSION)"; then \ - installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ - else \ - installdir="$(DESTDIR)$(TARGET_DIR)"; \ - fi; \ - $(mkinstalldirs) $${installdir} ; \ - for i in $$installfiles; do \ - echo ' $(INSTALL_DATA) '$$i ; \ - $(INSTALL_DATA) $$i $${installdir}; \ - done; \ - if test -n "$(DOC_MODULE_VERSION)"; then \ - mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ - $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ - fi; \ - $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ - fi - -uninstall-local: - @if test -n "$(DOC_MODULE_VERSION)"; then \ - installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ - else \ - installdir="$(DESTDIR)$(TARGET_DIR)"; \ - fi; \ - rm -rf $${installdir} - -# -# Require gtk-doc when making dist -# -if ENABLE_GTK_DOC -dist-check-gtkdoc: docs -else -dist-check-gtkdoc: - @echo "*** gtk-doc must be installed and enabled in order to make dist" - @false -endif - -dist-hook: dist-check-gtkdoc dist-hook-local - @mkdir $(distdir)/tmpl - @mkdir $(distdir)/html - @-cp ./tmpl/*.sgml $(distdir)/tmpl - @cp ./html/* $(distdir)/html - @-cp ./$(DOC_MODULE).pdf $(distdir)/ - @-cp ./$(DOC_MODULE).types $(distdir)/ - @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ - @cd $(distdir) && rm -f $(DISTCLEANFILES) - @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html - -.PHONY : dist-hook-local docs diff --git a/gobject/docs/guestfs-docs.sgml.in b/gobject/docs/guestfs-docs.sgml.in deleted file mode 100644 index 23bfccf46..000000000 --- a/gobject/docs/guestfs-docs.sgml.in +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0"?> -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" - "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" -[ - <!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'"> -]> -<book id="index"> - <bookinfo> - <title>Libguestfs GObject Bindings Reference Manual</title> - <releaseinfo> - for libguestfs @VERSION@. - <!-- - The latest version of this documentation can be found on-line at - <ulink role="online-location" url="http://[SERVER]/guestfs/index.html">http://[SERVER]/guestfs/</ulink>. - --> - </releaseinfo> - </bookinfo> - - <xi:include href="@abs_srcdir@/guestfs-title.sgml"/> - <chapter id="object-tree"> - <title>Object Hierarchy</title> - <xi:include href="xml/tree_index.sgml"/> - </chapter> - <index id="api-index-full"> - <title>API Index</title> - <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include> - </index> - <index id="deprecated-api-index" role="deprecated"> - <title>Index of deprecated API</title> - <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include> - </index> - - <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include> -</book> diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4 deleted file mode 100644 index 0ada15193..000000000 --- a/m4/gtk-doc.m4 +++ /dev/null @@ -1,67 +0,0 @@ -dnl -*- mode: autoconf -*- - -# serial 1 - -dnl Usage: -dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) -AC_DEFUN([GTK_DOC_CHECK], -[ - AC_REQUIRE([PKG_PROG_PKG_CONFIG]) - AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first - AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first - - dnl check for tools we added during development - AC_PATH_PROG([GTKDOC_CHECK],[gtkdoc-check]) - AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) - AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) - - dnl for overriding the documentation installation directory - AC_ARG_WITH([html-dir], - AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, - [with_html_dir='${datadir}/gtk-doc/html']) - HTML_DIR="$with_html_dir" - AC_SUBST([HTML_DIR]) - - dnl enable/disable documentation building - AC_ARG_ENABLE([gtk-doc], - AS_HELP_STRING([--enable-gtk-doc], - [use gtk-doc to build documentation [[default=no]]]),, - [enable_gtk_doc=no]) - - if test x$enable_gtk_doc = xyes; then - ifelse([$1],[], - [PKG_CHECK_EXISTS([gtk-doc],, - AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))], - [PKG_CHECK_EXISTS([gtk-doc >= $1],, - AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build $PACKAGE_NAME]))]) - dnl don't check for glib if we build glib - if test "x$PACKAGE_NAME" != "xglib"; then - dnl don't fail if someone does not have glib - PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,) - fi - fi - - AC_MSG_CHECKING([whether to build gtk-doc documentation]) - AC_MSG_RESULT($enable_gtk_doc) - - dnl enable/disable output formats - AC_ARG_ENABLE([gtk-doc-html], - AS_HELP_STRING([--enable-gtk-doc-html], - [build documentation in html format [[default=yes]]]),, - [enable_gtk_doc_html=yes]) - AC_ARG_ENABLE([gtk-doc-pdf], - AS_HELP_STRING([--enable-gtk-doc-pdf], - [build documentation in pdf format [[default=no]]]),, - [enable_gtk_doc_pdf=no]) - - if test -z "$GTKDOC_MKPDF"; then - enable_gtk_doc_pdf=no - fi - - - AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) - AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) - AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) - AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) - AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) -]) diff --git a/m4/guestfs_gobject.m4 b/m4/guestfs_gobject.m4 index 4b4eab80d..4304f7b00 100644 --- a/m4/guestfs_gobject.m4 +++ b/m4/guestfs_gobject.m4 @@ -59,10 +59,3 @@ m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [ ],[ AM_CONDITIONAL([HAVE_INTROSPECTION], [false]) ]) - -# check for gtk-doc -m4_ifdef([GTK_DOC_CHECK], [ - GTK_DOC_CHECK([1.14],[--flavour no-tmpl]) -],[ - AM_CONDITIONAL([ENABLE_GTK_DOC], false) -]) -- 2.13.2
Richard W.M. Jones
2017-Jul-07 10:53 UTC
[Libguestfs] [PATCH v2 3/3] gobject: Add outline guestfs-gobject(3) manual page.
Since we removed gtk doc, we might as well replace it with a manual page explaining the basics of how to run gjs. --- .gitignore | 2 ++ docs/guestfs-recipes.pod | 1 + erlang/examples/guestfs-erlang.pod | 1 + gobject/Makefile.am | 19 +++++++++++ gobject/guestfs-gobject.pod | 64 ++++++++++++++++++++++++++++++++++++++ golang/examples/guestfs-golang.pod | 1 + java/examples/guestfs-java.pod | 1 + lib/guestfs.pod | 5 ++- lua/examples/guestfs-lua.pod | 1 + ocaml/examples/guestfs-ocaml.pod | 1 + perl/examples/guestfs-perl.pod | 1 + python/examples/guestfs-python.pod | 1 + ruby/examples/guestfs-ruby.pod | 1 + 13 files changed, 98 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7ccc928bb..774043501 100644 --- a/.gitignore +++ b/.gitignore @@ -283,6 +283,8 @@ Makefile.in /gobject/bindtests.js /gobject/Guestfs-1.0.gir /gobject/Guestfs-1.0.typelib +/gobject/guestfs-gobject.3 +/gobject/stamp-guestfs-gobject.pod /golang/bindtests.go /golang/examples/guestfs-golang.3 /golang/examples/stamp-guestfs-golang.pod diff --git a/docs/guestfs-recipes.pod b/docs/guestfs-recipes.pod index 7d772b8f2..11eb96ad7 100644 --- a/docs/guestfs-recipes.pod +++ b/docs/guestfs-recipes.pod @@ -722,6 +722,7 @@ L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-java(3)>, L<guestfs-lua(3)>, diff --git a/erlang/examples/guestfs-erlang.pod b/erlang/examples/guestfs-erlang.pod index 89cbda15b..2f03b8281 100644 --- a/erlang/examples/guestfs-erlang.pod +++ b/erlang/examples/guestfs-erlang.pod @@ -96,6 +96,7 @@ C<Arg> is the name of the unknown argument. L<guestfs(3)>, L<guestfs-examples(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-java(3)>, L<guestfs-lua(3)>, diff --git a/gobject/Makefile.am b/gobject/Makefile.am index 677d7a3d2..ddedd5b51 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -31,6 +31,7 @@ EXTRA_DIST = \ TODO.txt \ .gitignore \ bindtests-retvalues.js \ + guestfs-gobject.pod \ tests-misc.js \ run-tests \ run-tests-retvalues \ @@ -88,6 +89,8 @@ gir_DATA = $(INTROSPECTION_GIRS) typelibdir = $(libdir)/girepository-1.0 typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) +# Tests. + TESTS = \ run-tests \ run-tests-retvalues @@ -103,3 +106,19 @@ $(TESTS): $(typelib_DATA) CLEANFILES += $(gir_DATA) $(typelib_DATA) endif HAVE_INTROSPECTION + +# Documentation. + +man_MANS = guestfs-gobject.3 +noinst_DATA = $(top_builddir)/website/guestfs-gobject.3.html + +guestfs-gobject.3 $(top_builddir)/website/guestfs-gobject.3.html: stamp-guestfs-gobject.pod + +stamp-guestfs-gobject.pod: guestfs-gobject.pod + $(PODWRAPPER) \ + --section 3 \ + --man guestfs-gobject.3 \ + --html $(top_builddir)/website/guestfs-gobject.3.html \ + --license examples \ + $< + touch $@ diff --git a/gobject/guestfs-gobject.pod b/gobject/guestfs-gobject.pod new file mode 100644 index 000000000..c0c6839fb --- /dev/null +++ b/gobject/guestfs-gobject.pod @@ -0,0 +1,64 @@ +=head1 NAME + +guestfs-gobject - How to use libguestfs with the GObject bindings + +=head1 SYNOPSIS + +From Javascript using gjs: + + const Guestfs = imports.gi.Guestfs; + var g = new Guestfs.Session(); + g.add_drive('disk.img', null); + g.launch(); + g.close(); + +=head1 DESCRIPTION + +This manual page documents how to call libguestfs using GObject +bindings, especially from Javascript. + +Note that the GObject bindings have problems handling 64 bit values. +You should not use the GObject bindings if there are native bindings +for your language. For example, to use libguestfs from Python you are +strongly advised to use the Python native bindings instead (see +L<guestfs-python(3)>). + +This page just documents the differences from the C API and gives some +examples. If you are not familiar with using libguestfs, you also +need to read L<guestfs(3)>. + +=head1 JAVASCRIPT + +Using gjs, you can write a C<.js> file containing: + + const Guestfs = imports.gi.Guestfs; + var g = new Guestfs.Session(); + g.add_drive('disk.img', null); + g.launch(); + g.close(); + +and then run it using: + + gjs program.js + +=head1 SEE ALSO + +L<guestfs(3)>, +L<guestfs-examples(3)>, +L<guestfs-erlang(3)>, +L<guestfs-golang(3)>, +L<guestfs-java(3)>, +L<guestfs-lua(3)>, +L<guestfs-perl(3)>, +L<guestfs-python(3)>, +L<guestfs-recipes(1)>, +L<guestfs-ruby(3)>, +L<http://libguestfs.org/>. + +=head1 AUTHORS + +Richard W.M. Jones (C<rjones at redhat dot com>) + +=head1 COPYRIGHT + +Copyright (C) 2012-2017 Red Hat Inc. diff --git a/golang/examples/guestfs-golang.pod b/golang/examples/guestfs-golang.pod index c2de45ece..7b9c80ab4 100644 --- a/golang/examples/guestfs-golang.pod +++ b/golang/examples/guestfs-golang.pod @@ -78,6 +78,7 @@ UUIDs are not returned in structures. L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-java(3)>, L<guestfs-lua(3)>, L<guestfs-ocaml(3)>, diff --git a/java/examples/guestfs-java.pod b/java/examples/guestfs-java.pod index bcff3889f..2d5627f62 100644 --- a/java/examples/guestfs-java.pod +++ b/java/examples/guestfs-java.pod @@ -161,6 +161,7 @@ on the class path, as well as the path of your program. For example: L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-lua(3)>, L<guestfs-ocaml(3)>, diff --git a/lib/guestfs.pod b/lib/guestfs.pod index f2a54a1fd..b87210e65 100644 --- a/lib/guestfs.pod +++ b/lib/guestfs.pod @@ -1141,7 +1141,9 @@ See L<guestfs-erlang(3)>. =item B<GObject> Experimental GObject bindings (with GObject Introspection support) are -available. See the C<gobject> directory in the source. +available. + +See L<guestfs-gobject(3)>. =item B<Go> @@ -3393,6 +3395,7 @@ L<guestfs-examples(3)>. Language bindings: L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-java(3)>, L<guestfs-lua(3)>, diff --git a/lua/examples/guestfs-lua.pod b/lua/examples/guestfs-lua.pod index 36ea297ba..09de8d4a8 100644 --- a/lua/examples/guestfs-lua.pod +++ b/lua/examples/guestfs-lua.pod @@ -138,6 +138,7 @@ returned when you registered the callback: L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, diff --git a/ocaml/examples/guestfs-ocaml.pod b/ocaml/examples/guestfs-ocaml.pod index 523a60466..2fa3d53c1 100644 --- a/ocaml/examples/guestfs-ocaml.pod +++ b/ocaml/examples/guestfs-ocaml.pod @@ -82,6 +82,7 @@ function that you called. L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-java(3)>, L<guestfs-lua(3)>, diff --git a/perl/examples/guestfs-perl.pod b/perl/examples/guestfs-perl.pod index 1042f6948..6a9cb0ab5 100644 --- a/perl/examples/guestfs-perl.pod +++ b/perl/examples/guestfs-perl.pod @@ -41,6 +41,7 @@ L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-java(3)>, L<guestfs-lua(3)>, diff --git a/python/examples/guestfs-python.pod b/python/examples/guestfs-python.pod index 0891827f6..8d4c2e51a 100644 --- a/python/examples/guestfs-python.pod +++ b/python/examples/guestfs-python.pod @@ -65,6 +65,7 @@ You can use it like this: L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-java(3)>, L<guestfs-lua(3)>, diff --git a/ruby/examples/guestfs-ruby.pod b/ruby/examples/guestfs-ruby.pod index 5e4e1879a..bd8bb3108 100644 --- a/ruby/examples/guestfs-ruby.pod +++ b/ruby/examples/guestfs-ruby.pod @@ -36,6 +36,7 @@ string). L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, +L<guestfs-gobject(3)>, L<guestfs-golang(3)>, L<guestfs-java(3)>, L<guestfs-lua(3)>, -- 2.13.2
Apparently Analagous Threads
- [PATCH v3 0/3] gobject: Remove gtk-doc.
- [PATCH v4 0/3] gobject: Remove gtk-doc (RHBZ#1465665).
- [PATCH v5 0/3] gobject: Remove gtk-doc (RHBZ#1465665).
- [PATCH 0/3] gobject: Remove gtk-doc and replace with guestfs-gobject(3) manual page.
- [PATCH 01/12] configure: Add -nographic command line option to qemu.