[Pkg-libvirt-maintainers] Help needed with building Ruby extensions for hivex, libguestfs

Antonio Terceiro terceiro at debian.org
Sun Aug 28 00:20:04 UTC 2011


Lucas Nussbaum escreveu isso aí:
> On 23/08/11 at 00:35 +0200, Hilko Bengen wrote:
> > Hi,
> > 
> > I'd love to provide ruby-hivex and ruby-guestfs packages, but I need
> > some help with figuring out what needs to be adjusted so that the Ruby
> > bindings can be built in separate builddirs. Working patches would be
> > even better. :-)
> > 
> > Both packages use autoconf to generate the Rakefile at build-time. So
> > far, I haven't been able to figure out how to adjust the paths so that
> > "rake build" will put all newly generated files below @builddir@ and
> > "rake install" will take the files from appropriate locations.
> 
> Hi,
> 
> I've looked at the hivex source package, but couldn't find ruby bindings
> there.
> For guestfs, I'd suggest ignoring the Rakefile completely, and using
> gem2deb to build the extension. I don't think that gem2deb can use a
> different root directly at the moment. Antonio, what do you think?

The problem with the generated Rakefile is that it it hardcodes using `ruby`.
Depending on what your /usr/bin/ruby points to (currently it can be ruby1.8 or
ruby1.9.1), it will only build bindings for that specific version.

gem2deb can't use a different root, but the extension builder will look
for every extconf.rb under the root and build/install it with all
supported Ruby versions.

I would do as Lucas suggested: ignore the upstream Ruby support and
build directly with gem2deb. The attached patches should do the trick. I
couldn't actually test these patches here because the build failed
before that point as follows:

c -I..    -Wall -Wno-unused -fno-strict-aliasing -g -O2 -c -o libprotocol_la-guestfs_protocol.lo `test -f 'guestfs_protocol.c' || echo '../../../src/'`guestfs_protocol.c
guestfs_protocol.c:6:33: fatal error: ../guestfs_protocol.h: No such file or directory
compilation terminated.
make[5]: *** [libprotocol_la-guestfs_protocol.lo] Error 1
make[5]: Leaving directory `/tmp/libguestfs/debian/build-python2.6/src'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/tmp/libguestfs/debian/build-python2.6/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/libguestfs/debian/build-python2.6'
make[2]: ** [all] Erro 2
make[2]: Saindo do diretório `/tmp/libguestfs/debian/build-python2.6'
dh_auto_build: make -j1 INSTALLDIRS=vendor LD_RUN_PATH= returned exit code 2
make[1]: ** [override_dh_auto_build] Erro 2
make[1]: Saindo do diretório `/tmp/libguestfs'
make: ** [build] Erro 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1348:
dpkg-buildpackage -rfakeroot -D -us -uc -i -I failed
gbp:error: debuild -i -I returned 29
gbp:error: Couldn't run 'debuild -i -I -us -uc'

HTH,

-- 
Antonio Terceiro <terceiro at debian.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Custom-CFLAGS-and-LDFLAGS-for-Ruby-build.patch
Type: text/x-diff
Size: 802 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20110827/a3221e40/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Build-Ruby-bindings.patch
Type: text/x-diff
Size: 2892 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20110827/a3221e40/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-libvirt-maintainers/attachments/20110827/a3221e40/attachment.pgp>


More information about the Pkg-libvirt-maintainers mailing list