diff mbox series

[oe,meta-xfce,03/10] xfce4-mount-plugin: Fix build with musl

Message ID 20170322184533.6501-3-raj.khem@gmail.com
State Accepted
Commit 705a86332c1df1746fedb893b62c28c3cbf8faa5
Headers show
Series [oe,meta-gnome,01/10] abiword: Mark gconv dependencies only for glibc | expand

Commit Message

Khem Raj March 22, 2017, 6:45 p.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 .../0001-check-for-fstab.h-during-configure.patch  | 85 ++++++++++++++++++++++
 .../mount/xfce4-mount-plugin_0.6.4.bb              |  2 +
 2 files changed, 87 insertions(+)
 create mode 100644 meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin/0001-check-for-fstab.h-during-configure.patch

-- 
2.12.0

-- 
_______________________________________________
Openembedded-devel mailing list
Openembedded-devel@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
diff mbox series

Patch

diff --git a/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin/0001-check-for-fstab.h-during-configure.patch b/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin/0001-check-for-fstab.h-during-configure.patch
new file mode 100644
index 000000000..dcc2a3719
--- /dev/null
+++ b/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin/0001-check-for-fstab.h-during-configure.patch
@@ -0,0 +1,85 @@ 
+From 09e325f8296eb9e63dc57ed137f4a9940f164563 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 21 Mar 2017 17:11:46 -0700
+Subject: [PATCH] check for fstab.h during configure
+
+fstab.h is not universally available, checking it during
+configure creates a knob to disable fstab reads in the
+plugin
+
+Makes it compile/build with musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac           |  1 +
+ panel-plugin/devices.c | 22 ++++++++++++++++++----
+ 2 files changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 34d6f7f..52ecc4a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,6 +67,7 @@ AC_CHECK_HEADERS([sys/socket.h])
+ AC_CHECK_HEADERS([sys/time.h])
+ AC_CHECK_HEADERS([unistd.h])
+ AC_CHECK_HEADERS([sys/sockio.h])
++AC_CHECK_HEADERS([fstab.h])
+ AC_HEADER_SYS_WAIT
+ AC_PROG_GCC_TRADITIONAL
+ AC_TYPE_SIZE_T
+diff --git a/panel-plugin/devices.c b/panel-plugin/devices.c
+index afa954e..345b603 100644
+--- a/panel-plugin/devices.c
++++ b/panel-plugin/devices.c
+@@ -24,8 +24,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+ #endif
+-
++#if HAVE_FSTAB_H
+ #include <fstab.h>
++#endif
+ #include <glib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -370,14 +371,15 @@ out:
+ GPtrArray *
+ disks_new (gboolean include_NFSs, gboolean *showed_fstab_dialog, gint length)
+ {
+-    GPtrArray * pdisks; /* to be returned */
++    GtkWidget *dialog;
+     t_disk * pdisk;
+-    struct fstab *pfstab;
++    GPtrArray * pdisks; /* to be returned */
+     gboolean has_valid_mount_device;
+-    GtkWidget *dialog;
+ 
+     pdisks = g_ptr_array_new();
++#if HAVE_FSTAB_H
+ 
++    struct fstab *pfstab;
+     /* open fstab */
+     if (setfsent()!=1)
+     {
+@@ -422,6 +424,18 @@ disks_new (gboolean include_NFSs, gboolean *showed_fstab_dialog, gint length)
+ 
+     endfsent(); /* close file */
+ 
++#else
++        if (! (*showed_fstab_dialog) ) {
++            dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
++                                                GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
++    "Your /etc/fstab could not be read because fstab is not supported. This will severely degrade the plugin's abilities.");
++            /* gtk_dialog_run (GTK_DIALOG (dialog)); */
++            g_signal_connect (dialog, "response",
++                    G_CALLBACK (gtk_widget_destroy), dialog);
++             gtk_widget_show (dialog);
++             *showed_fstab_dialog = TRUE;
++         }
++#endif
+     return pdisks;
+ }
+ 
+-- 
+2.12.0
+
diff --git a/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_0.6.4.bb b/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_0.6.4.bb
index 6dc2c1721..2a646eb86 100644
--- a/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_0.6.4.bb
+++ b/meta-xfce/recipes-panel-plugins/mount/xfce4-mount-plugin_0.6.4.bb
@@ -6,5 +6,7 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
 
 inherit xfce-panel-plugin
 
+SRC_URI += "file://0001-check-for-fstab.h-during-configure.patch \
+           "
 SRC_URI[md5sum] = "f5917e9aa2a06bc6a872cc10d2ee4f6f"
 SRC_URI[sha256sum] = "541d7af84d7d0b00ae547aa1f438e2fac51ee4195c4d0a17173c4f72accb227d"