diff options
-rw-r--r-- | meta-oe/recipes-multimedia/mplayer/mpv/0001-file2string-Avoid-emitting-absolute-filepaths-into-g.patch | 33 | ||||
-rw-r--r-- | meta-oe/recipes-multimedia/mplayer/mpv/a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54.patch | 87 | ||||
-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 @@ | |||
1 | From 9878681df9919d28da3e4c6cc706e264abd9df92 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 29 Aug 2024 17:54:15 -0700 | ||
4 | Subject: [PATCH] file2string: Avoid emitting absolute filepaths into generated | ||
5 | sources | ||
6 | |||
7 | These sources are bundled into src packages to be distributed and leaking | ||
8 | buildpaths results in violating reproducibility norms. | ||
9 | |||
10 | Upstream-Status: Submitted [https://github.com/mpv-player/mpv/pull/14763] | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | TOOLS/file2string.py | 4 ++-- | ||
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/TOOLS/file2string.py b/TOOLS/file2string.py | ||
18 | index 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 @@ | |||
1 | From a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <kasper93@gmail.com> | ||
3 | Date: Sun, 13 Oct 2024 19:18:11 +0200 | ||
4 | Subject: [PATCH] build: fix dynamic generation of mpv.desktop file protocols | ||
5 | |||
6 | Running cross-compiled binaries may be possible, but the runtime | ||
7 | environment must be configured correctly. In some configurations, an | ||
8 | exe_wrapper needs to be used, and in all cases, the library path must be | ||
9 | set correctly for the given binary. Fortunately, Meson handles all of | ||
10 | this if cross-compilation is configured correctly. | ||
11 | |||
12 | Fix this by having Meson run the mpv binary directly, instead of as a | ||
13 | subprocess of a Python script. This ensures that the environment is | ||
14 | properly set for running host binaries, if possible. | ||
15 | |||
16 | Fixes: #15075 | ||
17 | Fixes: 056b03f9ed05607786427da8f336e3ef819b3a1e | ||
18 | |||
19 | Upstream-Status: Submitted [https://github.com/mpv-player/mpv/pull/15075] | ||
20 | |||
21 | Signed-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 | |||
27 | diff --git a/TOOLS/gen-mpv-desktop.py b/TOOLS/gen-mpv-desktop.py | ||
28 | index 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") | ||
65 | diff --git a/meson.build b/meson.build | ||
66 | index 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 = " \ | |||
15 | LICENSE = "GPL-2.0-or-later" | 15 | LICENSE = "GPL-2.0-or-later" |
16 | LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" | 16 | LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
17 | 17 | ||
18 | SRCREV_mpv = "02254b92dd237f03aa0a151c2a68778c4ea848f9" | 18 | SRCREV = "a0fba7be57f3822d967b04f0f6b6d6341e7516e7" |
19 | SRC_URI = "git://github.com/mpv-player/mpv;name=mpv;branch=release/0.38;protocol=https \ | 19 | SRC_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 | " | |
23 | S = "${WORKDIR}/git" | 23 | S = "${WORKDIR}/git" |
24 | 24 | ||
25 | inherit meson pkgconfig mime-xdg | 25 | inherit 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) |
38 | PACKAGECONFIG ??= " \ | 38 | PACKAGECONFIG ??= " \ |
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 | ||
45 | PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 xsp libxv libxscrnsaver libxinerama libxpresent libxext" | 45 | PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 xsp libxv libxscrnsaver libxinerama libxpresent libxext" |
46 | PACKAGECONFIG[xv] = "-Dxv=enabled,-Dxv=disabled,libxv" | 46 | PACKAGECONFIG[xv] = "-Dxv=enabled,-Dxv=disabled,libxv" |
47 | PACKAGECONFIG[opengl] = "-Dgl=enabled,-Dgl=disabled,virtual/libgl" | 47 | PACKAGECONFIG[opengl] = "-Dgl=enabled,-Dgl=disabled,virtual/libgl" |
48 | PACKAGECONFIG[egl] = "-Degl=enabled,-Degl-disabled,virtual/egl" | 48 | PACKAGECONFIG[egl] = "-Degl=enabled,-Degl=disabled,virtual/egl" |
49 | PACKAGECONFIG[drm] = "-Ddrm=enabled,-Ddrm=disabled,libdrm" | 49 | PACKAGECONFIG[drm] = "-Ddrm=enabled,-Ddrm=disabled,libdrm" |
50 | PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled,virtual/libgbm" | 50 | PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled,virtual/libgbm" |
51 | PACKAGECONFIG[lua] = "-Dlua=luajit,-Dlua=disabled,lua luajit" | 51 | PACKAGECONFIG[lua] = "-Dlua=luajit,-Dlua=disabled,luajit" |
52 | PACKAGECONFIG[libarchive] = "-Dlibarchive=enabled,-Dlibarchive=disabled,libarchive" | 52 | PACKAGECONFIG[libarchive] = "-Dlibarchive=enabled,-Dlibarchive=disabled,libarchive" |
53 | PACKAGECONFIG[libmpv] = "-Dlibmpv=true,-Dlibmpv=false" | ||
53 | PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack" | 54 | PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack" |
55 | PACKAGECONFIG[pipewire] = "-Dpipewire=enabled,-Dpipewire=disabled,pipewire" | ||
56 | PACKAGECONFIG[pulseaudio] = "-Dpulse=enabled,-Dpulse=disabled,pulseaudio" | ||
54 | PACKAGECONFIG[vaapi] = "-Dvaapi=enabled,-Dvaapi=disabled,libva" | 57 | PACKAGECONFIG[vaapi] = "-Dvaapi=enabled,-Dvaapi=disabled,libva" |
58 | PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,shaderc" | ||
55 | PACKAGECONFIG[vdpau] = "-Dvdpau=enabled,-Dvdpau=disabled,libvdpau" | 59 | PACKAGECONFIG[vdpau] = "-Dvdpau=enabled,-Dvdpau=disabled,libvdpau" |
56 | PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,wayland wayland-native libxkbcommon" | 60 | PACKAGECONFIG[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 | ||
85 | EXTRA_OECONF = " \ | 89 | EXTRA_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 | ||
97 | do_configure:append() { | 100 | do_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 | ||
101 | FILES:${PN} += " \ | 104 | FILES:${PN} += "${datadir}" |
102 | ${datadir}/icons \ | ||
103 | ${datadir}/zsh \ | ||
104 | ${datadir}/bash-completion \ | ||
105 | ${datadir}/metainfo \ | ||
106 | " | ||
107 | EXCLUDE_FROM_WORLD = "${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "0", "1", d)}" | 105 | EXCLUDE_FROM_WORLD = "${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "0", "1", d)}" |