This series for virt-p2v removes the usage of GTK deprecated stuff, and checks for a required Perl module used during build. Tested on: - RHEL 6 (GTK 2) - RHEL 7 (GTK 3) - Fedora 30 (GTK 2 & 3) - Fedora Rawhide/32 (GTK 2 & 3) Pino Toscano (3): Copy GtkAttachOptions from GTK >= 3.4 build: disable deprecated GTK stuff build: require List::MoreUtils Makefile.am | 1 + gui-gtk3-compat.h | 9 +++++++++ m4/p2v-progs.m4 | 8 ++++++++ 3 files changed, 18 insertions(+) -- 2.21.0
Pino Toscano
2019-Aug-30 10:34 UTC
[Libguestfs] [p2v PATCH 1/3] Copy GtkAttachOptions from GTK >= 3.4
GtkAttachOptions is part of GtkTable, which is used only with GTK < 3.4; however, these enum values are used also in the GtkGrid version of the code, so they are needed also when disabling deprecated stuff. As easy solution to make the current code working without deprecated stuff of GTK, copy the GtkAttachOptions enum when using GtkGrid (i.e. with GTK >= 3.4). --- gui-gtk3-compat.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gui-gtk3-compat.h b/gui-gtk3-compat.h index a29e7b4..212c3af 100644 --- a/gui-gtk3-compat.h +++ b/gui-gtk3-compat.h @@ -50,6 +50,15 @@ gdk_event_get_button (const GdkEvent *event, guint *button) #endif #if GTK_CHECK_VERSION(3,4,0) /* gtk >= 3.4 */ +/* Copy this enum from GtkTable, as when building without deprecated + * functions this is not automatically pulled in. + */ +typedef enum +{ + GTK_EXPAND = 1 << 0, + GTK_SHRINK = 1 << 1, + GTK_FILL = 1 << 2 +} GtkAttachOptions; /* GtkGrid is sufficiently similar to GtkTable that we can just * redefine these functions. */ -- 2.21.0
Pino Toscano
2019-Aug-30 10:34 UTC
[Libguestfs] [p2v PATCH 2/3] build: disable deprecated GTK stuff
We are not using deprecated GTK APIs/stuff, so make sure to not accidentally use them, and easily catch more deprecations in the future. --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index d359a5b..b4f0014 100644 --- a/Makefile.am +++ b/Makefile.am @@ -139,6 +139,7 @@ nodist_virt_p2v_SOURCES = \ virt_p2v_CPPFLAGS = \ -DLOCALEBASEDIR=\""$(datadir)/locale"\" \ + -DGTK_DISABLE_DEPRECATED \ -I$(srcdir)/libguestfs \ -I$(srcdir)/miniexpect \ -I$(srcdir)/gnulib/lib -Ignulib/lib -- 2.21.0
Pino Toscano
2019-Aug-30 10:34 UTC
[Libguestfs] [p2v PATCH 3/3] build: require List::MoreUtils
It is used by the generate-p2v-config.pl build script, so make sure to error out earlier when this Perl module is not found. Followup of commit 2ac0713900dc60d9f0fbb8e5234ee41254f03e84. --- m4/p2v-progs.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/m4/p2v-progs.m4 b/m4/p2v-progs.m4 index d54b391..b3d0ce7 100644 --- a/m4/p2v-progs.m4 +++ b/m4/p2v-progs.m4 @@ -58,6 +58,14 @@ else AC_MSG_RESULT([yes]) fi +dnl Check for List::MoreUtils, used by generate-p2v-config.pl +AC_MSG_CHECKING([for List::MoreUtils]) +if ! $PERL -MList::MoreUtils -e1 >&AS_MESSAGE_LOG_FD 2>&1; then + AC_MSG_ERROR([perl List::MoreUtils must be installed]) +else + AC_MSG_RESULT([yes]) +fi + dnl Define the path to the podwrapper program. PODWRAPPER="\$(guestfs_am_v_podwrapper)$PERL $(pwd)/podwrapper.pl" AC_SUBST([PODWRAPPER]) -- 2.21.0
Richard W.M. Jones
2019-Aug-30 10:52 UTC
Re: [Libguestfs] [p2v PATCH 3/3] build: require List::MoreUtils
Yes this series looks good, thanks. Can we put patch 2 into libguestfs as well? (Until or unless we delete p2v from libguestfs) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com 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
Possibly Parallel Threads
- [PATCH 0/6] p2v: make it more independent (part #2)
- [PATCH v3] p2v: Allow virt-p2v to be built with Gtk 2 or 3.
- [p2v PATCH] Use List::MoreUtils instead of List::Util
- [PATCH v2 0/3] p2v: Allow virt-p2v to be built with Gtk 2 or 3.
- How to add widgets of gWidgets to widgets of rgtk2 ???