[OE-core] [PATCHv2 2/6] sysprof: use packageconfig for the gui

Christopher Larson kergoth at gmail.com
Fri Nov 13 23:10:40 UTC 2015


From: Christopher Larson <chris_larson at mentor.com>

This makes the gtk dependencies optional.

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
 .../sysprof/files/gui-argument.patch               | 35 ++++++++++++++++++++++
 meta/recipes-kernel/sysprof/sysprof_git.bb         |  9 ++++--
 2 files changed, 41 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-kernel/sysprof/files/gui-argument.patch

diff --git a/meta/recipes-kernel/sysprof/files/gui-argument.patch b/meta/recipes-kernel/sysprof/files/gui-argument.patch
new file mode 100644
index 0000000..ad76b40
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/gui-argument.patch
@@ -0,0 +1,35 @@
+Add the ability to explicitly enable/disable GUI support
+
+Signed-off-by: Christopher Larson <chris_larson at mentor.com>
+Upstream-status: Pending
+
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -62,12 +62,24 @@ KMICRO=`uname -r | cut -d"." -f 3 | cut
+ # Pkgconfig dependencies
+ 
+ core_dep="glib-2.0 >= 2.6.0"
+-gui_dep="gtk+-2.0 > 2.6.0 gdk-pixbuf-2.0 pangoft2 libglade-2.0"
+ 
+ PKG_CHECK_MODULES(CORE_DEP, $core_dep, [], AC_MSG_ERROR([sysprof dependencies not satisfied]))
+ 
+-build_gui=yes
+-PKG_CHECK_MODULES(GUI_DEP, $gui_dep, [], build_gui=no)
++gui_dep="gtk+-2.0 > 2.6.0 gdk-pixbuf-2.0 pangoft2 libglade-2.0"
++
++AC_ARG_ENABLE([gui],
++  [AS_HELP_STRING([--disable-gui],
++    [Disable GUI functionality (requires gtk+, gdk-pixbuf, pangoft2, libglade) @<:@default=auto@:>@])],
++  [],
++  [enable_gui=auto])
++
++build_gui=no
++AS_IF([test "x$enable_gui" != xno],
++  [PKG_CHECK_MODULES(GUI_DEP, $gui_dep, build_gui=yes,
++    [if test "x$enable_gui" != xauto; then
++       AC_MSG_FAILURE(
++         [--enable-gui was given, but gui dependencies were not satisfied])
++     fi])])
+ 
+ AM_CONDITIONAL([BUILD_GUI], [test "$build_gui" = yes])
+ 
diff --git a/meta/recipes-kernel/sysprof/sysprof_git.bb b/meta/recipes-kernel/sysprof/sysprof_git.bb
index 7d87efe..d331a23 100644
--- a/meta/recipes-kernel/sysprof/sysprof_git.bb
+++ b/meta/recipes-kernel/sysprof/sysprof_git.bb
@@ -2,13 +2,14 @@ SUMMARY = "System-wide Performance Profiler for Linux"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
-DEPENDS = "gtk+ libglade"
+DEPENDS = "glib-2.0"
 
 SRCREV = "cd44ee6644c3641507fb53b8a2a69137f2971219"
 PV = "1.2.0+git${SRCPV}"
 
 SRC_URI = "git://git.gnome.org/sysprof \
            file://define-NT_GNU_BUILD_ID.patch \
+           file://gui-argument.patch \
           "
 
 SRC_URI_append_arm  = " file://rmb-arm.patch"
@@ -19,8 +20,10 @@ SRC_URI_append_mips64n32 = " file://rmb-mips.patch"
 
 S = "${WORKDIR}/git"
 
-inherit autotools pkgconfig distro_features_check
-ANY_OF_DISTRO_FEATURES = "${GTK2DISTROFEATURES}"
+inherit autotools pkgconfig
+
+PACKAGECONFIG ?= "${@bb.utils.contains_any('DISTRO_FEATURES', '${GTK2DISTROFEATURES}', 'gui', '', d)}"
+PACKAGECONFIG[gui] = "--enable-gui,--disable-gui,gtk+ libglade"
 
 # We do not yet work for aarch64.
 #
-- 
2.2.1




More information about the Openembedded-core mailing list