summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-multimedia/mplayer/mpv/0001-file2string-Avoid-emitting-absolute-filepaths-into-g.patch33
-rw-r--r--meta-oe/recipes-multimedia/mplayer/mpv/a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54.patch87
-rw-r--r--meta-oe/recipes-multimedia/mplayer/mpv_0.39.0.bb (renamed from meta-oe/recipes-multimedia/mplayer/mpv_0.38.0.bb)34
3 files changed, 103 insertions, 51 deletions
diff --git a/meta-oe/recipes-multimedia/mplayer/mpv/0001-file2string-Avoid-emitting-absolute-filepaths-into-g.patch b/meta-oe/recipes-multimedia/mplayer/mpv/0001-file2string-Avoid-emitting-absolute-filepaths-into-g.patch
deleted file mode 100644
index b96ec5d4c4..0000000000
--- a/meta-oe/recipes-multimedia/mplayer/mpv/0001-file2string-Avoid-emitting-absolute-filepaths-into-g.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 9878681df9919d28da3e4c6cc706e264abd9df92 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 29 Aug 2024 17:54:15 -0700
4Subject: [PATCH] file2string: Avoid emitting absolute filepaths into generated
5 sources
6
7These sources are bundled into src packages to be distributed and leaking
8buildpaths results in violating reproducibility norms.
9
10Upstream-Status: Submitted [https://github.com/mpv-player/mpv/pull/14763]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 TOOLS/file2string.py | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/TOOLS/file2string.py b/TOOLS/file2string.py
18index 5b1c4a95d1..39c1122a35 100755
19--- a/TOOLS/file2string.py
20+++ b/TOOLS/file2string.py
21@@ -22,10 +22,10 @@
22 # License along with mpv. If not, see <http://www.gnu.org/licenses/>.
23 #
24
25-import sys
26+import os, sys
27
28 def file2string(infilename, infile, outfile):
29- outfile.write("// Generated from %s\n\n" % infilename)
30+ outfile.write("// Generated from %s\n\n" % os.path.basename(infilename))
31
32 conv = ["\\%03o" % c for c in range(256)]
33 safe_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" \
diff --git a/meta-oe/recipes-multimedia/mplayer/mpv/a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54.patch b/meta-oe/recipes-multimedia/mplayer/mpv/a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54.patch
new file mode 100644
index 0000000000..b8fad22c72
--- /dev/null
+++ b/meta-oe/recipes-multimedia/mplayer/mpv/a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54.patch
@@ -0,0 +1,87 @@
1From a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com>
3Date: Sun, 13 Oct 2024 19:18:11 +0200
4Subject: [PATCH] build: fix dynamic generation of mpv.desktop file protocols
5
6Running cross-compiled binaries may be possible, but the runtime
7environment must be configured correctly. In some configurations, an
8exe_wrapper needs to be used, and in all cases, the library path must be
9set correctly for the given binary. Fortunately, Meson handles all of
10this if cross-compilation is configured correctly.
11
12Fix this by having Meson run the mpv binary directly, instead of as a
13subprocess of a Python script. This ensures that the environment is
14properly set for running host binaries, if possible.
15
16Fixes: #15075
17Fixes: 056b03f9ed05607786427da8f336e3ef819b3a1e
18
19Upstream-Status: Submitted [https://github.com/mpv-player/mpv/pull/15075]
20
21Signed-off-by: Markus Volk <f_l_k@t-online.de>
22---
23 TOOLS/gen-mpv-desktop.py | 17 +++++++----------
24 meson.build | 9 +++++++--
25 2 files changed, 14 insertions(+), 12 deletions(-)
26
27diff --git a/TOOLS/gen-mpv-desktop.py b/TOOLS/gen-mpv-desktop.py
28index 7bbb33e5be..2c45a7038e 100755
29--- a/TOOLS/gen-mpv-desktop.py
30+++ b/TOOLS/gen-mpv-desktop.py
31@@ -21,23 +21,28 @@
32 #
33
34 import sys
35-from subprocess import check_output
36
37 if __name__ == "__main__":
38- with open(sys.argv[1], "r", encoding="UTF-8") as f:
39+ with open(sys.argv[1], encoding="UTF-8") as f:
40 next(f)
41 mpv_desktop = dict([line.split("=", 1) for line in f])
42
43 if not mpv_desktop["X-KDE-Protocols"]:
44 raise ValueError("Missing X-KDE-Protocols entry in mpv.desktop file")
45
46- mpv_protocols = check_output([sys.argv[2], "--no-config", "--list-protocols"], encoding="UTF-8")
47- mpv_protocols = set(line.strip(" :/") for line in mpv_protocols.splitlines() if "://" in line)
48+ with open(sys.argv[2], encoding="UTF-8") as mpv_protocols:
49+ mpv_protocols = {
50+ line.strip(" :/")
51+ for line in mpv_protocols.read().splitlines()
52+ if "://" in line
53+ }
54+
55 if len(mpv_protocols) == 0:
56 raise ValueError("Unable to parse any protocols from mpv '--list-protocols'")
57
58 protocol_list = set(mpv_desktop["X-KDE-Protocols"].strip().split(","))
59- mpv_desktop["X-KDE-Protocols"] = ",".join(sorted(mpv_protocols & protocol_list)) + "\n"
60+ compatible_protocols = sorted(mpv_protocols & protocol_list)
61+ mpv_desktop["X-KDE-Protocols"] = ",".join(compatible_protocols) + "\n"
62
63 with open(sys.argv[3], "w", encoding="UTF-8") as f:
64 f.write("[Desktop Entry]" + "\n")
65diff --git a/meson.build b/meson.build
66index b7bcb1b0ba..c2004b748c 100644
67--- a/meson.build
68+++ b/meson.build
69@@ -1830,11 +1830,16 @@ if get_option('cplayer')
70
71 if not win32 and not darwin
72 if meson.can_run_host_binaries()
73+ mpv_protocols = custom_target('mpv_protocols',
74+ output: 'mpv_protocols',
75+ command: [mpv, '--no-config','--list-protocols'],
76+ capture: true,
77+ )
78 mpv_desktop_path = join_paths(source_root, 'etc', 'mpv.desktop')
79 custom_target('mpv.desktop',
80- depends: mpv,
81+ input: mpv_protocols,
82 output: 'mpv.desktop',
83- command: [mpv_desktop, mpv_desktop_path, mpv.full_path(), '@OUTPUT@'],
84+ command: [mpv_desktop, mpv_desktop_path, '@INPUT@', '@OUTPUT@'],
85 install: true,
86 install_dir: join_paths(datadir, 'applications'),
87 )
diff --git a/meta-oe/recipes-multimedia/mplayer/mpv_0.38.0.bb b/meta-oe/recipes-multimedia/mplayer/mpv_0.39.0.bb
index 80e0f7ca7d..c97252bd30 100644
--- a/meta-oe/recipes-multimedia/mplayer/mpv_0.38.0.bb
+++ b/meta-oe/recipes-multimedia/mplayer/mpv_0.39.0.bb
@@ -15,11 +15,11 @@ DEPENDS = " \
15LICENSE = "GPL-2.0-or-later" 15LICENSE = "GPL-2.0-or-later"
16LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" 16LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"
17 17
18SRCREV_mpv = "02254b92dd237f03aa0a151c2a68778c4ea848f9" 18SRCREV = "a0fba7be57f3822d967b04f0f6b6d6341e7516e7"
19SRC_URI = "git://github.com/mpv-player/mpv;name=mpv;branch=release/0.38;protocol=https \ 19SRC_URI = " \
20 file://0001-file2string-Avoid-emitting-absolute-filepaths-into-g.patch \ 20 git://github.com/mpv-player/mpv;name=mpv;branch=release/0.39;protocol=https \
21 " 21 file://a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54.patch \
22 22"
23S = "${WORKDIR}/git" 23S = "${WORKDIR}/git"
24 24
25inherit meson pkgconfig mime-xdg 25inherit meson pkgconfig mime-xdg
@@ -37,21 +37,25 @@ LUA:powerpc = ""
37# Note: lua is required to get on-screen-display (controls) 37# Note: lua is required to get on-screen-display (controls)
38PACKAGECONFIG ??= " \ 38PACKAGECONFIG ??= " \
39 ${LUA} \ 39 ${LUA} \
40 ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \ 40 ${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland opengl pipewire pulseaudio vulkan', d)} \
41 ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \ 41 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl wayland', 'egl', '', d)} \
42 ${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)} \ 42 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'drm gbm', '', d)} \
43" 43"
44 44
45PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 xsp libxv libxscrnsaver libxinerama libxpresent libxext" 45PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 xsp libxv libxscrnsaver libxinerama libxpresent libxext"
46PACKAGECONFIG[xv] = "-Dxv=enabled,-Dxv=disabled,libxv" 46PACKAGECONFIG[xv] = "-Dxv=enabled,-Dxv=disabled,libxv"
47PACKAGECONFIG[opengl] = "-Dgl=enabled,-Dgl=disabled,virtual/libgl" 47PACKAGECONFIG[opengl] = "-Dgl=enabled,-Dgl=disabled,virtual/libgl"
48PACKAGECONFIG[egl] = "-Degl=enabled,-Degl-disabled,virtual/egl" 48PACKAGECONFIG[egl] = "-Degl=enabled,-Degl=disabled,virtual/egl"
49PACKAGECONFIG[drm] = "-Ddrm=enabled,-Ddrm=disabled,libdrm" 49PACKAGECONFIG[drm] = "-Ddrm=enabled,-Ddrm=disabled,libdrm"
50PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled,virtual/libgbm" 50PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled,virtual/libgbm"
51PACKAGECONFIG[lua] = "-Dlua=luajit,-Dlua=disabled,lua luajit" 51PACKAGECONFIG[lua] = "-Dlua=luajit,-Dlua=disabled,luajit"
52PACKAGECONFIG[libarchive] = "-Dlibarchive=enabled,-Dlibarchive=disabled,libarchive" 52PACKAGECONFIG[libarchive] = "-Dlibarchive=enabled,-Dlibarchive=disabled,libarchive"
53PACKAGECONFIG[libmpv] = "-Dlibmpv=true,-Dlibmpv=false"
53PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack" 54PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
55PACKAGECONFIG[pipewire] = "-Dpipewire=enabled,-Dpipewire=disabled,pipewire"
56PACKAGECONFIG[pulseaudio] = "-Dpulse=enabled,-Dpulse=disabled,pulseaudio"
54PACKAGECONFIG[vaapi] = "-Dvaapi=enabled,-Dvaapi=disabled,libva" 57PACKAGECONFIG[vaapi] = "-Dvaapi=enabled,-Dvaapi=disabled,libva"
58PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,shaderc"
55PACKAGECONFIG[vdpau] = "-Dvdpau=enabled,-Dvdpau=disabled,libvdpau" 59PACKAGECONFIG[vdpau] = "-Dvdpau=enabled,-Dvdpau=disabled,libvdpau"
56PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,wayland wayland-native libxkbcommon" 60PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,wayland wayland-native libxkbcommon"
57 61
@@ -82,7 +86,7 @@ python __anonymous() {
82 86
83#SIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}" 87#SIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}"
84 88
85EXTRA_OECONF = " \ 89EXTRA_OEMESON = " \
86 -Dmanpage-build=disabled \ 90 -Dmanpage-build=disabled \
87 -Dlibbluray=disabled \ 91 -Dlibbluray=disabled \
88 -Ddvdnav=disabled \ 92 -Ddvdnav=disabled \
@@ -91,17 +95,11 @@ EXTRA_OECONF = " \
91 -Drubberband=disabled \ 95 -Drubberband=disabled \
92 -Dlcms2=disabled \ 96 -Dlcms2=disabled \
93 -Dvapoursynth=disabled \ 97 -Dvapoursynth=disabled \
94 ${PACKAGECONFIG_CONFARGS} \
95" 98"
96 99
97do_configure:append() { 100do_configure:append() {
98 sed -i -e 's#${WORKDIR}#<WORKDIR>#g' ${B}/config.h 101 sed -i -e 's#${WORKDIR}#<WORKDIR>#g' ${B}/config.h
99} 102}
100 103
101FILES:${PN} += " \ 104FILES:${PN} += "${datadir}"
102 ${datadir}/icons \
103 ${datadir}/zsh \
104 ${datadir}/bash-completion \
105 ${datadir}/metainfo \
106 "
107EXCLUDE_FROM_WORLD = "${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "0", "1", d)}" 105EXCLUDE_FROM_WORLD = "${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "0", "1", d)}"