commit b6cafa71e86691332a4ad553f9f86ef5c77d08de Author: EnumDev Date: Thu May 8 17:14:40 2025 +0300 Initial Commit diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..41138d9 --- /dev/null +++ b/pkg.info @@ -0,0 +1,10 @@ +name: libcanberra +description: Implementation of the XDG Sound Theme and Name Specifications +version: 0.30 +url: https://0pointer.net/lennart/projects/libcanberra/ +license: LGPL2.1-or-later +architecture: any +depends: ["alsa-lib","libtool","libvorbis","pulseaudio","sound-theme-freedesktop"] +optional_depends: ["gtk2"] +make_depends: ["gtk2","gtk3"] +type: source diff --git a/source-files/wayland-crash-fix.patch b/source-files/wayland-crash-fix.patch new file mode 100644 index 0000000..9196ad6 --- /dev/null +++ b/source-files/wayland-crash-fix.patch @@ -0,0 +1,77 @@ +Submitted by: Xi Ruoyao +Date: 2020-09-21 +Initial Package Version: 0.30 +Upstream Status: Commited +Origin: Upstream Git Repository +Description: Fix a bug crashing some applications in Wayland desktops. + +From c0620e432650e81062c1967cc669829dbd29b310 Mon Sep 17 00:00:00 2001 +From: Michael Meeks +Date: Fri, 9 Nov 2012 16:16:40 +0000 +Subject: gtk: Don't assume all GdkDisplays are GdkX11Displays: + broadway/wayland + +--- + src/canberra-gtk-module.c | 15 +++++++++++++++ + src/canberra-gtk.c | 5 +++++ + 2 files changed, 20 insertions(+) + +diff --git a/src/canberra-gtk-module.c b/src/canberra-gtk-module.c +index 67791f0..c1532ab 100644 +--- a/src/canberra-gtk-module.c ++++ b/src/canberra-gtk-module.c +@@ -307,6 +307,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +@@ -335,6 +340,11 @@ static gint display_get_desktop(GdkDisplay *d) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), DefaultRootWindow(GDK_DISPLAY_XDISPLAY(d)), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_CURRENT_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +@@ -365,6 +375,11 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) { + gboolean ret = FALSE; + Atom xembed; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return FALSE; ++#endif ++ + /* Gnome Panel applets are XEMBED windows. We need to make sure we + * ignore them */ + +diff --git a/src/canberra-gtk.c b/src/canberra-gtk.c +index 34446f5..08cb668 100644 +--- a/src/canberra-gtk.c ++++ b/src/canberra-gtk.c +@@ -185,6 +185,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +-- +cgit v1.2.1 + diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..8dad1b2 --- /dev/null +++ b/source.sh @@ -0,0 +1,32 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +DOWNLOAD="https://0pointer.de/lennart/projects/libcanberra/libcanberra-${BPM_PKG_VERSION}.tar.xz" +FILENAME="${DOWNLOAD##*/}" + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + wget "$DOWNLOAD" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + + cd "$BPM_SOURCE" + # Apply wayland crash patch from BLFS + patch -Np1 -i "$BPM_WORKDIR"/wayland-crash-fix.patch +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + ./configure --prefix=/usr --disable-oss + make +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + make -j1 DESTDIR="$BPM_OUTPUT" install + + install -Dm644 "$BPM_SOURCE"/LGPL "$BPM_OUTPUT"/usr/share/licenses/libcanberra/LGPL +}