From 9e20078f0aef6469e3bde72e9d7f4e0f1e7a412a Mon Sep 17 00:00:00 2001 From: Andrew Benson Date: Sat, 12 Nov 2022 16:04:15 -0600 Subject: [PATCH] vidcutter: update to 6.0.5.1. --- srcpkgs/vidcutter/patches/mpv-0.35-1.patch | 387 +++++++++++++++++++++ srcpkgs/vidcutter/patches/mpv-0.35-2.patch | 24 ++ srcpkgs/vidcutter/patches/mpv-0.35-3.patch | 29 ++ srcpkgs/vidcutter/template | 18 +- 4 files changed, 452 insertions(+), 6 deletions(-) create mode 100644 srcpkgs/vidcutter/patches/mpv-0.35-1.patch create mode 100644 srcpkgs/vidcutter/patches/mpv-0.35-2.patch create mode 100644 srcpkgs/vidcutter/patches/mpv-0.35-3.patch diff --git a/srcpkgs/vidcutter/patches/mpv-0.35-1.patch b/srcpkgs/vidcutter/patches/mpv-0.35-1.patch new file mode 100644 index 00000000000..759b787f7a6 --- /dev/null +++ b/srcpkgs/vidcutter/patches/mpv-0.35-1.patch @@ -0,0 +1,387 @@ +https://github.com/ozmartian/vidcutter/commit/1d88825feb5a73a50d019914ba9d0008562a58ce.patch + +From 1d88825feb5a73a50d019914ba9d0008562a58ce Mon Sep 17 00:00:00 2001 +From: Pete Alexandrou +Date: Tue, 22 Feb 2022 11:29:00 +1100 +Subject: [PATCH] Patches to pympv to workaround opengl_cb deprecation from + libmpv + +--- + vidcutter/libs/pympv/client.pxd | 54 +- + vidcutter/libs/pympv/mpv.pyx | 192 +- + 3 files changed, 21832 insertions(+), 24808 deletions(-) + +diff --git a/vidcutter/libs/pympv/client.pxd b/vidcutter/libs/pympv/client.pxd +index befe219e..d9a8816f 100644 +--- a/vidcutter/libs/pympv/client.pxd ++++ b/vidcutter/libs/pympv/client.pxd +@@ -112,9 +112,9 @@ cdef extern from "mpv/client.h": + + int mpv_load_config_file(mpv_handle *ctx, const char *filename) nogil + +- void mpv_suspend(mpv_handle *ctx) nogil ++ # void mpv_suspend(mpv_handle *ctx) nogil + +- void mpv_resume(mpv_handle *ctx) nogil ++ # void mpv_resume(mpv_handle *ctx) nogil + + int64_t mpv_get_time_us(mpv_handle *ctx) nogil + +@@ -200,21 +200,21 @@ cdef extern from "mpv/client.h": + MPV_EVENT_START_FILE + MPV_EVENT_END_FILE + MPV_EVENT_FILE_LOADED +- MPV_EVENT_TRACKS_CHANGED +- MPV_EVENT_TRACK_SWITCHED ++ # MPV_EVENT_TRACKS_CHANGED ++ # MPV_EVENT_TRACK_SWITCHED + MPV_EVENT_IDLE +- MPV_EVENT_PAUSE +- MPV_EVENT_UNPAUSE ++ # MPV_EVENT_PAUSE ++ # MPV_EVENT_UNPAUSE + MPV_EVENT_TICK +- MPV_EVENT_SCRIPT_INPUT_DISPATCH ++ # MPV_EVENT_SCRIPT_INPUT_DISPATCH + MPV_EVENT_CLIENT_MESSAGE + MPV_EVENT_VIDEO_RECONFIG + MPV_EVENT_AUDIO_RECONFIG +- MPV_EVENT_METADATA_UPDATE ++ # MPV_EVENT_METADATA_UPDATE + MPV_EVENT_SEEK + MPV_EVENT_PLAYBACK_RESTART + MPV_EVENT_PROPERTY_CHANGE +- MPV_EVENT_CHAPTER_CHANGE ++ # MPV_EVENT_CHAPTER_CHANGE + + const char *mpv_event_name(mpv_event_id event) nogil + +@@ -249,9 +249,9 @@ cdef extern from "mpv/client.h": + int reason + int error + +- cdef struct mpv_event_script_input_dispatch: +- int arg0 +- const char *type ++ # cdef struct mpv_event_script_input_dispatch: ++ # int arg0 ++ # const char *type + + cdef struct mpv_event_client_message: + int num_args +@@ -282,27 +282,27 @@ cdef extern from "mpv/client.h": + + void *mpv_get_sub_api(mpv_handle *ctx, mpv_sub_api sub_api) nogil + +-cdef extern from "mpv/opengl_cb.h": +- struct mpv_opengl_cb_context: +- pass ++# cdef extern from "mpv/opengl_cb.h": ++# struct mpv_opengl_cb_context: ++# pass + +- ctypedef void (*mpv_opengl_cb_update_fn)(void *cb_ctx) nogil +- ctypedef void *(*mpv_opengl_cb_get_proc_address_fn)(void *fn_ctx, +- const char *name) nogil ++# ctypedef void (*mpv_opengl_cb_update_fn)(void *cb_ctx) nogil ++# ctypedef void *(*mpv_opengl_cb_get_proc_address_fn)(void *fn_ctx, ++# const char *name) nogil + +- void mpv_opengl_cb_set_update_callback(mpv_opengl_cb_context *ctx, +- mpv_opengl_cb_update_fn callback, +- void *callback_ctx) nogil ++# void mpv_opengl_cb_set_update_callback(mpv_opengl_cb_context *ctx, ++# mpv_opengl_cb_update_fn callback, ++# void *callback_ctx) nogil + +- int mpv_opengl_cb_init_gl(mpv_opengl_cb_context *ctx, const char *exts, +- mpv_opengl_cb_get_proc_address_fn get_proc_address, +- void *get_proc_address_ctx) nogil ++# int mpv_opengl_cb_init_gl(mpv_opengl_cb_context *ctx, const char *exts, ++# mpv_opengl_cb_get_proc_address_fn get_proc_address, ++# void *get_proc_address_ctx) nogil + +- int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int w, int h) nogil ++# int mpv_opengl_cb_draw(mpv_opengl_cb_context *ctx, int fbo, int w, int h) nogil + +- int mpv_opengl_cb_report_flip(mpv_opengl_cb_context *ctx, int64_t time) nogil ++# int mpv_opengl_cb_report_flip(mpv_opengl_cb_context *ctx, int64_t time) nogil + +- int mpv_opengl_cb_uninit_gl(mpv_opengl_cb_context *ctx) nogil ++# int mpv_opengl_cb_uninit_gl(mpv_opengl_cb_context *ctx) nogil + + + cdef extern from "mpv/render.h": +diff --git a/vidcutter/libs/pympv/mpv.pyx b/vidcutter/libs/pympv/mpv.pyx +index 540ea649..8af2dcc7 100644 +--- a/vidcutter/libs/pympv/mpv.pyx ++++ b/vidcutter/libs/pympv/mpv.pyx +@@ -30,8 +30,8 @@ from client cimport * + __version__ = "0.3.0" + __author__ = "Andre D" + +-_REQUIRED_CAPI_MAJOR = 1 +-_MIN_CAPI_MINOR = 9 ++_REQUIRED_CAPI_MAJOR = 2 ++_MIN_CAPI_MINOR = 0 + + cdef unsigned long _CAPI_VERSION + with nogil: +@@ -47,7 +47,7 @@ if _CAPI_MAJOR != _REQUIRED_CAPI_MAJOR or _CAPI_MINOR < _MIN_CAPI_MINOR: + ) + + cdef extern from "Python.h": +- void PyEval_InitThreads() ++ void Py_Initialize() + + _is_py3 = sys.version_info >= (3,) + _strdec_err = "surrogateescape" if _is_py3 else "strict" +@@ -67,7 +67,7 @@ def _strenc(s): + # In python2, assume bytes and walk right through + return s + +-PyEval_InitThreads() ++Py_Initialize() + + class Errors: + """Set of known error codes from MpvError and Event responses. +@@ -114,21 +114,21 @@ class Events: + start_file = MPV_EVENT_START_FILE + end_file = MPV_EVENT_END_FILE + file_loaded = MPV_EVENT_FILE_LOADED +- tracks_changed = MPV_EVENT_TRACKS_CHANGED +- tracks_switched = MPV_EVENT_TRACK_SWITCHED ++ # tracks_changed = MPV_EVENT_TRACKS_CHANGED ++ # tracks_switched = MPV_EVENT_TRACK_SWITCHED + idle = MPV_EVENT_IDLE +- pause = MPV_EVENT_PAUSE +- unpause = MPV_EVENT_UNPAUSE ++ # pause = MPV_EVENT_PAUSE ++ # unpause = MPV_EVENT_UNPAUSE + tick = MPV_EVENT_TICK +- script_input_dispatch = MPV_EVENT_SCRIPT_INPUT_DISPATCH ++ # script_input_dispatch = MPV_EVENT_SCRIPT_INPUT_DISPATCH + client_message = MPV_EVENT_CLIENT_MESSAGE + video_reconfig = MPV_EVENT_VIDEO_RECONFIG + audio_reconfig = MPV_EVENT_AUDIO_RECONFIG +- metadata_update = MPV_EVENT_METADATA_UPDATE ++ # metadata_update = MPV_EVENT_METADATA_UPDATE + seek = MPV_EVENT_SEEK + playback_restart = MPV_EVENT_PLAYBACK_RESTART + property_change = MPV_EVENT_PROPERTY_CHANGE +- chapter_change = MPV_EVENT_CHAPTER_CHANGE ++ # chapter_change = MPV_EVENT_CHAPTER_CHANGE + + + class LogLevels: +@@ -166,17 +166,17 @@ cdef class EndOfFileReached(object): + return self + + +-cdef class InputDispatch(object): +- """Data field for MPV_EVENT_SCRIPT_INPUT_DISPATCH events. ++# cdef class InputDispatch(object): ++# """Data field for MPV_EVENT_SCRIPT_INPUT_DISPATCH events. + +- Wraps: mpv_event_script_input_dispatch +- """ +- cdef public object arg0, type ++# Wraps: mpv_event_script_input_dispatch ++# """ ++# cdef public object arg0, type + +- cdef _init(self, mpv_event_script_input_dispatch* input): +- self.arg0 = input.arg0 +- self.type = _strdec(input.type) +- return self ++# cdef _init(self, mpv_event_script_input_dispatch* input): ++# self.arg0 = input.arg0 ++# self.type = _strdec(input.type) ++# return self + + + cdef class LogMessage(object): +@@ -276,8 +276,8 @@ cdef class Event(object): + return Property()._init(data) + elif self.id == MPV_EVENT_LOG_MESSAGE: + return LogMessage()._init(data) +- elif self.id == MPV_EVENT_SCRIPT_INPUT_DISPATCH: +- return InputDispatch()._init(data) ++ # elif self.id == MPV_EVENT_SCRIPT_INPUT_DISPATCH: ++ # return InputDispatch()._init(data) + elif self.id == MPV_EVENT_CLIENT_MESSAGE: + climsg = data + args = [] +@@ -396,17 +396,17 @@ cdef class Context(object): + time = mpv_get_time_us(self._ctx) + return time + +- def suspend(self): +- """Wraps: mpv_suspend""" +- assert self._ctx +- with nogil: +- mpv_suspend(self._ctx) ++ # def suspend(self): ++ # """Wraps: mpv_suspend""" ++ # assert self._ctx ++ # with nogil: ++ # mpv_suspend(self._ctx) + +- def resume(self): +- """Wraps: mpv_resume""" +- assert self._ctx +- with nogil: +- mpv_resume(self._ctx) ++ # def resume(self): ++ # """Wraps: mpv_resume""" ++ # assert self._ctx ++ # with nogil: ++ # mpv_resume(self._ctx) + + @_errors + def request_event(self, event, enable): +@@ -798,17 +798,17 @@ cdef class Context(object): + self.reply_userdata = None + self._ctx = NULL + +- def opengl_cb_api(self): +- cdef void *cb ++ # def opengl_cb_api(self): ++ # cdef void *cb + +- _ctx = mpv_get_sub_api(self._ctx, MPV_SUB_API_OPENGL_CB) +- if not _ctx: +- raise MPVError("OpenGL API not available") ++ # _ctx = mpv_get_sub_api(self._ctx, MPV_SUB_API_OPENGL_CB) ++ # if not _ctx: ++ # raise MPVError("OpenGL API not available") + +- ctx = OpenGLContext() +- ctx._ctx = _ctx ++ # ctx = OpenGLContext() ++ # ctx._ctx = _ctx + +- return ctx ++ # return ctx + + def __dealloc__(self): + self.shutdown() +@@ -819,62 +819,62 @@ cdef void *_c_getprocaddress(void *ctx, const char *name) with gil: + cdef void _c_updatecb(void *ctx) with gil: + (ctx)() + +-cdef class OpenGLContext(object): +- cdef: +- mpv_opengl_cb_context *_ctx +- bint inited +- object update_cb +- +- def __init__(self): +- self.inited = False +- warnings.warn("OpenGLContext is deprecated, please switch to RenderContext", DeprecationWarning) +- +- def init_gl(self, exts, get_proc_address): +- exts = _strenc(exts) if exts is not None else None +- cdef char* extsc = NULL +- if exts is not None: +- extsc = exts +- with nogil: +- err = mpv_opengl_cb_init_gl(self._ctx, extsc, &_c_getprocaddress, +- get_proc_address) +- if err < 0: +- raise MPVError(err) +- +- self.inited = True +- +- def set_update_callback(self, cb): +- self.update_cb = cb +- with nogil: +- mpv_opengl_cb_set_update_callback(self._ctx, &_c_updatecb, cb) +- +- def draw(self, fbo, w, h): +- cdef: +- int fboc = fbo +- int wc = w +- int hc = h +- with nogil: +- err = mpv_opengl_cb_draw(self._ctx, fboc, wc, hc) +- if err < 0: +- raise MPVError(err) +- +- def report_flip(self, time): +- cdef int64_t ctime = time +- with nogil: +- err = mpv_opengl_cb_report_flip(self._ctx, ctime) +- if err < 0: +- raise MPVError(err) +- +- def uninit_gl(self): +- if not self.inited: +- return +- with nogil: +- err = mpv_opengl_cb_uninit_gl(self._ctx) +- if err < 0: +- raise MPVError(err) +- self.inited = False +- +- def __dealloc__(self): +- self.uninit_gl() ++# cdef class OpenGLContext(object): ++# cdef: ++# mpv_opengl_cb_context *_ctx ++# bint inited ++# object update_cb ++ ++# def __init__(self): ++# self.inited = False ++# warnings.warn("OpenGLContext is deprecated, please switch to RenderContext", DeprecationWarning) ++ ++# def init_gl(self, exts, get_proc_address): ++# exts = _strenc(exts) if exts is not None else None ++# cdef char* extsc = NULL ++# if exts is not None: ++# extsc = exts ++# with nogil: ++# err = mpv_opengl_cb_init_gl(self._ctx, extsc, &_c_getprocaddress, ++# get_proc_address) ++# if err < 0: ++# raise MPVError(err) ++ ++# self.inited = True ++ ++# def set_update_callback(self, cb): ++# self.update_cb = cb ++# with nogil: ++# mpv_opengl_cb_set_update_callback(self._ctx, &_c_updatecb, cb) ++ ++# def draw(self, fbo, w, h): ++# cdef: ++# int fboc = fbo ++# int wc = w ++# int hc = h ++# with nogil: ++# err = mpv_opengl_cb_draw(self._ctx, fboc, wc, hc) ++# if err < 0: ++# raise MPVError(err) ++ ++# def report_flip(self, time): ++# cdef int64_t ctime = time ++# with nogil: ++# err = mpv_opengl_cb_report_flip(self._ctx, ctime) ++# if err < 0: ++# raise MPVError(err) ++ ++# def uninit_gl(self): ++# if not self.inited: ++# return ++# with nogil: ++# err = mpv_opengl_cb_uninit_gl(self._ctx) ++# if err < 0: ++# raise MPVError(err) ++# self.inited = False ++ ++# def __dealloc__(self): ++# self.uninit_gl() + + DEF MAX_RENDER_PARAMS = 32 + diff --git a/srcpkgs/vidcutter/patches/mpv-0.35-2.patch b/srcpkgs/vidcutter/patches/mpv-0.35-2.patch new file mode 100644 index 00000000000..c982ded8475 --- /dev/null +++ b/srcpkgs/vidcutter/patches/mpv-0.35-2.patch @@ -0,0 +1,24 @@ +https://github.com/ozmartian/vidcutter/commit/8010f5c64efe68d8130a036f976d2d2ff1c868ad.patch + +From 8010f5c64efe68d8130a036f976d2d2ff1c868ad Mon Sep 17 00:00:00 2001 +From: Pete Alexandrou +Date: Tue, 22 Feb 2022 16:08:24 +1100 +Subject: [PATCH] fix libmpv version number format + +--- + vidcutter/libs/mpvwidget.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/vidcutter/libs/mpvwidget.py b/vidcutter/libs/mpvwidget.py +index 239b6c9c..6661ad85 100644 +--- a/vidcutter/libs/mpvwidget.py ++++ b/vidcutter/libs/mpvwidget.py +@@ -247,7 +247,7 @@ def format(self, stream: str='video') -> str: + + def version(self) -> str: + ver = self.mpv.api_version +- return '{0}.{1}'.format(ver[0], ver[1]) ++ return '{0}.{1}'.format(ver[1], ver[0]) + + def option(self, option: str, val): + if isinstance(val, bool): diff --git a/srcpkgs/vidcutter/patches/mpv-0.35-3.patch b/srcpkgs/vidcutter/patches/mpv-0.35-3.patch new file mode 100644 index 00000000000..d1f5f1364c6 --- /dev/null +++ b/srcpkgs/vidcutter/patches/mpv-0.35-3.patch @@ -0,0 +1,29 @@ +https://github.com/ozmartian/vidcutter/commit/4cf1458d832e6ac7a824d7963c6dc3a0e5c17574.patch + +From 4cf1458d832e6ac7a824d7963c6dc3a0e5c17574 Mon Sep 17 00:00:00 2001 +From: Pete Alexandrou +Date: Sat, 30 Apr 2022 15:49:17 +1000 +Subject: [PATCH] pympv updates + +--- + vidcutter/libs/pympv/mpv.c | 3792 +++++++++++++++++----------------- + vidcutter/libs/pympv/mpv.pyx | 6 +- + 2 files changed, 1900 insertions(+), 1898 deletions(-) + +diff --git a/vidcutter/libs/pympv/mpv.pyx b/vidcutter/libs/pympv/mpv.pyx +index 8af2dcc7..1decdda8 100644 +--- a/vidcutter/libs/pympv/mpv.pyx ++++ b/vidcutter/libs/pympv/mpv.pyx +@@ -30,8 +30,10 @@ from client cimport * + __version__ = "0.3.0" + __author__ = "Andre D" + +-_REQUIRED_CAPI_MAJOR = 2 +-_MIN_CAPI_MINOR = 0 ++#_REQUIRED_CAPI_MAJOR = 2 ++#_MIN_CAPI_MINOR = 0 ++_REQUIRED_CAPI_MAJOR = 1 ++_MIN_CAPI_MINOR = 109 + + cdef unsigned long _CAPI_VERSION + with nogil: diff --git a/srcpkgs/vidcutter/template b/srcpkgs/vidcutter/template index 07bda50c917..6eddc1345ec 100644 --- a/srcpkgs/vidcutter/template +++ b/srcpkgs/vidcutter/template @@ -1,7 +1,7 @@ # Template file for 'vidcutter' pkgname=vidcutter -version=6.0.0 -revision=6 +version=6.0.5.1 +revision=1 build_style=python3-module hostmakedepends="python3-setuptools python3-Cython" makedepends="mpv-devel python3-devel" @@ -11,9 +11,15 @@ short_desc="Video cutter and joiner based on FFmpeg" maintainer="Orphaned " license="GPL-3.0-or-later" homepage="https://github.com/ozmartian/vidcutter" -distfiles="https://github.com/ozmartian/vidcutter/archive/refs/tags/${version}.tar.gz" -checksum=c09be7eceaf42ff7211fe3b8125279c4fec7f7d251d272b61d579e426bd4e2c2 +# pympv isn't packaged because it will create a package conflicts with +# python3-mpv +distfiles="https://github.com/ozmartian/vidcutter/archive/refs/tags/${version}.tar.gz + https://github.com/marcan/pympv/archive/refs/tags/v0.7.1.tar.gz" +checksum="c6374eaedb845f9e580e555dd12c1db1cf2ffa28d3756b08e2ae28c1a4cd4a96 + 1d262e7fb2531d27633bdc2334fbc1c3ce094457a6a8f3cfc1c6c9799c1ef202" -pre_build() { - rm -f vidcutter/libs/pympv/mpv.c +post_extract() { + mv vidcutter-*/* . + rm -rf vidcutter/libs/pympv + mv pympv-* vidcutter/libs/pympv }