From 5a670227ec956270f406274bfa3674815643d0cc41d3856e7fec69c6517fb7ff Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Sat, 19 Nov 2022 02:49:43 +0000 Subject: [PATCH] - Use Meson for build where possible as waf will be dropped in a future version OBS-URL: https://build.opensuse.org/package/show/multimedia:apps/mpv?expand=0&rev=284 --- mpv.changes | 6 +++++ mpv.spec | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 3 deletions(-) diff --git a/mpv.changes b/mpv.changes index 3817e3f..f68a5d1 100644 --- a/mpv.changes +++ b/mpv.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Nov 19 02:48:45 UTC 2022 - Mia Herkt + +- Use Meson for build where possible as waf will be dropped in a + future version + ------------------------------------------------------------------- Sat Nov 19 00:49:40 UTC 2022 - mia@0x0.st diff --git a/mpv.spec b/mpv.spec index 9612cef..5228438 100644 --- a/mpv.spec +++ b/mpv.spec @@ -37,6 +37,9 @@ BuildRequires: bash BuildRequires: hicolor-icon-theme BuildRequires: libjpeg-devel BuildRequires: linux-kernel-headers +%if 0%{?suse_version} > 1500 +BuildRequires: meson >= 0.60.3 +%endif # Needed any lua to convert the bash-completion BuildRequires: lua BuildRequires: perl @@ -199,6 +202,59 @@ DATE="$(date -d "$MODIFIED" "+%%b %%e %%Y")" sed -i "s|UNKNOWN|$DATE|g;s|VERSION|\"%{version}\"|g" common/version.c %build +%if 0%{?suse_version} > 1500 +# We don't want to rebuild all the time. +myopts=" -Dbuild-date=false" +# Disable pipwire for Leap because of build error +%if 0%{?suse_version} <= 1500 +myopts+=" -Dpipewire=disabled" +%endif +%meson \ + -Dlibmpv=true \ + -Dmanpage-build=enabled \ + -Dcdda=enabled \ + -Ddvbin=enabled \ + -Ddvdnav=enabled \ + -Dopenal=enabled \ + -Dandroid-media-ndk=disabled \ + -Daudiounit=disabled \ + -Dcocoa=disabled \ + -Dcoreaudio=disabled \ + -Dd3d-hwaccel=disabled \ + -Dd3d11=disabled \ + -Dd3d9-hwaccel=disabled \ + -Ddirect3d=disabled \ + -Degl-android=disabled \ + -Degl-angle-lib=disabled \ + -Degl-angle-win32=disabled \ + -Degl-angle=disabled \ + -Dgl-cocoa=disabled \ + -Dgl-dxinterop-d3d9=disabled \ + -Dgl-dxinterop=disabled \ + -Dgl-win32=disabled \ + -Dios-gl=disabled \ + -Dmacos-10-11-features=disabled \ + -Dmacos-10-12-2-features=disabled \ + -Dmacos-10-14-features=disabled \ + -Dmacos-cocoa-cb=disabled \ + -Dmacos-media-player=disabled \ + -Dmacos-touchbar=disabled \ + -Dopensles=disabled \ + -Doss-audio=disabled \ + -Drpi-mmal=disabled \ + -Dsdl2-audio=disabled \ + -Dsdl2-gamepad=disabled \ + -Dsdl2-video=disabled \ + -Dsndio=disabled \ + -Dspirv-cross=disabled \ + -Dswift-build=disabled \ + -Dvideotoolbox-gl=disabled \ + -Dwasapi=disabled \ + -Dwin32-internal-pthreads=disabled \ + ${myopts} + +%meson_build +%else # SDL: disable as it is pointless to have on Linux, it is Windows/OS X fallback. myopts="--disable-sdl2" # We don't want to rebuild all the time. @@ -209,6 +265,10 @@ myopts+=" --disable-debug" %if 0%{?suse_version} <= 1500 myopts+=" --disable-pipewire" %endif +# Vulkan support needs recent libplacebo +%if 0%{?suse_version} >= 1550 || 0%{?sle_version} > 150300 +myopts+=" --enable-vulkan" +%endif export CFLAGS="%{optflags}" python3 ./waf configure \ --prefix="%{_prefix}" \ @@ -228,9 +288,6 @@ python3 ./waf configure \ --enable-openal \ --enable-wayland \ --enable-gl-wayland \ -%if 0%{?suse_version} >= 1550 || 0%{?sle_version} > 150300 - --enable-vulkan \ -%endif --enable-gl-x11 \ --enable-egl-x11 \ --enable-egl-drm \ @@ -238,9 +295,16 @@ python3 ./waf configure \ ${myopts} python3 ./waf build --verbose %{?_smp_mflags} +%endif %install +%if 0%{?suse_version} > 1500 +%meson_install +install -dm755 %{buildroot}%{_defaultdocdir} +mv %{buildroot}%{_datadir}/doc/mpv %{buildroot}%{_defaultdocdir}/%{name} +%else python3 ./waf --destdir=%{buildroot} install +%endif install -D -m 0644 etc/input.conf %{buildroot}%{_sysconfdir}/%{name}/input.conf install -D -m 0644 etc/mpv.conf %{buildroot}%{_sysconfdir}/%{name}/mpv.conf