Merge pull request #15002 from lazka/mpv-meson

mpv: port to meson
This commit is contained in:
Christoph Reiter
2023-01-08 16:18:39 +01:00
committed by GitHub

View File

@@ -5,7 +5,7 @@ _realname=mpv
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.35.0
pkgrel=1
pkgrel=2
pkgdesc="Video player based on MPlayer/mplayer2 (mingw-w64)"
url="https://mpv.io/"
arch=('any')
@@ -24,7 +24,6 @@ depends=("${MINGW_PACKAGE_PREFIX}-ffmpeg"
"${MINGW_PACKAGE_PREFIX}-libjpeg-turbo"
"${MINGW_PACKAGE_PREFIX}-libplacebo"
"${MINGW_PACKAGE_PREFIX}-lua51"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
"${MINGW_PACKAGE_PREFIX}-rubberband"
"${MINGW_PACKAGE_PREFIX}-shaderc"
"${MINGW_PACKAGE_PREFIX}-spirv-cross"
@@ -36,73 +35,41 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-python-docutils"
"${MINGW_PACKAGE_PREFIX}-python-rst2pdf"
"${MINGW_PACKAGE_PREFIX}-vulkan-headers"
"${MINGW_PACKAGE_PREFIX}-cc"
"perl"
"python")
"${MINGW_PACKAGE_PREFIX}-meson"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-ninja"
)
optdepends=("${MINGW_PACKAGE_PREFIX}-youtube-dl: for video-sharing websites playback")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/mpv-player/${_realname}/archive/v${pkgver}.tar.gz"
"001-vulkan-build-fix.patch")
sha256sums=('dc411c899a64548250c142bf1fa1aa7528f1b4398a24c86b816093999049ec00'
'3dab642b7f2c9bad49d26c35e6f645260e93f973a45652f36a65b464f72bea5d')
# strip doesn't work well with the mpv.com wrapper, so strip manually instead
options=(!strip !emptydirs)
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
# https://github.com/mpv-player/mpv/pull/11109
patch -Np1 -i "${srcdir}/001-vulkan-build-fix.patch"
[[ -x ./waf ]] || /usr/bin/python ./bootstrap.py
sed -i 's:bin/env python$:bin/env python:' waf
}
build() {
cd "${srcdir}/${_realname}-${pkgver}"
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}
export WAF_NO_PREFORK=1
MSYS2_ARG_CONV_EXCL="--prefix=" \
meson setup \
--prefix="${MINGW_PREFIX}" \
--wrap-mode=nodownload \
--buildtype=plain \
-Dlibmpv=true \
../${_realname}-${pkgver}
DEST_OS=win32 \
TARGET=${MINGW_CHOST} \
PKG_CONFIG=${MINGW_PREFIX}/bin/pkg-config \
PERL=/usr/bin/perl \
AR=${MINGW_PREFIX}/bin/ar \
WINDRES=${MINGW_PREFIX}/bin/windres \
/usr/bin/python3 ./waf configure \
--prefix=${MINGW_PREFIX} \
--check-c-compiler=${CC} \
--enable-libmpv-shared \
--enable-caca \
--enable-cdda \
--enable-d3d-hwaccel \
--enable-d3d11 \
--enable-dvdnav \
--disable-egl-angle \
--disable-egl-angle-lib \
--enable-jpeg \
--enable-lcms2 \
--enable-libarchive \
--enable-libbluray \
--enable-lua \
--enable-rubberband \
--enable-shaderc \
--enable-spirv-cross \
--enable-uchardet \
--enable-vapoursynth \
--enable-vulkan \
--out="${srcdir}/build-${MINGW_CHOST}"
/usr/bin/python ./waf build
meson compile
}
package() {
cd "${srcdir}/${_realname}-${pkgver}"
export PYTHON=${MINGW_PREFIX}/bin/python
/usr/bin/python ./waf install --destdir="${pkgdir}"
cd "${srcdir}/build-${MSYSTEM}"
# Strip binaries manually
${MINGW_PREFIX}/bin/strip "${STRIP_BINARIES}" "${pkgdir}${MINGW_PREFIX}/bin/mpv.exe"
${MINGW_PREFIX}/bin/strip "${STRIP_BINARIES}" "${pkgdir}${MINGW_PREFIX}/bin/mpv.com"
${MINGW_PREFIX}/bin/strip "${STRIP_SHARED}" "${pkgdir}${MINGW_PREFIX}/bin/mpv-2.dll"
DESTDIR="${pkgdir}" meson install
# Move encoding-profiles.conf to share/doc alongside the example .conf files.
# mpv doesn't search /etc for configuration on MinGW.