Subject: [PATCH gnome-team 6/6] gnu: gst-plugins-base: Fix build.

From: Liliana Marie Prikler <[email-masked]>
Date: Sun, 16 Apr 2023 07:47:00 +0200

* gnu/packages/patches/gst-plugins-base-fix-broken-test.patch: New file.
* gnu/packages/gstreamer.scm (gst-plugins-base)[patches]: Use it here.
* gnu/local.mk (dist_patch_DATA): Register it here.
---
As a follow-up to the master merge, the good, bad, and ugly plugins
as well as gst-editing-services build with this simple trick.

 gnu/local.mk                                  |  1 +
 gnu/packages/gstreamer.scm                    |  3 ++-
 .../gst-plugins-base-fix-broken-test.patch    | 22 +++++++++++++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gst-plugins-base-fix-broken-test.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 72b73761d8..1d7c5696f5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1303,6 +1303,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/guile-present-coding.patch		\
   %D%/packages/patches/guile-rsvg-pkgconfig.patch		\
   %D%/packages/patches/guile-emacs-fix-configure.patch		\
+  %D%/packages/patches/gst-plugins-base-fix-broken-test.patch		\
   %D%/packages/patches/gtk2-fix-builder-test.patch		\
   %D%/packages/patches/gtk2-harden-list-store.patch		\
   %D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch	\
diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm
index 0d051438e3..486ebe6dcd 100644
--- a/gnu/packages/gstreamer.scm
+++ b/gnu/packages/gstreamer.scm
@@ -554,7 +554,8 @@ (define-public gst-plugins-base
                           name "-" version ".tar.xz"))
       (sha256
        (base32
-        "0jcxcx4mgfjvfb3ixibwhx8j330mq3ap469w7hapm6z79q614rgb"))))
+        "0jcxcx4mgfjvfb3ixibwhx8j330mq3ap469w7hapm6z79q614rgb"))
+      (patches (search-patches "gst-plugins-base-fix-broken-test.patch"))))
     (build-system meson-build-system)
     (propagated-inputs
      (list glib                     ;required by gstreamer-sdp-1.0.pc
diff --git a/gnu/packages/patches/gst-plugins-base-fix-broken-test.patch b/gnu/packages/patches/gst-plugins-base-fix-broken-test.patch
new file mode 100644
index 0000000000..2785983d8d
--- /dev/null
+++ b/gnu/packages/patches/gst-plugins-base-fix-broken-test.patch
@@ -0,0 +1,22 @@
+Index: gst-plugins-base-1.22.1/tests/check/libs/allocators.c
+===================================================================
+--- gst-plugins-base-1.22.1.orig/tests/check/libs/allocators.c
++++ gst-plugins-base-1.22.1/tests/check/libs/allocators.c
+@@ -80,7 +80,7 @@ GST_START_TEST (test_fdmem)
+ 
+   alloc = gst_fd_allocator_new ();
+   fail_unless (alloc);
+-  mem = gst_fd_allocator_alloc (alloc, fd, 10, GST_FD_MEMORY_FLAG_KEEP_MAPPED);
++  mem = gst_fd_allocator_alloc (alloc, fd, 10, GST_FD_MEMORY_FLAG_KEEP_MAPPED | GST_FD_MEMORY_FLAG_DONT_CLOSE);
+ 
+   fail_unless (gst_memory_map (mem, &info, GST_MAP_READ));
+   fail_unless (info.data[5] == '5');
+@@ -95,7 +95,7 @@ GST_START_TEST (test_fdmem)
+   gst_memory_unmap (mem, &info);
+ 
+   gst_memory_unref (mem);
+-  fail_unless (g_close (fd, NULL) == 0);
++  fail_unless (g_close (fd, NULL));
+   gst_object_unref (alloc);
+ }
+ 
-- 
2.39.2