On Sat, 23 Oct 2021 at 21:53:34 +0100, Simon McVittie wrote:
> I suspect that applying the change from
> https://gitlab.gnome.org/GNOME/gstreamermm/-/merge_requests/4 in
> gstreamermm-1.0 would allow lordsawar to be built successfully against it
> (test-builds in progress).

Yes, confirmed via a test-build of lordsawar. Please consider the attached
patch.

    smcv
>From 699d47eb51831b207a749e4351e3ebc7285a749b Mon Sep 17 00:00:00 2001
From: Simon McVittie <s...@debian.org>
Date: Sat, 23 Oct 2021 21:51:27 +0100
Subject: [PATCH] Add patch from upstream to fix FTBFS of dependent packages

This misuse of 'volatile' caused build failures triggered by gcc 11
and/or GLib 2.68.

Closes: #997238
---
 .../patches/Fix-build-against-glib-2.68.patch | 41 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 debian/patches/Fix-build-against-glib-2.68.patch

diff --git a/debian/patches/Fix-build-against-glib-2.68.patch b/debian/patches/Fix-build-against-glib-2.68.patch
new file mode 100644
index 0000000..2048840
--- /dev/null
+++ b/debian/patches/Fix-build-against-glib-2.68.patch
@@ -0,0 +1,41 @@
+From: Dominique Leuenberger <dims...@opensuse.org>
+Date: Tue, 13 Jul 2021 10:32:30 +0000
+Subject: Fix build against glib 2.68
+
+volatile has been misused in the past
+
+Bug: https://gitlab.gnome.org/GNOME/gstreamermm/-/issues/11
+Bug-Debian: https://bugs.debian.org/997238
+Reference: https://gitlab.gnome.org/GNOME/glib/-/issues/600
+Reference: http://c.isvolatileusefulwiththreads.com/
+---
+ gstreamer/gstreamermm/register.h                    | 2 +-
+ tests/integration/test-integration-seekonstartup.cc | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gstreamer/gstreamermm/register.h b/gstreamer/gstreamermm/register.h
+index db66d17..a7ab3a6 100644
+--- a/gstreamer/gstreamermm/register.h
++++ b/gstreamer/gstreamermm/register.h
+@@ -110,7 +110,7 @@ register_mm_type(const gchar * type_name)
+     /* The typedef for GType may be gulong or gsize, depending on the
+      * system and whether the compiler is c++ or not. The g_once_init_*
+      * functions always take a gsize * though ... */
+-    static volatile gsize gonce_data = 0;
++    static gsize gonce_data = 0;
+     if (g_once_init_enter (&gonce_data)) {
+         GTypeInfo info;
+ 
+diff --git a/tests/integration/test-integration-seekonstartup.cc b/tests/integration/test-integration-seekonstartup.cc
+index 247ac49..cd43a12 100644
+--- a/tests/integration/test-integration-seekonstartup.cc
++++ b/tests/integration/test-integration-seekonstartup.cc
+@@ -18,7 +18,7 @@ RefPtr<Glib::MainLoop> mainloop;
+ RefPtr<Bus> bus;
+ RefPtr<Pipeline> pipeline;
+ RefPtr<Pad> sink_pad;
+-static volatile gint counter;
++static gint counter;
+ bool prerolled = false;
+ gboolean was_check = 0;
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 9a0a29d..3c80c41 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 01-disable-tests.patch
 02-do-not-compile-examples.patch
+Fix-build-against-glib-2.68.patch
-- 
2.33.0

Reply via email to