Hilko Bengen
2013-Mar-07 18:59 UTC
[Libguestfs] Fixes from the patch queue of the Debian package
Here are three patches that fix issues with out-of-tree building and one that uses Ruby's own autoconf stuff for determining how Ruby bindings should be built. Cheers, -Hilko
Hilko Bengen
2013-Mar-07 18:59 UTC
[Libguestfs] [PATCH 1/4] out-of-tree build: don't distribute extconf.rb.in template, use generated exconf.rb
Apparently, the file will only be autogenerated in $(builddir) if it is not already present in $(srcdir). --- ruby/Makefile.am | 1 - ruby/Rakefile.in | 2 +- ruby/ext/guestfs/extconf.rb.in | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ruby/Makefile.am b/ruby/Makefile.am index 5b755e5..2ecb6a8 100644 --- a/ruby/Makefile.am +++ b/ruby/Makefile.am @@ -29,7 +29,6 @@ EXTRA_DIST = \ Rakefile.in \ README.rdoc \ doc/site/index.html \ - ext/guestfs/extconf.rb \ lib/guestfs.rb \ run-bindtests \ run-ruby-tests \ diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in index f832abd..a74e191 100644 --- a/ruby/Rakefile.in +++ b/ruby/Rakefile.in @@ -39,7 +39,7 @@ end PKG_NAME='@PACKAGE_NAME@' PKG_VERSION='@PACKAGE_VERSION@' -EXT_CONF='@abs_srcdir@/ext/guestfs/extconf.rb' +EXT_CONF='@abs_builddir@/ext/guestfs/extconf.rb' MAKEFILE='@builddir@/ext/guestfs/Makefile' GUESTFS_MODULE='@builddir@/ext/guestfs/_guestfs.so' GUESTFS_SRC='@srcdir@/ext/guestfs/_guestfs.c' diff --git a/ruby/ext/guestfs/extconf.rb.in b/ruby/ext/guestfs/extconf.rb.in index e358551..b8bd74a 100644 --- a/ruby/ext/guestfs/extconf.rb.in +++ b/ruby/ext/guestfs/extconf.rb.in @@ -34,4 +34,4 @@ $CFLAGS "@WARN_CFLAGS@ @WERROR_CFLAGS@" create_header -create_makefile(extension_name) +create_makefile(extension_name, "@abs_srcdir@") -- 1.7.10.4
Hilko Bengen
2013-Mar-07 18:59 UTC
[Libguestfs] [PATCH 2/4] Move Ruby-related checks from autoconf to extconf.rb; add extra check for rb_alloc_func_t
Ruby ships its own config.h which may or may not define the same relevant constants as our autoconf-generated config.h. Instead of trying to specify the exact path to the wanted header file we may just as well simply use Ruby's autoconf-inspired checks and macros. --- configure.ac | 8 -------- generator/ruby.ml | 5 +++-- ruby/ext/guestfs/extconf.rb.in | 4 ++++ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 6ecaf0c..6ed3609 100644 --- a/configure.ac +++ b/configure.ac @@ -1168,14 +1168,6 @@ AS_IF([test "x$enable_ruby" != "xno"],[ AC_MSG_RESULT([-l$libruby]) AC_CHECK_LIB([$libruby],[ruby_init], [have_libruby=1],[have_libruby=]) - - dnl Symbols that we substitute when missing. - AS_IF([test -n "$have_libruby"],[ - old_LIBS="$LIBS" - LIBS="$LIBS -l$libruby" - AC_CHECK_FUNCS([rb_hash_lookup]) - LIBS="$old_LIBS" - ]) ],[ AC_MSG_RESULT([not found]) ]) diff --git a/generator/ruby.ml b/generator/ruby.ml index 27f689b..573f172 100644 --- a/generator/ruby.ml +++ b/generator/ruby.ml @@ -35,8 +35,6 @@ let rec generate_ruby_c () generate_header CStyle LGPLv2plus; pr "\ -#include <config.h> - #include <stdio.h> #include <stdlib.h> #include <stdint.h> @@ -700,6 +698,9 @@ Init__guestfs (void) e_Error = rb_define_class_under (m_guestfs, \"Error\", rb_eStandardError); #ifdef HAVE_RB_DEFINE_ALLOC_FUNC +#ifndef HAVE_TYPE_RB_ALLOC_FUNC_T +#define rb_alloc_func_t void* +#endif rb_define_alloc_func (c_guestfs, (rb_alloc_func_t) ruby_guestfs_create); #endif diff --git a/ruby/ext/guestfs/extconf.rb.in b/ruby/ext/guestfs/extconf.rb.in index b8bd74a..e049efb 100644 --- a/ruby/ext/guestfs/extconf.rb.in +++ b/ruby/ext/guestfs/extconf.rb.in @@ -33,5 +33,9 @@ $CFLAGS "#{$CFLAGS} @CFLAGS@ -DGUESTFS_PRIVATE=1 " << "@WARN_CFLAGS@ @WERROR_CFLAGS@" +have_func("rb_hash_lookup") +have_func("rb_define_alloc_func") +have_type("rb_alloc_func_t") + create_header create_makefile(extension_name, "@abs_srcdir@") -- 1.7.10.4
Hilko Bengen
2013-Mar-07 18:59 UTC
[Libguestfs] [PATCH 3/4] out-of-tree build: fix building Perl bindings
--- perl/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/perl/Makefile.am b/perl/Makefile.am index b0f9b5c..750cc22 100644 --- a/perl/Makefile.am +++ b/perl/Makefile.am @@ -64,6 +64,8 @@ all: Makefile-pl src_deps $(MAKE) -f Makefile-pl Makefile-pl: Makefile.PL + # This hack is only used for out-of-tree builds + -[ $(srcdir) != $(builddir) ] && cp -rsu $(abs_srcdir)/. $(builddir)/. perl Makefile.PL INSTALLDIRS=$(INSTALLDIRS) PREFIX=$(prefix) # No! Otherwise it is deleted before the clean-local rule runs. -- 1.7.10.4
Hilko Bengen
2013-Mar-07 18:59 UTC
[Libguestfs] [PATCH 4/4] out-of-tree build: Fix localized manpages
--- po-docs/Makefile.am | 6 +++--- po-docs/ja/Makefile.am | 16 ++++++++-------- po-docs/uk/Makefile.am | 16 ++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/po-docs/Makefile.am b/po-docs/Makefile.am index b532683..1b1da88 100644 --- a/po-docs/Makefile.am +++ b/po-docs/Makefile.am @@ -51,15 +51,15 @@ libguestfs-docs.pot: po4a.conf --msgid-bugs-address libguestfs at redhat.com \ --copyright-holder "Red Hat Inc." \ po4a.conf - for f in `find $(linguas) -name '*.pod' -o -name '*.pl'`; do \ + for f in `cd $(srcdir); find $(linguas) -name '*.pod' -o -name '*.pl'`; do \ echo '=encoding utf8' > $$f.new; \ - awk 'FNR >= 14 { print }' < $$f >> $$f.new; \ + awk 'FNR >= 14 { print }' < $(srcdir)/$$f >> $$f.new; \ mv $$f.new $$f; \ done po4a.conf: podfiles rm -f $@-t - echo "[po_directory] ." >> $@-t + echo "[po_directory] $(srcdir)" >> $@-t echo >> $@-t for f in `cat podfiles`; do \ b=`basename -- $$f`; \ diff --git a/po-docs/ja/Makefile.am b/po-docs/ja/Makefile.am index 748ae5e..86991e9 100644 --- a/po-docs/ja/Makefile.am +++ b/po-docs/ja/Makefile.am @@ -66,7 +66,7 @@ MANPAGES = \ virt-tar-out.1 \ virt-win-reg.1 -podfiles := $(shell for f in `cat ../podfiles`; do basename $$f; done) +podfiles := $(shell for f in `cat $(top_srcdir)/po-docs/podfiles`; do basename $$f; done) # Ship the POD files and the translated manpages in the tarball. This # just simplifies building from the tarball, at a small cost in extra @@ -83,9 +83,9 @@ guestfs.3: guestfs.pod guestfs-actions.pod guestfs-availability.pod guestfs-stru --man $@ \ --section 3 \ --license LGPLv2+ \ - --insert $(srcdir)/guestfs-actions.pod:__ACTIONS__ \ - --insert $(srcdir)/guestfs-availability.pod:__AVAILABILITY__ \ - --insert $(srcdir)/guestfs-structs.pod:__STRUCTS__ \ + --insert $(builddir)/guestfs-actions.pod:__ACTIONS__ \ + --insert $(builddir)/guestfs-availability.pod:__AVAILABILITY__ \ + --insert $(builddir)/guestfs-structs.pod:__STRUCTS__ \ $< guestfish.1: guestfish.pod guestfish-actions.pod guestfish-commands.pod @@ -93,8 +93,8 @@ guestfish.1: guestfish.pod guestfish-actions.pod guestfish-commands.pod --no-strict-checks \ --man $@ \ --license GPLv2+ \ - --insert $(srcdir)/guestfish-actions.pod:__ACTIONS__ \ - --insert $(srcdir)/guestfish-commands.pod:__FISH_COMMANDS__ \ + --insert $(builddir)/guestfish-actions.pod:__ACTIONS__ \ + --insert $(builddir)/guestfish-commands.pod:__FISH_COMMANDS__ \ $< virt-sysprep.1: virt-sysprep.pod sysprep-extra-options.pod sysprep-operations.pod @@ -102,8 +102,8 @@ virt-sysprep.1: virt-sysprep.pod sysprep-extra-options.pod sysprep-operations.po --no-strict-checks \ --man $@ \ --license GPLv2+ \ - --insert sysprep-extra-options.pod:__EXTRA_OPTIONS__ \ - --insert sysprep-operations.pod:__OPERATIONS__ \ + --insert $(builddir)/sysprep-extra-options.pod:__EXTRA_OPTIONS__ \ + --insert $(builddir)/sysprep-operations.pod:__OPERATIONS__ \ $< %.1: %.pod diff --git a/po-docs/uk/Makefile.am b/po-docs/uk/Makefile.am index 748ae5e..86991e9 100644 --- a/po-docs/uk/Makefile.am +++ b/po-docs/uk/Makefile.am @@ -66,7 +66,7 @@ MANPAGES = \ virt-tar-out.1 \ virt-win-reg.1 -podfiles := $(shell for f in `cat ../podfiles`; do basename $$f; done) +podfiles := $(shell for f in `cat $(top_srcdir)/po-docs/podfiles`; do basename $$f; done) # Ship the POD files and the translated manpages in the tarball. This # just simplifies building from the tarball, at a small cost in extra @@ -83,9 +83,9 @@ guestfs.3: guestfs.pod guestfs-actions.pod guestfs-availability.pod guestfs-stru --man $@ \ --section 3 \ --license LGPLv2+ \ - --insert $(srcdir)/guestfs-actions.pod:__ACTIONS__ \ - --insert $(srcdir)/guestfs-availability.pod:__AVAILABILITY__ \ - --insert $(srcdir)/guestfs-structs.pod:__STRUCTS__ \ + --insert $(builddir)/guestfs-actions.pod:__ACTIONS__ \ + --insert $(builddir)/guestfs-availability.pod:__AVAILABILITY__ \ + --insert $(builddir)/guestfs-structs.pod:__STRUCTS__ \ $< guestfish.1: guestfish.pod guestfish-actions.pod guestfish-commands.pod @@ -93,8 +93,8 @@ guestfish.1: guestfish.pod guestfish-actions.pod guestfish-commands.pod --no-strict-checks \ --man $@ \ --license GPLv2+ \ - --insert $(srcdir)/guestfish-actions.pod:__ACTIONS__ \ - --insert $(srcdir)/guestfish-commands.pod:__FISH_COMMANDS__ \ + --insert $(builddir)/guestfish-actions.pod:__ACTIONS__ \ + --insert $(builddir)/guestfish-commands.pod:__FISH_COMMANDS__ \ $< virt-sysprep.1: virt-sysprep.pod sysprep-extra-options.pod sysprep-operations.pod @@ -102,8 +102,8 @@ virt-sysprep.1: virt-sysprep.pod sysprep-extra-options.pod sysprep-operations.po --no-strict-checks \ --man $@ \ --license GPLv2+ \ - --insert sysprep-extra-options.pod:__EXTRA_OPTIONS__ \ - --insert sysprep-operations.pod:__OPERATIONS__ \ + --insert $(builddir)/sysprep-extra-options.pod:__EXTRA_OPTIONS__ \ + --insert $(builddir)/sysprep-operations.pod:__OPERATIONS__ \ $< %.1: %.pod -- 1.7.10.4
I only found out about libguestfs-make-fixed-appliance after dh_install --fail-missing complained about localized manpages. So here are two more patches for small issues found while packaging libguestfs for Debian. Cheers, -Hilko
Hilko Bengen
2013-Mar-07 21:15 UTC
[Libguestfs] [PATCH 2/2] out-of-tree build: Fix link creation
--- appliance/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appliance/Makefile.am b/appliance/Makefile.am index 187865e..9c85c69 100644 --- a/appliance/Makefile.am +++ b/appliance/Makefile.am @@ -108,7 +108,7 @@ supermin.d/udev-rules.img: 99-guestfs-serial.rules rm -f $@ $@-t rm -rf tmp-u mkdir -p tmp-u/etc/udev/rules.d - for f in $^; do ln $$f tmp-u/etc/udev/rules.d/$$f; done + for f in $^; do ln $$f tmp-u/etc/udev/rules.d/$$(basename $$f); done ( cd tmp-u && find | cpio --quiet -o -H newc ) > $@-t rm -rf tmp-u mv $@-t $@ -- 1.7.10.4
Richard W.M. Jones
2013-Mar-07 21:23 UTC
[Libguestfs] Fixes from the patch queue of the Debian package
On Thu, Mar 07, 2013 at 07:59:24PM +0100, Hilko Bengen wrote:> Here are three patches that fix issues with out-of-tree building and > one that uses Ruby's own autoconf stuff for determining how Ruby > bindings should be built.Thanks for posting these, and if Debian are maintaining any out-of-tree patches that you think should go upstream, please post them any time you like! 3/4 looks like a hack, so I didn't apply that. 2/4 gives me this failure: _guestfs.c: In function 'rb_hash_lookup': _guestfs.c:76:30: error: 'struct RHash' has no member named 'tbl' _guestfs.c:76:19: error: passing argument 3 of 'st_lookup' discards 'volatile' qualifier from pointer target type [-Werror] In file included from /usr/include/ruby/intern.h:34:0, from /usr/include/ruby/ruby.h:1382, from /usr/include/ruby.h:32, from _guestfs.c:31: /usr/include/ruby/st.h:114:5: note: expected 'st_data_t *' but argument is of type 'volatile VALUE *' cc1: all warnings being treated as errors make[3]: *** [_guestfs.o] Error 1 However I have applied and will shortly push the other two. Thanks again, Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
Apparently Analagous Threads
- Some fixes for building the Debian package for 1.20.2
- [PATCH v2 0/3] options: Describe --key SELECTOR in a single file.
- [PATCH libguestfs 0/3] options: Describe --key SELECTOR in a single file.
- [PATCH 1/2] podcheck: __INCLUDE:file.pod__ and __VERBATIM:file.txt__ in POD files.
- [PATCH 1/2] build: isolate common po-docs logic