From 8510c7dfaf593c2eaae9970a41079dca2a009183 Mon Sep 17 00:00:00 2001 From: Anthony PERARD Date: Fri, 29 Jul 2022 14:39:52 +0100 Subject: [PATCH] ts-libvirt-build: Rework to build with meson libvirt have switch build system to Meson + Ninja, there is no more autogen.sh script. Add missing dependency "libtirpc-dev" and "meson". libvirt needs at least meson 0.54, the version avaiable in Debian Buster is too old, but we can install it from backports. In order to find out if Meson is used or not, we'll check if the "autogen.sh" script is missing. And in the build dir, we will look for a "Makefile". Signed-off-by: Anthony PERARD Acked-by: Ian Jackson --- ts-libvirt-build | 70 +++++++++++++++++++++++++++++++++-------------- ts-xen-build-prep | 8 +++++- 2 files changed, 56 insertions(+), 22 deletions(-) diff --git a/ts-libvirt-build b/ts-libvirt-build index e799f00..16b45cf 100755 --- a/ts-libvirt-build +++ b/ts-libvirt-build @@ -50,32 +50,56 @@ sub config() { } die "no xen prefix" unless $xenprefix; - # Uses --no-git because otherwise autogen.sh will undo - # submodulefixup's attempts to honour - # revision_libvirt_gnulib. This in turn requires that we specify - # --gnulib-srcdir, but ./autogen.sh doesn't propagate - # --gnulib-srcdir to ./bootstap so we use GNULIB_SRCDIR directly. - my $gnulib = submodule_find($submodules, "gnulib"); - target_cmd_build($ho, 3600, $builddir, <{Path} \\ - ../autogen.sh --no-git \\ - --with-libxl --without-xen --without-xenapi --without-selinux \\ - --without-lxc --without-vbox --without-uml \\ - --without-qemu --without-openvz --without-vmware \\ - --sysconfdir=/etc --localstatedir=/var #/ + my $cflags = "-g -I$xenprefix/include/"; + my $ldflags = "-g -L$xenprefix/lib/ -Wl,-rpath-link=$xenprefix/lib/"; + my $pkg_config_path = "$xenprefix/lib/pkgconfig/"; + + if (target_file_exists($ho, "$builddir/libvirt/autogen.sh")) { + # Uses --no-git because otherwise autogen.sh will undo + # submodulefixup's attempts to honour + # revision_libvirt_gnulib. This in turn requires that we specify + # --gnulib-srcdir, but ./autogen.sh doesn't propagate + # --gnulib-srcdir to ./bootstap so we use GNULIB_SRCDIR directly. + my $gnulib = submodule_find($submodules, "gnulib"); + target_cmd_build($ho, 3600, $builddir, <{Path} \\ + ../autogen.sh --no-git \\ + --with-libxl --without-xen --without-xenapi --without-selinux \\ + --without-lxc --without-vbox --without-uml \\ + --without-qemu --without-openvz --without-vmware \\ + --sysconfdir=/etc --localstatedir=/var #/ +END + } else { + target_cmd_build($ho, 3600, $builddir, <&1 && touch ../../build-ok-stamp) |tee ../log + if [ -e Makefile ]; then + (make $makeflags 2>&1 && touch ../../build-ok-stamp) |tee ../log + else + (ninja 2>&1 && touch ../../build-ok-stamp) |tee ../log + fi test -f ../../build-ok-stamp #/ echo ok. END @@ -85,7 +109,11 @@ sub install() { target_cmd_build($ho, 300, $builddir, <{Suite} =~ m/squeeze|wheezy|jessie/) { @@ -251,6 +252,11 @@ END target_install_packages($ho, 'libc6-dev-i386'); } + if ($ho->{Suite} =~ m/buster/) { + # libvirt needs a newer version of "meson" + target_install_packages_backport($ho, 'meson'); + } + some_extradebs($ho, [ 'DebianExtraPackages', 'build', $ho->{Suite} ]); } -- 2.39.5