- 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
This commit is contained in:
Mia Herkt 2022-11-19 02:49:43 +00:00 committed by Git OBS Bridge
parent 903e7fb48d
commit 5a670227ec
2 changed files with 73 additions and 3 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sat Nov 19 02:48:45 UTC 2022 - Mia Herkt <mia@0x0.st>
- 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

View File

@ -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