Skip to content

Commit

Permalink
mpv: update 0.38.0 -> 0.39.0
Browse files Browse the repository at this point in the history
- add support for vulkan,pipewire,pulseaudio
- add patch to fix generation of mpv.desktop
- cleanup

Signed-off-by: Markus Volk <[email protected]>
Signed-off-by: Khem Raj <[email protected]>
  • Loading branch information
MarkusVolk authored and kraj committed Oct 14, 2024
1 parent d1cbb5c commit a18a23d
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 51 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
From a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= <[email protected]>
Date: Sun, 13 Oct 2024 19:18:11 +0200
Subject: [PATCH] build: fix dynamic generation of mpv.desktop file protocols

Running cross-compiled binaries may be possible, but the runtime
environment must be configured correctly. In some configurations, an
exe_wrapper needs to be used, and in all cases, the library path must be
set correctly for the given binary. Fortunately, Meson handles all of
this if cross-compilation is configured correctly.

Fix this by having Meson run the mpv binary directly, instead of as a
subprocess of a Python script. This ensures that the environment is
properly set for running host binaries, if possible.

Fixes: #15075
Fixes: 056b03f9ed05607786427da8f336e3ef819b3a1e

Upstream-Status: Submitted [https://github.com/mpv-player/mpv/pull/15075]

Signed-off-by: Markus Volk <[email protected]>
---
TOOLS/gen-mpv-desktop.py | 17 +++++++----------
meson.build | 9 +++++++--
2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/TOOLS/gen-mpv-desktop.py b/TOOLS/gen-mpv-desktop.py
index 7bbb33e5be..2c45a7038e 100755
--- a/TOOLS/gen-mpv-desktop.py
+++ b/TOOLS/gen-mpv-desktop.py
@@ -21,23 +21,28 @@
#

import sys
-from subprocess import check_output

if __name__ == "__main__":
- with open(sys.argv[1], "r", encoding="UTF-8") as f:
+ with open(sys.argv[1], encoding="UTF-8") as f:
next(f)
mpv_desktop = dict([line.split("=", 1) for line in f])

if not mpv_desktop["X-KDE-Protocols"]:
raise ValueError("Missing X-KDE-Protocols entry in mpv.desktop file")

- mpv_protocols = check_output([sys.argv[2], "--no-config", "--list-protocols"], encoding="UTF-8")
- mpv_protocols = set(line.strip(" :/") for line in mpv_protocols.splitlines() if "://" in line)
+ with open(sys.argv[2], encoding="UTF-8") as mpv_protocols:
+ mpv_protocols = {
+ line.strip(" :/")
+ for line in mpv_protocols.read().splitlines()
+ if "://" in line
+ }
+
if len(mpv_protocols) == 0:
raise ValueError("Unable to parse any protocols from mpv '--list-protocols'")

protocol_list = set(mpv_desktop["X-KDE-Protocols"].strip().split(","))
- mpv_desktop["X-KDE-Protocols"] = ",".join(sorted(mpv_protocols & protocol_list)) + "\n"
+ compatible_protocols = sorted(mpv_protocols & protocol_list)
+ mpv_desktop["X-KDE-Protocols"] = ",".join(compatible_protocols) + "\n"

with open(sys.argv[3], "w", encoding="UTF-8") as f:
f.write("[Desktop Entry]" + "\n")
diff --git a/meson.build b/meson.build
index b7bcb1b0ba..c2004b748c 100644
--- a/meson.build
+++ b/meson.build
@@ -1830,11 +1830,16 @@ if get_option('cplayer')

if not win32 and not darwin
if meson.can_run_host_binaries()
+ mpv_protocols = custom_target('mpv_protocols',
+ output: 'mpv_protocols',
+ command: [mpv, '--no-config','--list-protocols'],
+ capture: true,
+ )
mpv_desktop_path = join_paths(source_root, 'etc', 'mpv.desktop')
custom_target('mpv.desktop',
- depends: mpv,
+ input: mpv_protocols,
output: 'mpv.desktop',
- command: [mpv_desktop, mpv_desktop_path, mpv.full_path(), '@OUTPUT@'],
+ command: [mpv_desktop, mpv_desktop_path, '@INPUT@', '@OUTPUT@'],
install: true,
install_dir: join_paths(datadir, 'applications'),
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ DEPENDS = " \
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://LICENSE.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRCREV_mpv = "02254b92dd237f03aa0a151c2a68778c4ea848f9"
SRC_URI = "git://github.com/mpv-player/mpv;name=mpv;branch=release/0.38;protocol=https \
file://0001-file2string-Avoid-emitting-absolute-filepaths-into-g.patch \
"

SRCREV = "a0fba7be57f3822d967b04f0f6b6d6341e7516e7"
SRC_URI = " \
git://github.com/mpv-player/mpv;name=mpv;branch=release/0.39;protocol=https \
file://a7efb3e62bbd0af86737f5ecb72d3a8e2a8c3b54.patch \
"
S = "${WORKDIR}/git"

inherit meson pkgconfig mime-xdg
Expand All @@ -37,21 +37,25 @@ LUA:powerpc = ""
# Note: lua is required to get on-screen-display (controls)
PACKAGECONFIG ??= " \
${LUA} \
${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland egl', '', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)} \
${@bb.utils.filter('DISTRO_FEATURES', 'x11 wayland opengl pipewire pulseaudio vulkan', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl wayland', 'egl', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl x11', 'drm gbm', '', d)} \
"

PACKAGECONFIG[x11] = "-Dx11=enabled,-Dx11=disabled,virtual/libx11 xsp libxv libxscrnsaver libxinerama libxpresent libxext"
PACKAGECONFIG[xv] = "-Dxv=enabled,-Dxv=disabled,libxv"
PACKAGECONFIG[opengl] = "-Dgl=enabled,-Dgl=disabled,virtual/libgl"
PACKAGECONFIG[egl] = "-Degl=enabled,-Degl-disabled,virtual/egl"
PACKAGECONFIG[egl] = "-Degl=enabled,-Degl=disabled,virtual/egl"
PACKAGECONFIG[drm] = "-Ddrm=enabled,-Ddrm=disabled,libdrm"
PACKAGECONFIG[gbm] = "-Dgbm=enabled,-Dgbm=disabled,virtual/libgbm"
PACKAGECONFIG[lua] = "-Dlua=luajit,-Dlua=disabled,lua luajit"
PACKAGECONFIG[lua] = "-Dlua=luajit,-Dlua=disabled,luajit"
PACKAGECONFIG[libarchive] = "-Dlibarchive=enabled,-Dlibarchive=disabled,libarchive"
PACKAGECONFIG[libmpv] = "-Dlibmpv=true,-Dlibmpv=false"
PACKAGECONFIG[jack] = "-Djack=enabled,-Djack=disabled,jack"
PACKAGECONFIG[pipewire] = "-Dpipewire=enabled,-Dpipewire=disabled,pipewire"
PACKAGECONFIG[pulseaudio] = "-Dpulse=enabled,-Dpulse=disabled,pulseaudio"
PACKAGECONFIG[vaapi] = "-Dvaapi=enabled,-Dvaapi=disabled,libva"
PACKAGECONFIG[vulkan] = "-Dvulkan=enabled,-Dvulkan=disabled,shaderc"
PACKAGECONFIG[vdpau] = "-Dvdpau=enabled,-Dvdpau=disabled,libvdpau"
PACKAGECONFIG[wayland] = "-Dwayland=enabled,-Dwayland=disabled,wayland wayland-native libxkbcommon"

Expand Down Expand Up @@ -82,7 +86,7 @@ python __anonymous() {

#SIMPLE_TARGET_SYS = "${@'${TARGET_SYS}'.replace('${TARGET_VENDOR}', '')}"

EXTRA_OECONF = " \
EXTRA_OEMESON = " \
-Dmanpage-build=disabled \
-Dlibbluray=disabled \
-Ddvdnav=disabled \
Expand All @@ -91,17 +95,11 @@ EXTRA_OECONF = " \
-Drubberband=disabled \
-Dlcms2=disabled \
-Dvapoursynth=disabled \
${PACKAGECONFIG_CONFARGS} \
"

do_configure:append() {
sed -i -e 's#${WORKDIR}#<WORKDIR>#g' ${B}/config.h
}

FILES:${PN} += " \
${datadir}/icons \
${datadir}/zsh \
${datadir}/bash-completion \
${datadir}/metainfo \
"
FILES:${PN} += "${datadir}"
EXCLUDE_FROM_WORLD = "${@bb.utils.contains("LICENSE_FLAGS_ACCEPTED", "commercial", "0", "1", d)}"

0 comments on commit a18a23d

Please sign in to comment.