Bug#856086: Patch

Yavor Doganov yavor at gnu.org
Sun Oct 21 20:07:15 BST 2018


tags 856086 + patch
tags 848052 + patch
thanks

Attached is a patch which works for me; it replaces
add-esound-as-dependency.patch.  You only have to replace libesd0-dev
with libcanberra-dev in Build-Depends and also remove -lesd from
DEB_LDFLAGS_MAINT_APPEND.
-------------- next part --------------
Description: Remove esound dependency; make sounds playable.
Bug-Debian: https://bugs.debian.org/848052
Bug-Debian: https://bugs.debian.org/856086
Author: Yavor Doganov <yavor at gnu.org>
Forwarded: no
Last-Update: 2018-10-20
---

--- monster-masher-1.8.1.orig/configure.ac
+++ monster-masher-1.8.1/configure.ac
@@ -18,7 +18,8 @@
                         gconfmm-2.6 >= 2.6.0 \
                         gtkmm-2.4 >= 2.6.0 \
                         libgnomecanvasmm-2.6 >= 2.6.0 \
-			libglademm-2.4 >= 2.4.0)
+			libglademm-2.4 >= 2.4.0 \
+			libcanberra)
 AC_SUBST(DEPS_CFLAGS)
 AC_SUBST(DEPS_LIBS)
 
--- monster-masher-1.8.1.orig/src/sound.cpp
+++ monster-masher-1.8.1/src/sound.cpp
@@ -18,8 +18,7 @@
  * USA.
  */
 
-#include <libgnome/gnome-sound.h>
-#include <esd.h>
+#include <canberra.h>
 
 #include "sound.hpp"
 
@@ -40,16 +39,11 @@
 
 void Sound::play(const std::string &name)
 {
-  int id;
-  
-  cache_map::iterator i = cache.find(name);
-  if (i != cache.end())
-    id = i->second;
-  else {
-    id = gnome_sound_sample_load(name.c_str(),
-			    (MONSTER_MASHER_SOUND_DIR + name).c_str());
-    cache.insert(make_pair(name, id));
-  }
+  static ca_context *ctxt = NULL;
 
-  esd_sample_play(gnome_sound_connection_get(), id);
+  if (!ctxt)
+    ca_context_create(&ctxt);
+
+  ca_context_play(ctxt, 0, CA_PROP_MEDIA_FILENAME,
+                  (MONSTER_MASHER_SOUND_DIR + name).c_str(), NULL);
 }
--- monster-masher-1.8.1.orig/src/sound.hpp
+++ monster-masher-1.8.1/src/sound.hpp
@@ -38,9 +38,6 @@
   
 private:
   Sound();
-  
-  typedef std::map<std::string, int> cache_map;
-  cache_map cache;
 };
 
 #endif


More information about the Pkg-games-devel mailing list