From ec8e3c7dec15c1c9007380a29c181e06c3cb8e2b Mon Sep 17 00:00:00 2001 From: Ingo Blechschmidt Date: Wed, 23 Nov 2022 22:35:56 +0100 Subject: [PATCH] minitube: unbreak the build --- pkgs/applications/video/minitube/default.nix | 8 +++++++- .../minitube/lib_media_src_mpv_mpvwidget.patch | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 pkgs/applications/video/minitube/lib_media_src_mpv_mpvwidget.patch diff --git a/pkgs/applications/video/minitube/default.nix b/pkgs/applications/video/minitube/default.nix index eda58349bd86..06bed9211318 100644 --- a/pkgs/applications/video/minitube/default.nix +++ b/pkgs/applications/video/minitube/default.nix @@ -1,4 +1,4 @@ -{ mkDerivation, lib, fetchFromGitHub, phonon, phonon-backend-vlc, qtbase, qmake +{ mkDerivation, lib, fetchFromGitHub, fetchpatch, phonon, phonon-backend-vlc, qtbase, qmake , qtdeclarative, qttools, qtx11extras, mpv # "Free" key generated by pasqui23 @@ -16,6 +16,12 @@ mkDerivation rec { fetchSubmodules = true; }; + patches = [ + # Taken from FreeBSD; already merged upstream in the media submodule + # (https://github.com/flaviotordini/media/commit/f6b7020f273e1fc06e6e204fab37a7c8edaa857a) + ./lib_media_src_mpv_mpvwidget.patch + ]; + nativeBuildInputs = [ qmake qttools ]; buildInputs = [ phonon phonon-backend-vlc qtbase qtdeclarative qtx11extras mpv ]; diff --git a/pkgs/applications/video/minitube/lib_media_src_mpv_mpvwidget.patch b/pkgs/applications/video/minitube/lib_media_src_mpv_mpvwidget.patch new file mode 100644 index 000000000000..9beff68a0ec4 --- /dev/null +++ b/pkgs/applications/video/minitube/lib_media_src_mpv_mpvwidget.patch @@ -0,0 +1,16 @@ +diff -Nur a/lib/media/src/mpv/mpvwidget.cpp b/lib/media/src/mpv/mpvwidget.cpp +--- a/lib/media/src/mpv/mpvwidget.cpp ++++ b/lib/media/src/mpv/mpvwidget.cpp +@@ -30,7 +30,11 @@ + qDebug() << "initializeGL" << nativeParent; + if (nativeParent == nullptr) qFatal("No native parent"); + +- mpv_opengl_init_params gl_init_params{get_proc_address, this, nullptr}; ++ #if MPV_CLIENT_API_VERSION < MPV_MAKE_VERSION(2,0) ++ mpv_opengl_init_params gl_init_params{get_proc_address, this, nullptr}; ++ #else ++ mpv_opengl_init_params gl_init_params{get_proc_address, this}; ++ #endif + mpv_render_param params[]{{MPV_RENDER_PARAM_API_TYPE, (void *)MPV_RENDER_API_TYPE_OPENGL}, + {MPV_RENDER_PARAM_OPENGL_INIT_PARAMS, &gl_init_params}, + {MPV_RENDER_PARAM_INVALID, nullptr},