commit 5dd8382f83136827823529d3fb4c694d2790e4a9 Author: Jakub Bogusz <qbo...@pld-linux.org> Date: Mon May 27 22:34:27 2024 +0200
- updated to R4 release; package also bestsource shared library bestsource-ffmpeg4.patch | 33 ------------- bestsource-system-AviSynthPlus.patch | 11 +++++ bestsource-system-libp2p.patch | 78 +++++++++++++++++------------- vapoursynth-plugin-bestsource.spec | 93 ++++++++++++++++++++++++++++-------- 4 files changed, 128 insertions(+), 87 deletions(-) --- diff --git a/vapoursynth-plugin-bestsource.spec b/vapoursynth-plugin-bestsource.spec index f41a4e6..6c72c25 100644 --- a/vapoursynth-plugin-bestsource.spec +++ b/vapoursynth-plugin-bestsource.spec @@ -1,31 +1,31 @@ +# +# Conditional build: +%bcond_without static_libs # static library + Summary: Vapoursynth plugin to access audio and video via FFmpeg library Summary(pl.UTF-8): Wtyczka Vapoursynth pozwalająca na dostęp do dźwięku i obrazu poprzez bibliotekę FFmpeg Name: vapoursynth-plugin-bestsource -# src/version.h says 0.9? -Version: 0 -%define snap 20230419 -%define gitref d917b26767c41851c50ccad29d8d126e139a7822 -%define rel 2 -Release: 0.%{snap}.%{rel} +Version: 4 +Release: 1 License: MIT Group: Libraries -Source0: https://github.com/vapoursynth/bestsource/archive/%{gitref}/bestsource-%{gitref}.tar.gz -# Source0-md5: b3afb3b36ed0a7ab457bd1d44927b1a0 +#Source0Download: https://github.com/vapoursynth/bestsource/releases +Source0: https://github.com/vapoursynth/bestsource/archive/R%{version}/bestsource-R%{version}.tar.gz +# Source0-md5: 32c350818744d5bc395e6ff90c4070c7 Patch0: bestsource-system-libp2p.patch -# remove after switching to ffmpeg 5.x, bump BR then -Patch1: bestsource-ffmpeg4.patch +Patch1: bestsource-system-AviSynthPlus.patch URL: https://github.com/vapoursynth/bestsource -# libavcodec >= 58.18.0, libavformat >= 58.12.0 -BuildRequires: ffmpeg-devel >= 4.1 -BuildRequires: jansson-devel >= 2.7 -BuildRequires: libp2p-devel +BuildRequires: AviSynthPlus-devel +# libavcodec >= 60.31.0, libavformat >= 60.16.0, libavutil >= 58.29.0 +BuildRequires: ffmpeg-devel >= 6.0 +BuildRequires: libp2p-devel >= 0-0.20240415 BuildRequires: libstdc++-devel -BuildRequires: meson >= 0.48.0 +BuildRequires: meson >= 0.53.0 BuildRequires: ninja >= 1.5 BuildRequires: pkgconfig BuildRequires: vapoursynth-devel >= 55 -Requires: ffmpeg-libs >= 4.1 -Requires: jansson >= 2.7 +BuildRequires: xxHash-devel +Requires: bestsource = %{version}-%{release} Requires: vapoursynth >= 55 Obsoletes: vapoursynth-plugin-bestaudiosource < 2 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -37,13 +37,51 @@ Vapoursynth plugin to access audio and video via FFmpeg library. Wtyczka Vapoursynth pozwalająca na dostęp do dźwięku i obrazu poprzez bibliotekę FFmpeg. +%package -n bestsource +Summary: Super great audio/video source and FFmpeg wrapper +Summary(pl.UTF-8): Bardzo uniwersalne źródło dźwięku/obrazu i opakowanie FFmpeg +Group: Libraries +Requires: ffmpeg-libs >= 6.0.0 +Requires: libp2p >= 0-0.20240415 + +%description -n bestsource +Super great audio/video source and FFmpeg wrapper. + +%description -n bestsource -l pl.UTF-8 +Bardzo uniwersalne źródło dźwięku/obrazu i opakowanie FFmpeg. + +%package -n bestsource-devel +Summary: Header files for bestsource library +Summary(pl.UTF-8): Pliki nagłówkowe biblioteki bestsource +Group: Development/Libraries +Requires: bestsource = %{version}-%{release} + +%description -n bestsource-devel +Header files for bestsource library. + +%description -n bestsource-devel -l pl.UTF-8 +Pliki nagłówkowe biblioteki bestsource. + +%package -n bestsource-static +Summary: Static bestsource library +Summary(pl.UTF-8): Statyczna biblioteka bestsource +Group: Development/Libraries +Requires: bestsource-devel = %{version}-%{release} + +%description -n bestsource-static +Static bestsource library. + +%description -n bestsource-static -l pl.UTF-8 +Statyczna biblioteka bestsource. + %prep -%setup -q -n bestsource-%{gitref} +%setup -q -n bestsource-R%{version} %patch0 -p1 %patch1 -p1 %build -%meson build +%meson build \ + %{!?with_static_libs:--default-library=shared} %ninja_build -C build @@ -58,4 +96,19 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc LICENSE README.md -%attr(755,root,root) %{_libdir}/vapoursynth/libbestsource.so +%attr(755,root,root) %{_libdir}/vapoursynth/bestsource.so + +%files -n bestsource +%defattr(644,root,root,755) +%attr(755,root,root) %{_libdir}/libbestsource.so + +%files -n bestsource-devel +%defattr(644,root,root,755) +%{_includedir}/bestsource +%{_pkgconfigdir}/bestsource.pc + +%if %{with static_libs} +%files -n bestsource-static +%defattr(644,root,root,755) +%{_libdir}/libbestsource.a +%endif diff --git a/bestsource-ffmpeg4.patch b/bestsource-ffmpeg4.patch deleted file mode 100644 index c39f330..0000000 --- a/bestsource-ffmpeg4.patch +++ /dev/null @@ -1,33 +0,0 @@ ---- bestsource-d917b26767c41851c50ccad29d8d126e139a7822/src/audiosource.cpp.orig 2023-04-19 19:03:30.000000000 +0200 -+++ bestsource-d917b26767c41851c50ccad29d8d126e139a7822/src/audiosource.cpp 2023-04-25 19:00:34.719483566 +0200 -@@ -153,7 +153,7 @@ LWAudioDecoder::LWAudioDecoder(const std - AP.BytesPerSample = av_get_bytes_per_sample(static_cast<AVSampleFormat>(DecodeFrame->format)); - AP.BitsPerSample = CodecContext->bits_per_raw_sample ? (CodecContext->bits_per_raw_sample) : (AP.BytesPerSample * 8); // assume all bits are relevant if not specified - AP.SampleRate = DecodeFrame->sample_rate; -- AP.Channels = DecodeFrame->ch_layout.nb_channels; -+ AP.Channels = DecodeFrame->channels; - AP.ChannelLayout = DecodeFrame->channel_layout ? DecodeFrame->channel_layout : av_get_default_channel_layout(DecodeFrame->channels); - AP.NumSamples = (FormatContext->duration * DecodeFrame->sample_rate) / AV_TIME_BASE - FormatContext->streams[TrackNumber]->codecpar->initial_padding; - if (DecodeFrame->pts != AV_NOPTS_VALUE) -@@ -256,16 +256,16 @@ BestAudioSource::CacheBlock::CacheBlock( - } else { - int BytesPerSample = av_get_bytes_per_sample(static_cast<AVSampleFormat>(Frame->format)); - LineSize = Length * BytesPerSample; -- Storage.resize(LineSize * Frame->ch_layout.nb_channels); -+ Storage.resize(LineSize * Frame->channels); - - if (BytesPerSample == 1) -- UnpackChannels<uint8_t>(Frame->data[0], Storage.data(), Length, Frame->ch_layout.nb_channels); -+ UnpackChannels<uint8_t>(Frame->data[0], Storage.data(), Length, Frame->channels); - else if (BytesPerSample == 2) -- UnpackChannels<uint16_t>(Frame->data[0], Storage.data(), Length, Frame->ch_layout.nb_channels); -+ UnpackChannels<uint16_t>(Frame->data[0], Storage.data(), Length, Frame->channels); - else if (BytesPerSample == 4) -- UnpackChannels<uint32_t>(Frame->data[0], Storage.data(), Length, Frame->ch_layout.nb_channels); -+ UnpackChannels<uint32_t>(Frame->data[0], Storage.data(), Length, Frame->channels); - else if (BytesPerSample == 8) -- UnpackChannels<uint64_t>(Frame->data[0], Storage.data(), Length, Frame->ch_layout.nb_channels); -+ UnpackChannels<uint64_t>(Frame->data[0], Storage.data(), Length, Frame->channels); - av_frame_free(&Frame); - } - } diff --git a/bestsource-system-AviSynthPlus.patch b/bestsource-system-AviSynthPlus.patch new file mode 100644 index 0000000..b7d6245 --- /dev/null +++ b/bestsource-system-AviSynthPlus.patch @@ -0,0 +1,11 @@ +--- bestsource-R4/src/avisynth.cpp.orig 2024-04-25 09:54:57.000000000 +0200 ++++ bestsource-R4/src/avisynth.cpp 2024-05-27 21:47:03.609466239 +0200 +@@ -23,7 +23,7 @@ + #include "bsshared.h" + #include "version.h" + #include "synthshared.h" +-#include "../AviSynthPlus/avs_core/include/avisynth.h" ++#include <avisynth/avisynth.h> + #include <VSHelper4.h> + #include <vector> + #include <algorithm> diff --git a/bestsource-system-libp2p.patch b/bestsource-system-libp2p.patch index 8994e59..a9e9f44 100644 --- a/bestsource-system-libp2p.patch +++ b/bestsource-system-libp2p.patch @@ -1,63 +1,73 @@ ---- bestsource-d917b26767c41851c50ccad29d8d126e139a7822/meson.build.orig 2023-04-19 19:03:30.000000000 +0200 -+++ bestsource-d917b26767c41851c50ccad29d8d126e139a7822/meson.build 2023-04-25 17:23:34.687680051 +0200 -@@ -3,8 +3,6 @@ project('BestSource', 'cpp', - meson_version: '>=0.48.0' +--- bestsource-R4/meson.build.orig 2024-05-27 06:22:09.431214749 +0200 ++++ bestsource-R4/meson.build 2024-05-27 06:23:24.504374692 +0200 +@@ -29,38 +29,20 @@ plugin_sources = files( + 'src/vapoursynth.cpp', ) -libs = [] -- - sources = [ - 'src/audiosource.cpp', - 'src/videosource.cpp', -@@ -19,26 +17,7 @@ if host_machine.cpu_family().startswith( + p2p_args = [] + + if host_machine.cpu_family().startswith('x86') p2p_args += ['-DP2P_SIMD'] endif -libs += static_library('p2p_main', -- [ +- files( - 'libp2p/p2p_api.cpp', - 'libp2p/v210.cpp', - 'libp2p/simd/cpuinfo_x86.cpp', -- 'libp2p/simd/p2p_simd.cpp' -- ], -- include_directories: ['libp2p', 'libp2p/simd'], -- cpp_args: p2p_args +- 'libp2p/simd/p2p_simd.cpp', +- ), +- cpp_args: p2p_args, +- gnu_symbol_visibility: 'hidden', -) - -if host_machine.cpu_family().startswith('x86') - p2p_args += ['-msse4.1'] - -- libs += static_library('p2p_sse41', -- 'libp2p/simd/p2p_sse41.cpp', -- include_directories: ['libp2p', 'libp2p/simd'], -- cpp_args: p2p_args +- libs += static_library('p2p_sse41', files('libp2p/simd/p2p_sse41.cpp'), +- cpp_args: p2p_args, +- gnu_symbol_visibility: 'hidden', - ) -endif +p2p_dep = meson.get_compiler('cpp').find_library('p2p') - vapoursynth_dep = dependency('vapoursynth', version: '>=R55').partial_dependency(compile_args: true, includes: true) - jansson_dep = dependency('jansson', version: '>= 2.7', required: true) -@@ -48,11 +27,11 @@ deps = [ - jansson_dep, - dependency('libavcodec', version: '>=58.18.0'), - dependency('libavformat', version: '>=58.12.0'), + deps = [ + dependency('libavcodec', version: '>=60.31.0'), + dependency('libavformat', version: '>=60.16.0'), + dependency('libavutil', version: '>=58.29.0'), + dependency('libxxhash'), + p2p_dep, ] - shared_module('bestsource', sources, + link_args = [] +@@ -73,7 +55,6 @@ libbestsource = library('libbestsource', dependencies: deps, -- link_with: libs, install: true, - install_dir: join_paths(vapoursynth_dep.get_pkgconfig_variable('libdir'), 'vapoursynth'), - gnu_symbol_visibility: 'hidden' ---- bestsource-d917b26767c41851c50ccad29d8d126e139a7822/src/videosource.cpp.orig 2023-04-19 19:03:30.000000000 +0200 -+++ bestsource-d917b26767c41851c50ccad29d8d126e139a7822/src/videosource.cpp 2023-04-25 19:05:31.834540622 +0200 -@@ -24,7 +24,7 @@ - #include <thread> + link_args: link_args, +- link_with: libs, + name_prefix: '', + ) + +--- bestsource-R4/src/videosource.cpp.orig 2024-05-27 06:22:09.435468064 +0200 ++++ bestsource-R4/src/videosource.cpp 2024-05-27 06:24:13.798307667 +0200 +@@ -25,7 +25,7 @@ #include <cassert> + #include <iterator> -#include "../libp2p/p2p_api.h" +#include <p2p_api.h> - extern "C" { - #include <libavformat/avformat.h> + #include <xxhash.h> + +--- bestsource-R4/src/audiosource.cpp.orig 2024-04-25 09:54:57.000000000 +0200 ++++ bestsource-R4/src/audiosource.cpp 2024-05-27 06:28:13.010135677 +0200 +@@ -26,7 +26,7 @@ + #include <cassert> + #include <iterator> + +-#include "../libp2p/p2p_api.h" ++#include <p2p_api.h> + + #include <xxhash.h> + ================================================================ ---- gitweb: http://git.pld-linux.org/gitweb.cgi/packages/vapoursynth-plugin-bestsource.git/commitdiff/5dd8382f83136827823529d3fb4c694d2790e4a9 _______________________________________________ pld-cvs-commit mailing list pld-cvs-commit@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit