-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
PKGBUILD
86 lines (77 loc) · 3.23 KB
/
PKGBUILD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: James Ross-Gowan <rossymiles@gmail.com>
_realname=mpv
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.39.0
pkgrel=1
pkgdesc="Video player based on MPlayer/mplayer2 (mingw-w64)"
url="https://mpv.io/"
msys2_repository_url="https://github.com/mpv-player/mpv"
msys2_references=(
"cpe: cpe:/a:mpv:mpv"
)
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
license=('spdx:GPL-2.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-ffmpeg"
"${MINGW_PACKAGE_PREFIX}-lcms2"
"${MINGW_PACKAGE_PREFIX}-libarchive"
"${MINGW_PACKAGE_PREFIX}-libass"
"${MINGW_PACKAGE_PREFIX}-libbluray"
"${MINGW_PACKAGE_PREFIX}-libcaca"
"${MINGW_PACKAGE_PREFIX}-libcdio"
"${MINGW_PACKAGE_PREFIX}-libcdio-paranoia"
"${MINGW_PACKAGE_PREFIX}-libdvdnav"
"${MINGW_PACKAGE_PREFIX}-libdvdread"
"${MINGW_PACKAGE_PREFIX}-libjpeg-turbo"
"${MINGW_PACKAGE_PREFIX}-libplacebo"
"${MINGW_PACKAGE_PREFIX}-lua51"
"${MINGW_PACKAGE_PREFIX}-mujs"
"${MINGW_PACKAGE_PREFIX}-rubberband"
"${MINGW_PACKAGE_PREFIX}-shaderc"
"${MINGW_PACKAGE_PREFIX}-spirv-cross"
"${MINGW_PACKAGE_PREFIX}-uchardet"
"${MINGW_PACKAGE_PREFIX}-vapoursynth"
"${MINGW_PACKAGE_PREFIX}-vulkan"
"winpty")
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-meson"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-python-docutils"
"${MINGW_PACKAGE_PREFIX}-python-rst2pdf"
"${MINGW_PACKAGE_PREFIX}-vulkan-headers")
optdepends=("${MINGW_PACKAGE_PREFIX}-yt-dlp: for video-sharing websites playback")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/mpv-player/${_realname}/archive/v${pkgver}.tar.gz")
sha256sums=('2ca92437affb62c2b559b4419ea4785c70d023590500e8a52e95ea3ab4554683')
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
}
build() {
mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM}
MSYS2_ARG_CONV_EXCL="--prefix=" \
meson setup \
--prefix="${MINGW_PREFIX}" \
--wrap-mode=nodownload \
--buildtype=plain \
-Dlibmpv=true \
-Djavascript=enabled \
$([[ ${CARCH} == aarch64 ]] && echo "-Dgl=disabled") \
../${_realname}-${pkgver}
meson compile
}
package() {
cd "${srcdir}/build-${MSYSTEM}"
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.
mv "${pkgdir}${MINGW_PREFIX}/etc/mpv/"*.conf "${pkgdir}${MINGW_PREFIX}/share/doc/mpv/"
# mpv needs winpty for key bindings to work on the terminal
mv "${pkgdir}${MINGW_PREFIX}/bin/mpv.exe" "${pkgdir}${MINGW_PREFIX}/bin/mpv_exe"
_exename=mpv
echo '#!/usr/bin/env bash' > "${pkgdir}${MINGW_PREFIX}/bin/${_exename}"
echo 'export _started_from_console=yes' >> "${pkgdir}${MINGW_PREFIX}/bin/${_exename}"
echo '/usr/bin/winpty "$( dirname ${BASH_SOURCE[0]} )/'${_exename}'.exe" "$@"' >> "${pkgdir}${MINGW_PREFIX}/bin/${_exename}"
mv "${pkgdir}${MINGW_PREFIX}/bin/mpv_exe" "${pkgdir}${MINGW_PREFIX}/bin/mpv.exe"
}