[PATCH v3 02/20] gstreamer1.0: Fix reproducibility issue around libcap

Jose Quaresma
2020-10-18T12:10:23Z

Currently gstreamer configuration depends libcap and on whether
setcap is found on the host system.

Removing libcap from DEPENDS and only use it when the 'setcap' is enabled.

* 0004-capfix.patch
Removed as the same goals can be achieved only with the PACKAGECONFIG 'setcap'

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
.../gstreamer/gstreamer1.0/0004-capfix.patch | 48 -------------------
.../gstreamer/gstreamer1.0_1.18.0.bb | 4 +-
2 files changed, 2 insertions(+), 50 deletions(-)
delete mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0/0004-capfix.patch

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0004-capfix.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0004-capfix.patch
deleted file mode 100644
index 32e9610cff..0000000000
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0004-capfix.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 9607e9858d681f5ad2e1677f5dbbb1fb61bd8846 Mon Sep 17 00:00:00 2001
-From: Jose Quaresma <quaresma.jose@gmail.com>
-Date: Sun, 18 Oct 2020 10:40:59 +0100
-Subject: [PATCH 4/4] Currently gstreamer configuration depends on whether
- setcap is found on the host system. Turn this into a configure option to make
- builds deterinistic.
-
-RP 2020/2/19
-Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-Upstream-Status: Pending
----
- libs/gst/helpers/meson.build | 7 ++++++-
- meson_options.txt | 1 +
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
-diff --git a/libs/gst/helpers/meson.build b/libs/gst/helpers/meson.build
-index 9e5a4ae..c2e540f 100644
---- a/libs/gst/helpers/meson.build
-+++ b/libs/gst/helpers/meson.build
-@@ -66,7 +66,12 @@ if have_ptp
- description : 'getifaddrs() and AF_LINK is available')
- endif
-
-- setcap_prog = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
-+ setcap_feature = get_option('setcap')
-+ if setcap_feature.disabled()
-+ setcap_prog = find_program('dontexist', required : false)
-+ else
-+ setcap_prog = find_program('setcap', '/usr/sbin/setcap', '/sbin/setcap', required : false)
-+ endif
- cap_dep = dependency('libcap', required: false)
-
- # user/group to change to in gst-ptp-helper
-diff --git a/meson_options.txt b/meson_options.txt
-index 346c423..03338ad 100644
---- a/meson_options.txt
-+++ b/meson_options.txt
-@@ -25,6 +25,7 @@ option('libdw', type : 'feature', value : 'auto', description : 'Use libdw to ge
- option('dbghelp', type : 'feature', value : 'auto', description : 'Use dbghelp to generate backtraces')
- option('bash-completion', type : 'feature', value : 'auto', description : 'Install bash completion files')
- option('coretracers', type : 'feature', value : 'auto', description : 'Build coretracers plugin')
-+option('setcap', type : 'feature', value : 'auto', description : 'Use setcap')
-
- # Common feature options
- option('examples', type : 'feature', value : 'auto', yield : true)
---
-2.28.0
-
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.18.0.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.18.0.bb
index 8f7dfc6079..d382655bcb 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.18.0.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.18.0.bb
@@ -6,7 +6,7 @@ BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
SECTION = "multimedia"
LICENSE = "LGPLv2+"

-DEPENDS = "glib-2.0 glib-2.0-native libcap libxml2 bison-native flex-native"
+DEPENDS = "glib-2.0 glib-2.0-native libxml2 bison-native flex-native"

inherit meson pkgconfig gettext upstream-version-is-even gobject-introspection

@@ -36,7 +36,7 @@ PACKAGECONFIG[unwind] = "-Dlibunwind=enabled,-Dlibunwind=disabled,libunwind"
PACKAGECONFIG[dw] = "-Dlibdw=enabled,-Dlibdw=disabled,elfutils"
PACKAGECONFIG[bash-completion] = "-Dbash-completion=enabled,-Dbash-completion=disabled,bash-completion"
PACKAGECONFIG[tools] = "-Dtools=enabled,-Dtools=disabled"
-PACKAGECONFIG[setcap] = "-Dsetcap=enabled,-Dsetcap=disabled,libcap libcap-native"
+PACKAGECONFIG[setcap] = ",,libcap libcap-native"

# TODO: put this in a gettext.bbclass patch
def gettext_oemeson(d):
--
2.28.0