[mutter/wip/carlosg/sound-abstraction: 4/4] build: Make libcanberra no longer optional



commit dcd1ee24db5795fccf2fab344958d39318f7045a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Dec 17 23:52:03 2018 +0100

    build: Make libcanberra no longer optional
    
    This is not the case anymore with MetaSoundPlayer in place, and also
    important to get keyboard bell right.

 config.h.meson             |  3 ---
 configure.ac               | 30 +++++++-----------------------
 meson.build                | 10 ++--------
 meson_options.txt          |  6 ------
 src/meson.build            |  7 +------
 src/x11/meta-x11-display.c |  4 ----
 6 files changed, 10 insertions(+), 50 deletions(-)
---
diff --git a/config.h.meson b/config.h.meson
index af935cdeb..70681d774 100644
--- a/config.h.meson
+++ b/config.h.meson
@@ -28,9 +28,6 @@
 /* Defined if EGLStream support is enabled */
 #mesondefine HAVE_WAYLAND_EGLSTREAM
 
-/* Building with libcanberra for playing sounds */
-#mesondefine HAVE_LIBCANBERRA
-
 /* Building with gudev for device type detection */
 #mesondefine HAVE_LIBGUDEV
 
diff --git a/configure.ac b/configure.ac
index eb61abd08..bd4ca1b99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,8 +74,8 @@ PKG_PROG_PKG_CONFIG([0.21])
 # Sets GLIB_GENMARSHAL and GLIB_MKENUMS
 AM_PATH_GLIB_2_0([2.53.2])
 
-CANBERRA_GTK=libcanberra-gtk3
-CANBERRA_GTK_VERSION=0.26
+CANBERRA=libcanberra
+CANBERRA_VERSION=0.26
 
 LIBWACOM_VERSION=0.13
 
@@ -128,11 +128,6 @@ AC_ARG_ENABLE(startup-notification,
                  [disable mutter's startup notification support, for embedded/size-sensitive custom 
non-GNOME builds]),,
   enable_startup_notification=auto)
 
-AC_ARG_WITH(libcanberra,
-  AC_HELP_STRING([--without-libcanberra],
-                 [disable the use of libcanberra for playing sounds]),,
-  with_libcanberra=auto)
-
 AC_ARG_WITH(libwacom,
   AC_HELP_STRING([--without-libwacom],
                  [disable the use of libwacom for advanced tablet management]),,
@@ -186,22 +181,12 @@ else
   echo "Building without libstartup-notification"
 fi
 
-have_libcanberra=no
-AC_MSG_CHECKING([libcanberra-gtk])
-if test x$with_libcanberra = xno ; then
-  AC_MSG_RESULT([disabled])
+if $PKG_CONFIG --exists $CANBERRA '>=' $CANBERRA_VERSION; then
+  AC_MSG_RESULT(yes)
+  MUTTER_PC_MODULES="$MUTTER_PC_MODULES $CANBERRA"
 else
-  if $PKG_CONFIG --exists $CANBERRA_GTK '>=' $CANBERRA_GTK_VERSION; then
-    have_libcanberra=yes
-    AC_MSG_RESULT(yes)
-    MUTTER_PC_MODULES="$MUTTER_PC_MODULES $CANBERRA_GTK"
-    AC_DEFINE([HAVE_LIBCANBERRA], 1, [Building with libcanberra for playing sounds])
-  else
-    AC_MSG_RESULT(no)
-    if test x$with_libcanberra = xyes ; then
-      AC_MSG_ERROR([libcanberra forced and libcanberra-gtk was not found])
-    fi
-  fi
+  AC_MSG_RESULT(no)
+  AC_MSG_ERROR([libcanberra was not found])
 fi
 
 have_libwacom=no
@@ -544,7 +529,6 @@ mutter-$VERSION
        compiler:                 ${CC}
 
        Startup notification:     ${have_startup_notification}
-       libcanberra:              ${have_libcanberra}
        libwacom:                 ${have_libwacom}
        gudev                     ${have_gudev}
        Introspection:            ${found_introspection}
diff --git a/meson.build b/meson.build
index dbc3a5f0f..dc8a8420c 100644
--- a/meson.build
+++ b/meson.build
@@ -26,7 +26,7 @@ xfixes_req = '>= 3'
 xi_req = '>= 1.6.99.1'
 xrandr_req = '>= 1.5.0'
 libstartup_notification_req = '>= 0.7'
-libcanberra_gtk3_req = '>= 0.26'
+libcanberra_req = '>= 0.26'
 libwacom_req = '>= 0.13'
 atk_req = '>= 2.5.3'
 
@@ -117,6 +117,7 @@ xcb_res_dep = dependency('xcb-res')
 xinerama_dep = dependency('xinerama')
 ice_dep = dependency('ice')
 atk_dep = dependency('atk', version: atk_req)
+libcanberra_dep = dependency('libcanberra', version: libcanberra_req)
 
 # For now always require X11 support
 have_x11 = true
@@ -212,11 +213,6 @@ if have_sm
   sm_dep = dependency('sm')
 endif
 
-have_libcanberra = get_option('libcanberra')
-if have_libcanberra
-  libcanberra_gtk3_dep = dependency('libcanberra-gtk3', version: libcanberra_gtk3_req)
-endif
-
 have_libwacom = get_option('libwacom')
 if have_libwacom
   libwacom_dep = dependency('libwacom', version: libwacom_req)
@@ -287,7 +283,6 @@ cdata.set('HAVE_REMOTE_DESKTOP', have_remote_desktop)
 cdata.set('HAVE_EGL_DEVICE', have_egl_device)
 cdata.set('HAVE_WAYLAND_EGLSTREAM', have_wayland_eglstream)
 cdata.set('HAVE_LIBGUDEV', have_libgudev)
-cdata.set('HAVE_LIBCANBERRA', have_libcanberra)
 cdata.set('HAVE_LIBWACOM', have_libwacom)
 cdata.set('HAVE_SM', have_sm)
 cdata.set('HAVE_STARTUP_NOTIFICATION', have_startup_notification)
@@ -353,7 +348,6 @@ output = [
   '        EGL Device............... ' + have_egl_device.to_string(),
   '        Remote desktop........... ' + have_remote_desktop.to_string(),
   '        gudev.................... ' + have_libgudev.to_string(),
-  '        canberra................. ' + have_libcanberra.to_string(),
   '        Wacom.................... ' + have_libwacom.to_string(),
   '        SM....................... ' + have_sm.to_string(),
   '        Startup notification..... ' + have_startup_notification.to_string(),
diff --git a/meson_options.txt b/meson_options.txt
index 7626661d1..add49c866 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -81,12 +81,6 @@ option('pango_ft2',
   description: 'Enable PangoFt2 support'
 )
 
-option('libcanberra',
-  type: 'boolean',
-  value: true,
-  description: 'Enable libcanberra support'
-)
-
 option('startup_notification',
   type: 'boolean',
   value: true,
diff --git a/src/meson.build b/src/meson.build
index 44816ea27..c97e25775 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -23,6 +23,7 @@ mutter_pkg_deps = [
   json_glib_dep,
   pango_dep,
   xkbcommon_dep,
+  libcanberra_dep,
 ]
 
 if have_gl
@@ -56,12 +57,6 @@ if have_startup_notification
   ]
 endif
 
-if have_libcanberra
-  mutter_pkg_deps += [
-    libcanberra_gtk3_dep,
-  ]
-endif
-
 if have_libwacom
   mutter_pkg_deps += [
     libwacom_dep,
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index 77fb091f6..7a18ea022 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -488,13 +488,9 @@ static void
 set_x11_bell_is_audible (MetaX11Display *x11_display,
                          gboolean is_audible)
 {
-#ifdef HAVE_LIBCANBERRA
   /* When we are playing sounds using libcanberra support, we handle the
    * bell whether its an audible bell or a visible bell */
   gboolean enable_system_bell = FALSE;
-#else
-  gboolean enable_system_bell = is_audible;
-#endif /* HAVE_LIBCANBERRA */
 
   XkbChangeEnabledControls (x11_display->xdisplay,
                             XkbUseCoreKbd,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]